From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 9A05635F180 for ; Wed, 27 May 2026 15:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779895330; cv=none; b=lN0A7FU+HVmqTFH46pv/old2T6cYQAET3nVLKgcOHVnASpZNF9wErDsk58E6kklS6/tkJ09pzYiUgZeYSUOBLJSi4IDTTEuuXMjOoMH6ut7/Y70bypt+CuU9ndLnrSxD2Nh0HAdY9tdTml+UO3c8SZR66qH7NB1b5JBFsf0ci4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779895330; c=relaxed/simple; bh=CpbEkd6WWYmj1i3zc+JA9uvskBaMv9pY00nHNbuHNCA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JoYu9INohRzONVtkYX4ns6EWui+CIEfK005F6Qef/FbumrkyoE7gOpklh0DHB1LCE68vpk0rKdS+LFGYU5ipJFl09eUNUWn5FbyZ6yXOtbzowbXPTtRGXcmpJHGi40BZ1qh8UbU3bx/FLEyo3/d1fgp+9TR3FwuXQ75zol3lvUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Hz37TpS9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rQM1qssE; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Hz37TpS9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rQM1qssE" Date: Wed, 27 May 2026 17:22:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779895326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MKtew5CD9/qhoMrll/WQFkRQobLuNtujdOyP/8s6nsE=; b=Hz37TpS9u/hw8Va8CeF+y7Eqhs8BL75BcmMjT8tOjB4G8uoUSFLub+h7TKSlYIakxjCNbA aRHVtnQZG5gDfrKHBpwARwvSFKN5dppBSnP9PpSTbPVPHiX5BqWkKyBci2l6y7jBkayhlS U+pwmyXd2QRvgYR6ycThj+Pc7aNceiK20/26ZoTjw4nQVlHqnzUFc62G/LhSSxYhTDdxRX OKU+/SEmW9qstbINRmELjSGTycTgyDjwtePPyQJmqz98nZ6Vu9/oPVKVmqAzU28+YiElY7 Yr4W6sbnYYaqwHAkxZpVPhUV+E+Uv50HufGMDwvVmTLcPrfXCN74d/BcQg30dg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779895326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MKtew5CD9/qhoMrll/WQFkRQobLuNtujdOyP/8s6nsE=; b=rQM1qssEPMdWZPu6anurhC7CxIva6rv3TyUL5Fg2RZJLCeJIqYOl+9SBgXFPpGb9N4wT2M ltOtYH9dH6+PbjDw== From: Sebastian Andrzej Siewior To: Breno Leitao Cc: Tejun Heo , Lai Jiangshan , linux-kernel@vger.kernel.org, marco.crivellari@suse.com, frederic@kernel.org, kernel-team@meta.com Subject: Re: [PATCH 2/2] workqueue: defer wake_up_process() outside pool->lock on hot paths Message-ID: <20260527152205.OjEsPVjM@linutronix.de> References: <20260526-fastwake-v1-0-e69ad86923e6@debian.org> <20260526-fastwake-v1-2-e69ad86923e6@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=utf-8 Content-Disposition: inline In-Reply-To: <20260526-fastwake-v1-2-e69ad86923e6@debian.org> On 2026-05-26 14:08:06 [-0400], Breno Leitao wrote: > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -2423,6 +2424,15 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, > > out: > raw_spin_unlock(&pool->lock); > + /* > + * Issue the wakeup after dropping pool->lock to shorten the > + * locked region on this hot enqueue path. kick_pool_pick() did all > + * of the work that required the lock (worker selection and > + * wake_cpu setup); the wake_up_process() itself only needs to > + * take the target rq->lock. > + */ > + if (wake_p) > + wake_up_process(wake_p); What about using wake_q_add() to grab a worker(s) and then wake_up_q() to wake the worker outside of the lock? > rcu_read_unlock(); > } > Sebastian