Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp523975pja; Thu, 7 Nov 2019 00:54:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzzR0RxB4k7RrhWxIZQqn+R2vPcjRIbp/urDOXemrItTo7K8xKZaSjLecU3mFj0VuEOGh+d X-Received: by 2002:a17:907:20d2:: with SMTP id qq18mr1871554ejb.305.1573116875328; Thu, 07 Nov 2019 00:54:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573116875; cv=none; d=google.com; s=arc-20160816; b=Qb5hKiBKWVkR3j6QbiNX3+lDVQhbuOdooKAOK86yCI8Kmal93mG+cfdD3qbFZDxhb6 54pJyi6wM59+qYzcPh2VxXKyDW8N8Ud1ndydFV13PWz/z4MdjYqHN5wEOL9uE4IyPVCL DGd7nYmsXOew1rrVwZqkIEsRrCiqV3MhEj67vyDw31JaMWPikPFMYz6IUJLQug07Mi4k WvKkdsVEtXqHfzyoRUbIrO96gHnx+fC9vb1wjgEbdrfySDWDsvG+9vWRa/+wAaS+3Sg8 g52KGtde1tTo4L6bOFNhowkgA6MH6oRzxO9W6+UDvYYyo9buoCpAENw8lNPqeBPT1U2S 6o9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=cQb4+bvi6mEi+xj1/lnmB5bzVXOyC3dOHgPliHX6pIw=; b=rpWrI8X3aepQ6jMXSo/u149sJ37Q22yrzfzDawj4JrQNJ7+7Bz1aKlZw5W5vpohpzd bngXZqXE6edTPdTIpu1NhpcARdjpqGvs4ueHf3E137q4muGevfJYd9PGqW9EjaxB+PXv beBbv8BLGUuZDDukyTyKm5xpw9rIcj/Z+NnMt6WBXLdG3Yb0oBvLM+A1bG3fcBVQK0cg 2tBUYCr8eYlY1JsjFEnJt1KVYYaGgK0Htn51mS3svbBImFahJ6BSCywOOBF6YJBplytX Yt+O/trDkzT4sk/xtSrDMqey9q65lLUMycJuTB4xPdSSjoDa6Q8SARtas8CpU/OVN3sc nkIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N7p8iKhX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id s2si983641edi.413.2019.11.07.00.54.12; Thu, 07 Nov 2019 00:54:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N7p8iKhX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2387560AbfKGIw7 (ORCPT + 99 others); Thu, 7 Nov 2019 03:52:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:50102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733238AbfKGIw7 (ORCPT ); Thu, 7 Nov 2019 03:52:59 -0500 Received: from paulmck-ThinkPad-P72.home (unknown [109.144.217.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 223D62077C; Thu, 7 Nov 2019 08:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573116778; bh=atNfkvWqHmIDqLBv86TZs4C30jzzuzCcG/ghR09esKA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=N7p8iKhXD7qMUIc0Kc48NqghvP37TKKdvsyPGXuC9QLTBsdANK8T1abwIYv4GvbZf HALn3YEjWZ/T4Syc1ONWryy8bSOJuL+pwfcY0EagM30R0/BsbnWeuKwSw/PyQ+sC3y VG3pBmbXTWwWDLIabQjqa0loryPex93TBVkwUjTs= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 8E51035227FC; Thu, 7 Nov 2019 00:52:55 -0800 (PST) Date: Thu, 7 Nov 2019 00:52:55 -0800 From: "Paul E. McKenney" To: Eric Dumazet Cc: LKML , linux-tip-commits@vger.kernel.org, syzbot , Thomas Gleixner , Ingo Molnar , Borislav Petkov Subject: Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state Message-ID: <20191107085255.GK20975@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191106174804.74723-1-edumazet@google.com> <157307905904.29376.8711513726869840596.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 06, 2019 at 02:59:36PM -0800, Eric Dumazet wrote: > On Wed, Nov 6, 2019 at 2:53 PM Eric Dumazet wrote: > > > > On Wed, Nov 6, 2019 at 2:24 PM tip-bot2 for Eric Dumazet > > wrote: > > > > > > The following commit has been merged into the timers/core branch of tip: > > > > > > Commit-ID: 56144737e67329c9aaed15f942d46a6302e2e3d8 > > > Gitweb: https://git.kernel.org/tip/56144737e67329c9aaed15f942d46a6302e2e3d8 > > > Author: Eric Dumazet > > > AuthorDate: Wed, 06 Nov 2019 09:48:04 -08:00 > > > Committer: Thomas Gleixner > > > CommitterDate: Wed, 06 Nov 2019 23:18:31 +01:00 > > > > > > hrtimer: Annotate lockless access to timer->state > > > > > > > I guess we also need to fix timer_pending(), since timer->entry.pprev > > could change while we read it. > > It is interesting seeing hlist_add_head() has a WRITE_ONCE(h->first, n);, > but no WRITE_ONCE() for the pprev change. > > The WRITE_ONCE() was added in commit 1c97be677f72b3c338312aecd36d8fff20322f32 > ("list: Use WRITE_ONCE() when adding to lists and hlists") The theory is that while the ->next pointer is concurrently accessed by RCU readers, the ->pprev pointer is accessed only by updaters, who need to supply sufficient synchronization. But what is this theory missing in practice? Thanx, Paul