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 CFE0D42E01F for ; Wed, 27 May 2026 15:35:03 +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=1779896106; cv=none; b=bFFQSw8wENI/KmSJJz9ZzFbzFEJ9ryQvRUZt7k2v4Kl5H3CKScEsQZfjpzH8s6CcmdbQ26Ef/bR2z30ZmJ8WTxq089hz8iYXUKpGi+gNEMt/Ke2OkDP6fR20VCwOvXWkbxDEFUNxVv6N+2AADOdR/A1+rkuUf0blQD2gvYKWeCY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779896106; c=relaxed/simple; bh=LRElsNi9wstzv4m4r6edoqctl/FY6FdXWh9N0iq5IEs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GI8Z3p9QP0Jew5pTkO36zO0TR9mKiGMJAaUV+d/53or87UPmz/e4sHoEamULgcBTlamv/oN9WgxHlNRtWs2moFrDKrplmLup3dNjbWM1ot59Mz1+R8UMBQRCuEOe1LywpJqT/pcFvNCtQQLN7c+x1bVIHZ7SQkxAc0LH0Ft3xp4= 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=mhfaiCbu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7ePbTDb6; 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="mhfaiCbu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7ePbTDb6" Date: Wed, 27 May 2026 17:35:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779896101; 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=iIvTrewOpWheES3DyDBV1mnJcr8CMemMiqEwOAyjD/Q=; b=mhfaiCbuUyM1yQ0hUzk7JosFDMxJ46a/hNIDmB47SXeXKPzhkhlQ+TVfC0PhwcuRGiDZS3 +vqfs8krkopz+3aO2WygqhrYs3vkYihj9HZcQxZIYU2NORLvrnILefQXjaf1slpK9C6VzY eqzjIQ1Ik/8Tl2Gz0wvEAAx5vhjpukQmWh6LapOJEH9Xlj9Ec1ZccucR56bcE15QrkK/sm yTZHad2ZGyjS+sdh9KtAOttBdiTaxE6CEc9itywfD8477amdklcYezxWLn1Vksnqkcf8BM BkEnqFmR4Pun/vQhHHe/hDd4cQpe0ZZeo6XG4VfJCKQG0VeP2COepuCwRrXdOQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779896101; 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=iIvTrewOpWheES3DyDBV1mnJcr8CMemMiqEwOAyjD/Q=; b=7ePbTDb6dGmtoyyoogN7Jss2xS+QDKiu+P/nEM3XXdVga+sUbAg/KdkuNDQhkuxtcU5Kw2 ayzMMRulMmDcGmBQ== From: Sebastian Andrzej Siewior To: Breno Leitao Cc: Hillf Danton , Tejun Heo , Lai Jiangshan , linux-kernel@vger.kernel.org, marco.crivellari@suse.com, frederic@kernel.org Subject: Re: [PATCH 2/2] workqueue: defer wake_up_process() outside pool->lock on hot paths Message-ID: <20260527153500.ERVl3my3@linutronix.de> References: <20260526-fastwake-v1-0-e69ad86923e6@debian.org> <20260526212346.1100-1-hdanton@sina.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 In-Reply-To: On 2026-05-27 07:51:17 [-0700], Breno Leitao wrote: > @@ -3447,7 +3459,13 @@ static int worker_thread(void *__worker) > return 0; > } > > - worker_leave_idle(worker); > + /* > + * Kicked workers have already been removed from pool->idle_list > + * by kick_pool(); only first-time wakeups (via create_worker()) > + * still arrive with WORKER_IDLE set. > + */ > + if (worker->flags & WORKER_IDLE) > + worker_leave_idle(worker); Couldn't create_worker() be aligned here not set the idle flag and wake the thread a few lines later? Then we wouldn't have to conditionally clear the idle flag here (which sort of NULL renders the flag check in worker_leave_idle()). > recheck: > /* no more worker necessary? */ > if (!need_more_worker(pool)) Sebastian