From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 F1AD641D22F for ; Tue, 11 Aug 2026 09:29:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786440546; cv=none; b=iG8khP6eDu5EFXzttZa8zrk5xTGX//0BENRg7V/TTfbDw8Bk9lMuYQ8gdjGsF8zHqJiR+AC75+YZ2uPaZlCoKxf957azT010N8LjII5rTjr4etDkEiENZ5QExINzOljdxMojQzGCpmg/utEsq6XKRlR6Lj5cYIbTa1+ediP2ZQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786440546; c=relaxed/simple; bh=5FyZaKUoEg1WGZ5i6ajDGeYiyNxE6K243bxX6Va1rKI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BesGhr7nQG6AW/5VLMJGScXwo9ExEqhc7XVPitWgdNxMZB3pbl8Ills/2S4F59v33wqTI9n8U3lcfcheu9RrzbdSZ/yTGod8EmezH/rsz4gd9j1K9CoWte2vuwWpf14hkgiPirzsP2fBfOWOOkG55gvIotyftYshnZP6PLItz3c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=O7Gpt0PW; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="O7Gpt0PW" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=l0oOCYaRrl3i/spI/Ifx5oLd3GIIqHPYL7SR/pY/7JY=; b=O7Gpt0PWWuQIS53YlZQ2gQlT1u KG9XVmuNx+2NJevXT+Qe9mH7Qiu9Ogf9UJ0OUqQOpxXK44pHOV5NIritoYvPP1FshxCoO7vBpqnki zKHZ9EYktNcjcX2wt6otpEi/a2i17NuKxRNYMAxB7U48PchuxaEiOf9fn9NYYfKioJkqS56DE4ESP FiUcbhr2rEQUBkmhJUQSz/rTFBBS+U+K3ENB7Ywo85aEKPF5tfiSGdbRRFubQP3zJiHMJAc7mS6LZ uSQHgx4WmR0yf2uA8am62iPlIAElHxNu24+78xfm1wdixgHcDkKLakmqiOQtM+R4Z0oJjnqJCrwM1 L1X1ckhA==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wtin5-003SuJ-1f; Tue, 11 Aug 2026 09:28:59 +0000 Date: Tue, 11 Aug 2026 02:28:56 -0700 From: Breno Leitao To: Tejun Heo Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH] workqueue: read p->wake_cpu once in kick_pool_pick() Message-ID: References: <20260805-wq_race_kick-v1-1-d55adc12416b@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: X-Debian-User: leitao On Mon, Aug 10, 2026 at 09:50:57AM -1000, Tejun Heo wrote: > On Wed, Aug 05, 2026 at 04:17:48AM -0700, Breno Leitao wrote: > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > > index 26d5680c751c6..333752ac38298 100644 > > --- a/kernel/workqueue.c > > +++ b/kernel/workqueue.c > > @@ -1308,8 +1308,10 @@ static bool kick_pool_pick(struct worker_pool *pool, struct task_struct **wakep) > > * If @pool has non-strict affinity, @worker might have ended up outside > > * its affinity scope. Repatriate. > > */ > > - if (!pool->attrs->affn_strict && > > - !cpumask_test_cpu(p->wake_cpu, pool->attrs->__pod_cpumask)) { > > + bool wake_cpu_in_pod = cpumask_test_cpu(READ_ONCE(p->wake_cpu), > > + pool->attrs->__pod_cpumask); > > + > > + if (!pool->attrs->affn_strict && !wake_cpu_in_pod) { > > Can you update the p->wake_cpu assignement several lines below to > WRITE_ONCE() too? Ack, let me update and resend. Thanks, --breno