From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9C0E13148AC for ; Wed, 3 Dec 2025 19:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764790872; cv=none; b=p9xY0CVqXLdTDpn6yxa7H353KPu9nmymDQMDNz+/UIrgaHeUty3fSTtUSBk5zDsJje4K9YDlpGXB6Q9cknMoFZSN8gB0zmiUpGT9uywm612DZNyLlrQ7NHWrUR522wHdIWa1ypb6GyEJMt7jpMK2BFih+c6qzmxSQ/BIsEBQuhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764790872; c=relaxed/simple; bh=WvaZ8lzZd1gwInQrOkgvDiGSP9hld3OnZBZSi3u3Y7A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Vpu1qq2+le4fqm+GI5uLsoONqAaXwSoYpSR3uVF+YeJMbnd0oL0SaFlz6aWO7Svz1X+aAAqmyWU8Kt5lmQpSVXL2RoDK2ryTcGV8Pw2b610R/Xwl1xH1w3dFSv9h/r7TMNhiXnGCClGUUeY1msqs6+UypQ1lv/x/2YON14mR7V8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fZnt0kYq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fZnt0kYq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD9D6C4CEF5; Wed, 3 Dec 2025 19:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764790870; bh=WvaZ8lzZd1gwInQrOkgvDiGSP9hld3OnZBZSi3u3Y7A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fZnt0kYqBbRaqFSvQIvDo/u+xoFezmc6962/ujb1r836/cs+hJqNEYLk5AwfXwAYt 5BU3Yxbk8tRhXHpG+DqnNzfGxEgHTrHIHfwy9aDKW2/yH894eK8rkfCYi+bE0f4VZp Qudsc6j66dx8maWIqrPKVbfBexreD0QcxvcGw/T98lALT9WEzPYnGc53UJwSBil9h+ JPz0s800gcJcKCRZ3Y6QlijjwA3B9ioNHixQCMtUmr/FVwj+WmTtTZTaBABupQzaRK PjMZKSiaIT33Wa5oLB2b11AE1K1YotCtWPdeFzDl/vVRsxumrt42DhbqsKKv9UXVLg gvh3mLSWqAT1Q== Date: Wed, 3 Dec 2025 09:41:09 -1000 From: Tejun Heo To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org, ying chen , Lai Jiangshan Subject: Re: [PATCH V4 3/4] workqueue: Limit number of processed works in rescuer per turn Message-ID: References: <20251125063617.671199-1-jiangshanlai@gmail.com> <20251125063617.671199-4-jiangshanlai@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hello, Lai. On Wed, Dec 03, 2025 at 11:22:32AM +0800, Lai Jiangshan wrote: > On Wed, Dec 3, 2025 at 2:16 AM Tejun Heo wrote: ... > > Alternatively, just > > separate out the pwq rotation into a separate function, so that the caller > > can do > > > > while (assign_rescuer_work(..)) { > > process_scheduled_works(rescuer); > > if (++count > RESCUER_BATCH) { > > rotate mayday list; > > The current implementation of the cursor cannot be processed by workers as a > regular work item, which means it has no pwq reference and cannot be left > behind if the pwq is not put back on the mayday list. As a result, the code > here has to handle the cursor explicitly, which adds extra burden to > understanding the code. I'm probably missing something but what prevents rescuer_thread() from just not calling assign_rescuer_work() and just call send_mayday() on the pwq? send_mayday() currently takes @work but all it cares about is pwq, so we can just pass in pwq. Thanks. -- tejun