Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1043107rdb; Fri, 9 Feb 2024 08:37:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2gOSzP6ZImdrq70HPpfxGggSLX1yhyp9vdzLE5Ni6aELRfWSAXkX7RG8wBRkJzcdvPCRs X-Received: by 2002:a0c:f050:0:b0:68c:7e26:63ca with SMTP id b16-20020a0cf050000000b0068c7e2663camr1937443qvl.46.1707496647147; Fri, 09 Feb 2024 08:37:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUJK3ciE79DWK0CgU+MQY5snJTXawjsG7KRHiba9bdwPX0t4U0gV2ZsMS8FjphSEzS7aHdn1AgqtGTXc0ZmU8tmhScFmfwBlMrOOOFe0Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t13-20020a05621421ad00b0068c73923a06si2267393qvc.559.2024.02.09.08.37.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 08:37:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59617-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@lwn.net header.s=20201203 header.b=Zmyp79Sr; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-59617-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59617-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lwn.net 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 DEBCC1C2155C for ; Fri, 9 Feb 2024 16:37:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78C047BAE2; Fri, 9 Feb 2024 16:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b="Zmyp79Sr" Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) (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 D13037B3CF for ; Fri, 9 Feb 2024 16:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.79.88.28 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707496613; cv=none; b=YeH7InBgn0jQpA6N5QszI/reSbZBesF8WLGTTM/asDtOyU8+mptv1nB59B1+WcxcJthOk4vVWSqGxLtKv6HlcYrvPV/UxKoT7gS5ZfnnZdQqMbKZuggNe8uiiYhDTGm0aLVd5qP+OdvyOQU5g5rshY64mRm1omNAK26v6RA43ZQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707496613; c=relaxed/simple; bh=d7okUqp/3uZnwXF7MeKDkSh0JzNedP4z+LN7JvpdaHA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=OXTljWkpiJIkzNHk6LEQWGH3Y9pp/E/kx3Q+h4L+GVkWnrZuK3uTY7YMjD5XvLgEbCbM1IqoatMjn0rL9a4eYt9H6koApp0xkT9kk1imqRcuiAPuCxTysyDSUWFWYvCKW2+Sm1yn5aExsUIQY1pd6zShIWuEzrn+f4hEKunGBwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net; spf=pass smtp.mailfrom=lwn.net; dkim=pass (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b=Zmyp79Sr; arc=none smtp.client-ip=45.79.88.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lwn.net DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net C639C41A2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1707496611; bh=NRT0BzbVaBiW/CbrG+I1Jwm5NSvx3kcZk+mnaMCJbrY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Zmyp79SrYdrLr0mM1ufjNYkLxvlR9/31+UkcdlW2eVhwXvE4ByFO64Z2M64uauywM ZR93kdhg0fYtarXwaD7JiSC3It+dnFohyWeIzWsaiv66zKIy8yufgLHvseLL2C13Nf Qxp+EGiCdxHTt6GkYgJWRNoEplOezdab2ozv4ZFThMqymVUt966sw0fLkidRhW2b+n H/Oe03GypYDPcAYVMHvC8YcpHgmVAlS5PVsXRVP/vGTgNSKlpTguPRGJ6HxlfRe87P p9S+WPDIgTpcuePy8GINUb+kXWR/uXrGaZ92zCx9LsSwHFjuqnonVdVAHup3SacFFG BlzcyR701hAog== Received: from localhost (unknown [IPv6:2601:280:5e00:625::646]) (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 ms.lwn.net (Postfix) with ESMTPSA id C639C41A2A; Fri, 9 Feb 2024 16:36:50 +0000 (UTC) From: Jonathan Corbet To: Tejun Heo , Waiman Long Cc: Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH] workqueue: Fix kernel-doc comment of unplug_oldest_pwq() In-Reply-To: References: <20240209145850.1157304-1-longman@redhat.com> Date: Fri, 09 Feb 2024 09:36:50 -0700 Message-ID: <87zfw9d271.fsf@meer.lwn.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Tejun Heo writes: > (cc'ing Jonathan and quoting whole body) > > I'm not necessarily against the patch but at least from in-code > documentation POV the diagram being in the function comment seems better. > Jonathan, do you happen to know a better way to address this? So I went to reproduce this problem, but it seems that it's hidden away in some branch and not in linux-next. So I'll have to guess without testing my solution, but... > On Fri, Feb 09, 2024 at 09:58:50AM -0500, Waiman Long wrote: >> It turns out that it is not a good idea to put an ASCII diagram in the >> kernel-doc comment of unplug_oldest_pwq() as the tool puts out warnings >> about its format and will likely render it illegible anyway. Break the >> ASCII diagram out into its own comment block inside the function to >> avoid this problem. >> >> Signed-off-by: Waiman Long >> --- >> kernel/workqueue.c | 32 ++++++++++++++++++-------------- >> 1 file changed, 18 insertions(+), 14 deletions(-) >> >> diff --git a/kernel/workqueue.c b/kernel/workqueue.c >> index cd2c6edc5c66..f622f535bc00 100644 >> --- a/kernel/workqueue.c >> +++ b/kernel/workqueue.c >> @@ -1790,25 +1790,29 @@ 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 >> * >> - * 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. >> - * >> - * dfl_pwq --------------+ [P] - plugged >> - * | >> - * v >> - * pwqs -> A -> B [P] -> C [P] (newest) >> - * | | | >> - * 1 3 5 >> - * | | | >> - * 2 4 6 >> + * This function should only be called for ordered workqueues where only the The problem here is that you have a literal block without marking it as such. If you were to format it as: > * next oldest one (first plugged pwq in iteration) will be unplugged to > * restart work item execution to ensure proper work item ordering:: > * > * dfl_pwq --------------+ [P] - plugged > * | > * v > * pwqs -> A -> B [P] -> C [P] (newest) > * | | | > * 1 3 5 > * | | | > * 2 4 6 > * > * This function should only be called for ordered workqueues where only the ..it should work. The changes are the "::" after "ordering" and the blank line at the end of the block. Thanks, jon