From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 22E723CF66C for ; Thu, 4 Jun 2026 08:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780563016; cv=none; b=NSKVI4fSd4pVjEp1ciSoDaZ15IWunUfSCiLKW1TL+NMUpUqhxUEzXYElUcoCW6TvM/jHBZ+VrRLrv4Prz7i8cqIZUQEloIanFFHPlDqPerkNjY9s9HL8P/8aFyPlXtoQIrq659PI6msJu/XXg0LynYECo0qecUqY9/tW2eHZ5hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780563016; c=relaxed/simple; bh=8/w73E1u4nCEi71ftYjtcSvGGE/M2p5BpP8E0XUh2Qo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HQH4EBbMyzcyw+c++NqghtJ5JJBPMRsN0bC1vWNaBXkkVwm4AWw+hYdVTxHiD2anr+R8OTZxBpdin6DZAks6mX62g3MWGEj7uWUn+Da6bfnxQi63SJxGWjOPr31DVH7/PMPlxUZXEQ1IOKQY6lRc6SBDnHHKKQCgm/XR58qk5vI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PisRP/t6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PisRP/t6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3A4A1F00893; Thu, 4 Jun 2026 08:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780563014; bh=yOrFtfnLYteE70MncSINyMH+7G5D9uKCzsMqNmQlJiA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=PisRP/t6pcXe5ByRNxtHvqQEBqCE8grzeNFMDnEd9XBOpg+b0ZGTNJ3BE2vMY7O8a mOhCjFTXG5m86u1cqWAM2qqwoOZlxLHBjjDqrTk11fwGgzBT3EhGja9cPuvaCkmP5j I1fmglvy4Crk9ogCRyX+W8eeG+LgC+eaymd6qAKkw1Miw4gvTgAFcJL7dpm1y04ayk f5yjEoBy6ti3aQk9brqZit/I4xN1HT5Er8iUF59YupQs1G2cWvWa261YvFpvfMmsgk Qw4HPt/TvMA4e13WaxBcE0QMixrUF9vAV4yh47QEMu4Olhrpl8DI24DLDaMGxeaV71 vm7wSuvO1km8A== Date: Wed, 3 Jun 2026 22:50:13 -1000 From: Tejun Heo To: Breno Leitao Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, marco.crivellari@suse.com, frederic@kernel.org, bigeasy@linutronix.de, Hillf Danton , kernel-team@meta.com Subject: Re: [PATCH v2 1/4] workqueue: park kicked worker on pool->kicked_list Message-ID: References: <20260603-fastwake-v2-0-2977512fe7fa@debian.org> <20260603-fastwake-v2-1-2977512fe7fa@debian.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260603-fastwake-v2-1-2977512fe7fa@debian.org> Hello, On Wed, Jun 03, 2026 at 06:40:08AM -0700, Breno Leitao wrote: > kick_pool() picks an idle worker and wakes it, but leaves it WORKER_IDLE > on pool->idle_list until the woken kthread schedules in and runs > worker_leave_idle(). idle_cull_fn() only checks WORKER_IDLE, not the A lot of the existing comments in the file are double spaced but let's not do that anymore. Please use single space to separate sentences in desc and comments. > task state, so a kicked-but-not-yet-scheduled worker is still a valid > cull victim -- the cull can reap it before it consumes the just-enqueued > work, stranding the item. The window is narrow today but later patches > in this series defer the wakeup outside pool->lock, widening it. Have you actually reproduced this? Idle culling never dips below 2 idle workers. Wakeup is from the head of the list and culling from the end. How can the same worker be both the wakeup and culling target? You might think a woken idle worker can be pushed down the list by workers which became newly idle before the woken worker could dispatch the work; however, there are no distinctions between a newly woken idle worker and a task which is about to turn idle. IOW, other workers cannot turn idle without picking up the work item that the idle worker was woken up for. I could be wrong but these days it's fairly low effort to reproduce these perceived problems using AI agents. Please consider reproducing the problem before submitting patches. Thanks. -- tejun