From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ilvokhin.com (mail.ilvokhin.com [178.62.254.231]) (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 A7ED248423B for ; Tue, 4 Aug 2026 17:25:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.62.254.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785864350; cv=none; b=XLfoulb7NoZ9Hvme1uVeLxMC6JjD9nR9+E5SPkDiX8zE+Xa7R8sU4rcUHmAp+6E/8Fn2X4eIcaytLr+djE1Rpo76AKAI+9evg3id6TReS7xvtCpv0m/pc/skgpyNCL29vbz6Ep0lzoSt0r5cKwGLli32zWqMstNpWy3dxjQBeLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785864350; c=relaxed/simple; bh=FhBRg7R91aqAlvJKHx5dLFZUnn9iwaN8RHoxDF2KM4U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GgxzMj5SJNTiFDlqqgMUyPB4CaYmpMdStjyceMFuqb6Q7N3HLbXd/3VJa1gn80Hscet94EuPxIU73bQ3T8a+oxnuyMp7FDeHkXBSGZBW0UV6b8uuWoMjaYi15g668hoQJ18K2vqiMHmg/t7GJACLZ7ZsIVwsjcHHKLKTZgTrZl8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com; spf=pass smtp.mailfrom=ilvokhin.com; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b=TT/7T3ot; arc=none smtp.client-ip=178.62.254.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b="TT/7T3ot" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1785864343; bh=YF5rXcVUIO+spDV4q/XPSPSUSXrR9SCSV/FnOvqJz3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=TT/7T3otFXP2719PsAj7WZ2R+qWHUrmkpunLdgO/IBZUNXWrxWtsj0LysOS2Qfo4a 1vjXzvXzV7d7HBxrnyODNo2i5okdSU95FBgbGSmNMWMsVyuZqRvSo3VOxlyGFy437D xloiMWXaCAypQigSvU5nJYco1d6QqxNQXvO3WuAU= Received: from shell.ilvokhin.com (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id B059AE17DE; Tue, 04 Aug 2026 17:25:43 +0000 (UTC) Date: Tue, 4 Aug 2026 17:25:37 +0000 From: Dmitry Ilvokhin To: "Paul E. McKenney" Cc: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , "Peter Zijlstra (Intel)" , linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH RFC 1/9] hrtimer: Mark data-racy accesses to hrtimer_sleeper ->task field Message-ID: References: <20260731004019.3530210-1-paulmck@kernel.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: <20260731004019.3530210-1-paulmck@kernel.org> On Thu, Jul 30, 2026 at 05:40:11PM -0700, Paul E. McKenney wrote: > The hrtimer_sleeper structure's ->task field is used as a flag to indicate > that the associated hrtimer has expired. This means that the hrtimer > handler can be storing to this field while other code is loading from it > to check for expiry. Note that additional races appear for hrtimers that > can be restarted, which could be argued to be a user error. However, > that is no reason to let the compiler introduce additional confusion. > > Therefore, mark data-racy accesses to the hrtimer_sleeper ->task field > using READ_ONCE() (using a new hrtimer_sleeper_task_get() access function) > and WRITE_ONCE() (using a new hrtimer_sleeper_task_set() access function). > > KCSAN located this issue. > > Signed-off-by: Paul E. McKenney Reviewed-by: Dmitry Ilvokhin