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 C53C63E51FD for ; Thu, 4 Jun 2026 08:50:30 +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=1780563031; cv=none; b=q32xA5EIYUYxj/fH0CASIpoUxM9aAXgtbHgsT3sBzt01SWd6em31Rm2sQ+MeDnNfuu3+Dmr1LsSYBa7E1VXsH19A3T+l6CFghtZjPaAgQ7LTBhn2ko/G5pJzYNCwkY5aQiaEc5Tk28mAQThOE0uoOWm72KHW2yx647+/BLzgcYY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780563031; c=relaxed/simple; bh=tOOFycWMfwCnmH2JNQzfKJt0MfocjyN22Ju+CGKzz7g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IXJpRZS78kZd8YwNntq3otQiy1s7pfVUQIVA3UUnphOOcaDTyisZYNKHFvUre8jKskYrWkt7VGAUjrY9aJpdkwIGjv9FSZMV1IZB6SRlxKFDRMzrIYr+S0M/dYiLU+XdvKYycUUYCJxd7G0nPNBQ9eQZGeJ7AzElYG2jqkpmWqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=afsT+wfT; 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="afsT+wfT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 802591F00898; Thu, 4 Jun 2026 08:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780563030; bh=j82ikGe06BAbF6tH67GjgRNV7TnW5uhuDjZiz6//Xi0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=afsT+wfTyVsd9KnS76JgtL2EMUT52y5obkfezoA66Czxcp2wQqdxtqQXZqNiNpd3k 0eiMqs0/odClXeV7+8qa7cbe97+nfiKdZtUDB83/r+oHxujnrA+3dCZbtg3yDKKIFc IHwXabvPWWBoDRyy3dEVWKWYIA8dwx5y/BQmC0hXAb8RyGuHP9F0LmOtSqscJD0PQL yo+EcYC0ohhzwoepHANZsFJ904DLub75yux03qSlMxlAPTs2zXmGCV9KpWB49fq1Cx tpv22Xt1xfUMeCGFS4sPhih+hpO5E0RBReoPGTMn6EeYCqIhD2E+y7fHOpZMsgNrQG We8jyrz3UVfzA== Date: Wed, 3 Jun 2026 22:50:29 -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 4/4] workqueue: defer the worker wakeup outside pool->lock in process_one_work() Message-ID: References: <20260603-fastwake-v2-0-2977512fe7fa@debian.org> <20260603-fastwake-v2-4-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-4-2977512fe7fa@debian.org> On Wed, Jun 03, 2026 at 06:40:11AM -0700, Breno Leitao wrote: > process_one_work() kicks the pool to chain execution of the remaining > work items on WORKER_NOT_RUNNING pools (the UNBOUND and CPU_INTENSIVE > ones), calling kick_pool() while holding pool->lock. As in the enqueue > path, the wakeup pulls the target rq->lock in under pool->lock. > > Use kick_pool_pick() to select and claim the worker under pool->lock and > issue the wakeup with wake_up_q() after the lock is dropped via > raw_spin_unlock_irq_wake(). > > With both hot paths converted, measured on a CONFIG_SMP x86 VM (8 vCPUs) > with the in-tree test_workqueue benchmark (lib/test_workqueue.c; each of > 8 producers queues 200000 work items one at a time on a WQ_UNBOUND > workqueue, waiting for each to complete), medians of five boots per > scope: Please test on bare metal. Thanks. -- tejun