From patchwork Fri Feb 9 17:06:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 199023 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp996396dyd; Fri, 9 Feb 2024 09:09:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuiRGsKsJAvPXjUJHfiUB3zKUzbxkbDKDCxqmtH8BBywTyxoAVHq6tO43ta5RLg5c8nEup X-Received: by 2002:a05:620a:385a:b0:785:3adb:f145 with SMTP id po26-20020a05620a385a00b007853adbf145mr2060077qkn.57.1707498582258; Fri, 09 Feb 2024 09:09:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707498582; cv=pass; d=google.com; s=arc-20160816; b=kXzfTWrsywuaE9+3whn6cpjRB/B1ezTNfg7YBbcUek0y2MsFiSDxm/J3T7xsLbfCvn icNnD3OsBdwWyEeFeK4hKUiDqSPOFwP56vGFr7hc6VFTsmItbhJDPVATc5WIeJTJMt9x FX6CNzJwpfu/63o60ygF2iPZvNMdrjjNMrUDMQ+6FaEX9haCzA7KkyjSVx4Omag/5pQF MS4PbJ5JDgKWOhi/7O1+Dk3txcJkcNFkDBqIVkCKUkwq6bVCVF2nlmU4ZF8UTar16oA0 f9/dh17J+WI3klm+msTPKYW6NeL6LpoJLMUVfUSbdNcnGj4UtfmyYsnydlYuBL16S0aK Aryw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=inghrfI9q8SDCIbQ6QauyZqdtpQq5fNv91h6apsRIK8=; fh=HY4jfHbfBQZKh12K1I8M86DAQ858cVv1lkmPZNnwe2Y=; b=o1RYaQ9kmjLd+OjS8Tz9ltPpdzjQYmyCBoYx+si93xvZdVhudZ5/9oF/Mgsny2gK1+ 0F7MvAAkinFfoCGD1PHUWno84jbUncMWi4o2WZlmmHJZJxG1pvtTLlYtuCOh9RE8iHfo tLYlaVFMmRfZxmQLAtcD9o8WDxbv3lWxaulUQHUklxAYn6Bb8jS5K3dFIsosmmYmILzq KfFKFZBKTVi55dM2ckGY6X4WMJqewGG+uolG85VP+KusXVqqPxzjbFxB4oYRl7seY3E8 e5tv0/TXHEhqpEcP28Ejc+Xhy6gbWEmjng1skKL4I1zARHZrfes/NRv6aksfbnLkN1I0 QMGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O24YBxP6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-59700-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59700-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCW6prS2iSQ4sKtOSK91WPD5aHtBuU4zaBq4wjdfxjqQX3OeKE3xWTshvrM84y0L6PAGSug6vA8921uf4cqeHVUiG3uXqQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z8-20020ae9c108000000b00783def880b8si2390359qki.301.2024.02.09.09.09.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 09:09:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59700-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O24YBxP6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-59700-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59700-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B669B1C28514 for ; Fri, 9 Feb 2024 17:08:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FC87823AA; Fri, 9 Feb 2024 17:07:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O24YBxP6" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1197276414 for ; Fri, 9 Feb 2024 17:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498448; cv=none; b=XTGn3ywKc7yPG416cgC4YtBf0NzzOJr/xenzAR673E+TN7SZ2Yf+UCJpuQLb6vDOo6RKisEr+lDmvsd9kmLrhi3HOKy1SVsXCWN0tmi7i/BOn7mOS2p2txO/Jd/nXsgXAE+LQH5VyT/La/jJVFbxo9MafBmoc6SkyKhDZOUiaiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498448; c=relaxed/simple; bh=lXj0p83miCCs1eZl068ESAgPJXD6oMzDd+cA3SQSAZA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=HBgdH2iXPyToyKwTozq5E2MsJnTZcb/fKxbZ9ArOExWXWeK5ZXOH/YKAuWtQ+NEz7b5Gc4nf4sZAY/GXcvvxAWPmg21++lxHMtG3wTYgeSinz5Ri/SoFt6fuQXyBbLcN3GbRE+7kCQI/E4GSPbChacujMUTYKQVs/e7nmqwsbCs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=O24YBxP6; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707498446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=inghrfI9q8SDCIbQ6QauyZqdtpQq5fNv91h6apsRIK8=; b=O24YBxP6sTbKZJYmiIgT6umes38e4l92+9D2kARqgsKZQ4WhFLiFVvK2i41dlpSlHdKFsl 9MnJIXBsnS1vNWcviD4wZ4I9LhoiBwdG1OlkjZvvMokaxLOPjPVU1boECidjR/tLDrV/df JeOxT9wPpNHd31gXrjKsW2R2G1x6dnQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-336-R2s17w-7NhGuSLaZ_skc6Q-1; Fri, 09 Feb 2024 12:07:20 -0500 X-MC-Unique: R2s17w-7NhGuSLaZ_skc6Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08BFF1C05AEE; Fri, 9 Feb 2024 17:07:19 +0000 (UTC) Received: from llong.com (unknown [10.22.17.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id B119C2026D06; Fri, 9 Feb 2024 17:07:18 +0000 (UTC) From: Waiman Long To: Tejun Heo , Lai Jiangshan , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, Waiman Long Subject: [PATCH v2] workqueue: Fix kernel-doc comment of unplug_oldest_pwq() Date: Fri, 9 Feb 2024 12:06:11 -0500 Message-Id: <20240209170611.1166299-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790433835338299892 X-GMAIL-MSGID: 1790442033562667695 Fix the kernel-doc comment of the unplug_oldest_pwq() function to enable proper processing and formatting of the embedded ASCII diagram. Signed-off-by: Waiman Long --- kernel/workqueue.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index cd2c6edc5c66..ddcdeb7b9f26 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1787,14 +1787,12 @@ static bool pwq_activate_first_inactive(struct pool_workqueue *pwq, bool fill) } /** - * unplug_oldest_pwq - restart an oldest plugged pool_workqueue - * @wq: workqueue_struct to be restarted + * unplug_oldest_pwq - unplug the oldest pool_workqueue + * @wq: workqueue_struct where its oldest pwq is to be unplugged * - * pwq's are linked into wq->pwqs with the oldest first. For ordered - * workqueues, only the oldest pwq is unplugged, the others are plugged to - * suspend execution until the oldest one is drained. When this happens, the - * next oldest one (first plugged pwq in iteration) will be unplugged to - * restart work item execution to ensure proper work item ordering. + * This function should only be called for ordered workqueues where only the + * oldest pwq is unplugged, the others are plugged to suspend execution to + * ensure proper work item ordering:: * * dfl_pwq --------------+ [P] - plugged * | @@ -1804,6 +1802,11 @@ static bool pwq_activate_first_inactive(struct pool_workqueue *pwq, bool fill) * 1 3 5 * | | | * 2 4 6 + * + * When the oldest pwq is drained and removed, this function should be called + * to unplug the next oldest one to start its work item execution. Note that + * pwq's are linked into wq->pwqs with the oldest first, so the first one in + * the list is the oldest. */ static void unplug_oldest_pwq(struct workqueue_struct *wq) {