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 6C26B47CA6E for ; Wed, 12 Aug 2026 18:25:29 +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=1786559130; cv=none; b=axlpu+CNGZpXJBA1GSSV2fMXyty2EncntxDMcjJwlkGJYyVHzHs0UJBKPGNivKabI07eNV3VcS20YOAefkhObaCpHyEw0BnqfcLJpQwz1y30ne3HjtD1P1kIkOCBDGrnC7tUx07a7MHbYMeO0QnzEsgN6MSDPmpCWBwX3874hVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786559130; c=relaxed/simple; bh=pZyostrp/1ItR1wQFzcGoOF5h4NdwDOEB6vrJobE9EI=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References; b=mDpU6rgvHu3vnBiH6gqJi6WIY4LA0mQ1yL781gEqkX9FTI9xOPYzh7eDcxwaVsQkaQfqQ+O1XShVyIwA1K/eByaJv6PBlUna0VLryuUm2agrmHstbZj7qmwi8oNIC++nFzTH7xMchv4kEKDzkBp3J0TcMLBMuAqBSp1HkIGMYjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nTUI9t9B; 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="nTUI9t9B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E14D61F000E9; Wed, 12 Aug 2026 18:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786559129; bh=JiuTvUnQ9C0iOmt7alxMBxgkuPQRD4xpgWFu+Bbu4Sw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=nTUI9t9BpbH9CCmJn50MHhnqFlSNOzxPM8ndmak+Aoi7U86NYPzNtoIfYusOBpw+D fkCoeR/1car6Db3TVqpWhh2B6/41sitXAieuC5Edda/pCD1Mn3g4SGIyWw2QOmUB/K Ytnsu25OtcS3x6DYpav/ccbnwMftcRGYDr+Ewpt4Uph9/QvIwQ4pIEYT7sqWKsrPEA AKHkGVZRTrNoZj6dl+qlqi/YS95CyK0Zz2tsztgt74umoz0Yb1/7HNXmFwY93MYCTB EV9DB2tKA3HNSkvLMBvq4qUn9pKJWuV7ffqCQJY+NblGTzhtpglTew4sespXE1HdDh Xliij35jq0EnA== Date: Wed, 12 Aug 2026 08:25:28 -1000 Message-ID: <90e44e95a0b95c74dfb260a335ab0fea@kernel.org> From: Tejun Heo To: Breno Leitao Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, kernel-team@meta.com, Bradley Morgan Subject: Re: [PATCH v2] workqueue: annotate racy p->wake_cpu accesses in kick_pool_pick() In-Reply-To: <20260811-wq_race_kick-v2-1-6e66ff12d8ae@debian.org> References: <20260811-wq_race_kick-v2-1-6e66ff12d8ae@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Hello, Breno. On Tue, Aug 11, 2026 at 02:55:56AM -0700, Breno Leitao wrote: > The race is harmless, this patch only acknowledge that this is racy and > it is fine, silenting KCSAN. Can you say why it's harmless? wake_cpu is a best-effort placement hint. Every writer stores a valid CPU id and the wakeup path validates it through select_task_rq(), so a racy value only affects where the worker wakes up. Also, s/acknowledge/acknowledges/ and s/silenting/silencing/. > - 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) { The hoist drops the !affn_strict short-circuit and adds a declaration after statements. Can you keep the test inline in the condition? if (!pool->attrs->affn_strict && !cpumask_test_cpu(READ_ONCE(p->wake_cpu), pool->attrs->__pod_cpumask)) { Thanks. -- tejun