Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1302274pxu; Thu, 17 Dec 2020 07:02:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfqIFVyiVZQ4Ia3pAWoNmJBs4fmMUsgu6wq1iZKF9R0c7a83RIbNrI1bSeVrWoSWzOlB7H X-Received: by 2002:a5d:4e8c:: with SMTP id e12mr43191619wru.321.1608217342056; Thu, 17 Dec 2020 07:02:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608217342; cv=none; d=google.com; s=arc-20160816; b=tNWaiC9V/beBgw2KYKpbBLort7pmPjokQn4Rw2LT2ZHy3sV+Z/LHDDcmVIdnH+W2Z+ D106b8dkv4DpcSvIS7i44X5t1ysQGmz5u2XCzpueuS6YiT6n7ML5f+FLDReih5TaVaxQ 3uWjp2QNZGJfgL7oORbsb6A2yIyao0tagSny3O7EAeOYiDRj1+EKXgoU6OSHQ2qEzQoc gcAOjCcp9o3KbQ0CmL8oyUfrufeyuBZ16RzY+gGZO4fKnoLB47ttzSD8ETRRSTd3YlYg vNz66EGtOhThycLG7omsgwoA2PD9m7RHLmSUnmmcSkKAWukBdwjLLQMHLyRmOGdrEhFO RcGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from :dkim-signature:date; bh=uo21sJT3/7oo9SO8oDEx6wiQdyyLi1OExjX87isUG6M=; b=p1ZcnxgG2K2Hs0NFauwWsoRqtRyErEDh5NIlS8tCb2oo1V74R1YXHZGp0rgRoxU/Zb jEHrYBjKsCdzMzPclLRwjUSmqMiFr5q9qo3dM2nKUCB6AaTMdic5Eg2rP9/65yI83SZx 4OG8c+NzoYOX94yXbqLg8V9us4EsYHZx4piSCmkBB3IfO71ItkwLN7Od5xDjFN7mLJ8w xKR+BjyDbu5ql/3DH1CP2bPEQ3w2qZ1ysRcCbFMmPf1FOi3fQGZAjLJ3HVkK591sawL+ n2EGMRUUFh24fyq9LbwcWjD0Af6T35ajouiUZtGoUf5Qxv3MeUZatizXYwEyR0QDV7Ex TO3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AuuLhQ52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb27si2820967ejc.490.2020.12.17.07.01.56; Thu, 17 Dec 2020 07:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AuuLhQ52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726613AbgLQPAg (ORCPT + 99 others); Thu, 17 Dec 2020 10:00:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:60248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbgLQPAg (ORCPT ); Thu, 17 Dec 2020 10:00:36 -0500 Date: Thu, 17 Dec 2020 06:59:55 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608217195; bh=JsJtdDJCE3o0+U+skL2Iazy9UOAD1IUlRu2SUgVrxuM=; h=From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=AuuLhQ52pqcswf0ibiurk9Vr8Z447pJAFpb69GEvUIPT3NINiOZNJZQG0DGPicX8E Ze4bTn9E91NZgboLIA7vjHLU47wvqo0YiI97i0LEknSc48aMZLF/kWSd63dCdUIayN 9xWSzOOQTpTlvgSsy0omtctWyYQrFC27j04Zrr1ufNS7rveAZZHsfYfBcjg4iQEOEc 6mObwvgW0CNoQBnRgRFRYDZW7nDYp2i/u+1MyB+8YQoJwr5YHAjedjBDWbrzIsVX8N NaSlnIbYTu9Y8q37F1H0m7MidC1OmWMELfGsnUxofwHqMHyafT6qvwykN9UE36mWGK PZ/i5hTVudBFw== From: "Paul E. McKenney" To: Peter Zijlstra Cc: Thomas Gleixner , Marco Elver , LKML , kasan-dev , Ingo Molnar , Frederic Weisbecker , Will Deacon , Naresh Kamboju , syzbot+23a256029191772c2f02@syzkaller.appspotmail.com, syzbot+56078ac0b9071335a745@syzkaller.appspotmail.com, syzbot+867130cb240c41f15164@syzkaller.appspotmail.com Subject: Re: [patch 3/3] tick: Annotate tick_do_timer_cpu data races Message-ID: <20201217145955.GP2657@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201206212002.876987748@linutronix.de> <20201207120943.GS3021@hirez.programming.kicks-ass.net> <87y2i94igo.fsf@nanos.tec.linutronix.de> <20201207194406.GK2657@paulmck-ThinkPad-P72> <20201208081129.GQ2414@hirez.programming.kicks-ass.net> <20201208150309.GP2657@paulmck-ThinkPad-P72> <873606tx1c.fsf@nanos.tec.linutronix.de> <20201216211931.GL2657@paulmck-ThinkPad-P72> <20201217104823.GU3040@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217104823.GU3040@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2020 at 11:48:23AM +0100, Peter Zijlstra wrote: > On Wed, Dec 16, 2020 at 01:19:31PM -0800, Paul E. McKenney wrote: > > Given that there is no optimization potential, then the main reason to use > > data_race() instead of *_ONCE() is to prevent KCSAN from considering the > > accesses when looking for data races. But that is mostly for debugging > > accesses, in cases when these accesses are not really part of the > > concurrent algorithm. > > > > So if I understand the situation correctly, I would be using *ONCE(). > > Huh, what, why? > > The code doesn't need READ_ONCE(), it merely wants to tell kasan that > the race it observes is fine and as to please shut up. > > IOW data_race() is accurate and right. Other way around. The code does not need any of the compiler optimizations that might someday be enabled by data_race(). So why do you need data_race() here? What do exactly is lost by instead using READ_ONCE()? Thanx, Paul