Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1198133ybx; Thu, 7 Nov 2019 08:36:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxa8fbPs2HBnPefGuHLKPZlww6r3XZhnIrb9MrhljCn6C21r/dw55OsNxrM9YagVDpJrgQu X-Received: by 2002:a50:cb86:: with SMTP id k6mr4682014edi.270.1573144599448; Thu, 07 Nov 2019 08:36:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573144599; cv=none; d=google.com; s=arc-20160816; b=XqdByFgQVyh1f8mLSc7ub/R+3gEGkZmJIqGK7k/kE1twErGS/Ngqerl4i0WM8vj6e4 Qlk7J2bEU7o6OWazceI4x5N8vTFWItJl2e2GkcJCvHfRdWWrUZFUAWwwod9kCwFvIIRA vJu/tIdUHaAKgkrUD0Zmxh2rYKuruQ9EuTSCbtuWbZiMKBNe0On/8nsqcAyZbxjgj6+X idPS++lt45DYb6IXgfrb2Wado7VKnqImyTTxr+kcaT2vmv/UAXNLTnCG9JTYRwJPBbXJ wEPvR9ZEbOEP+WFOo3l6bbM1tMEf/3PcLnGZvKFMO4G3EcSOQ+Cku486Xd/IyVqPWFko fmGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+AFTD4gdG3RNMTGK/9nXRonGG4bAdvDwZYfzVR9Jo48=; b=nPBSpffCRAVbEvwdPsWiRFccxka2NbiPj7vNIWezYoFDFu249o7KG8Tu1M/Cy49ix0 YcvDHDqpgQjoVpaNzcp18aFxvjsRK8gEpJBQw3ooJyF1DU8M95pO1Ix6nFCfIgD/NeDQ +2IF4sVq6PufRDwXaNFypftVMPCdVAa7n2S+IDoXhe4tGEYDXsYTAgiAS3pwg811TYbS m5EeRvWFxvpRDZ0q8VcHZvFCYte7ADSC5wvW5jdVjtDNc/AGKli2w75f1MYiZynn4jv9 yvj+4gH0RCjtTFmMOrsUCO3K+5ZpqJtQvkIQZUzkYE5NerMdVBtQSZccjzkmutNNDMuL TeoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AzwcHjDO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si1739007ejn.123.2019.11.07.08.36.15; Thu, 07 Nov 2019 08:36:39 -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=@google.com header.s=20161025 header.b=AzwcHjDO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbfKGQfn (ORCPT + 99 others); Thu, 7 Nov 2019 11:35:43 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:36815 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbfKGQfm (ORCPT ); Thu, 7 Nov 2019 11:35:42 -0500 Received: by mail-io1-f66.google.com with SMTP id s3so3000297ioe.3 for ; Thu, 07 Nov 2019 08:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+AFTD4gdG3RNMTGK/9nXRonGG4bAdvDwZYfzVR9Jo48=; b=AzwcHjDO9ne06auKd8BAeOXMMNo3yGj1X8Sp0qFud95nMtFfFK+WflXwPq/TijSNGI jJgYEyq/kNYkHeDfMsw6N+/OukY2VcVj9U9G4OvrzjGsxzMB3CCvaNY5BrmmEjYENCCG nGrhLAnFEc+N+sf2T9GsQuocS5my8/VmBQdJOrEI2oA0L43dgmXz8tnqfIRczB5QNC0V coxRzqMcel0OCCgGGsCNySkrFNZy7Xd6+PnsJuO5yr/mbPBxi4EWe0CJDPw5WabUtHjR eVu3z9yZQEHl4oubNjBTGeA7OLN6j+Uz1/HFE/OUCF6Xj0TVBikP/SIfPO+IBKtqytfP ZBNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+AFTD4gdG3RNMTGK/9nXRonGG4bAdvDwZYfzVR9Jo48=; b=JigcD72IcJSkOi4PD5pE033jUG6YcuPCEZYaA2e16cQ7hJSZJSjMp58tKNyYYt5vK6 G6SDATlE9MnWcxiSjWoj9Vl0NHQAgn8rHxzMXJuFWc1lQwvAenOcGQTXTBgVUi/CrunO ZrJWXZAh1F78Wz2CrRuowW70T5/lur5tFitxWF/WLApvaXgp/b3fuDAEOZzNVNXStWa6 zUOQOGVHi5ej6Eh2WUR0BT7g+7PgGDEInz9IPomMQwDbdF7GNycgNt1rSfuZnAy5Qb+h ZrmaY7P1BtHBDplMpUmLTBxfhyqULk5MrXIXyYNOSfIHXtslnUwldqimsu+ZGEWM1wg4 R/LQ== X-Gm-Message-State: APjAAAUuoyoo4c8YnEm39pNeM8g5Bxrma+avIMLTCTs+OCfjLSwe6o59 b0m9GUrhUT5EB+jUPwuopubPX4Ue5nuK+fqEOPBhhuFyygU= X-Received: by 2002:a5d:9059:: with SMTP id v25mr1209422ioq.58.1573144541410; Thu, 07 Nov 2019 08:35:41 -0800 (PST) MIME-Version: 1.0 References: <20191106174804.74723-1-edumazet@google.com> <157307905904.29376.8711513726869840596.tip-bot2@tip-bot2> <20191107085255.GK20975@paulmck-ThinkPad-P72> <20191107161149.GQ20975@paulmck-ThinkPad-P72> In-Reply-To: <20191107161149.GQ20975@paulmck-ThinkPad-P72> From: Eric Dumazet Date: Thu, 7 Nov 2019 08:35:30 -0800 Message-ID: Subject: Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state To: paulmck@kernel.org Cc: LKML , linux-tip-commits@vger.kernel.org, syzbot , Thomas Gleixner , Ingo Molnar , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 7, 2019 at 8:11 AM Paul E. McKenney wrote: > > OK, so this is due to timer_pending() lockless access to ->entry.pprev > to determine whether or not the timer is on the list. New one on me! > > Given that use case, I don't have an objection to your patch to list.h. > > Except... > > Would it make sense to add a READ_ONCE() to hlist_unhashed() > and to then make timer_pending() invoke hlist_unhashed()? That > would better confine the needed uses of READ_ONCE(). Sounds good to me, I had the same idea but was too lazy to look at the history of timer_pending() to check if the pprev pointer check was really the same underlying idea.