Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp110817ybx; Wed, 6 Nov 2019 14:04:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwe+4z2630aJYr8z9weNe81vZM+EeHj6lkGVz5C7f1yPawesr+9gQrqHwuhUuPnS/BDKSXr X-Received: by 2002:a50:fc18:: with SMTP id i24mr3677edr.41.1573077849292; Wed, 06 Nov 2019 14:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573077849; cv=none; d=google.com; s=arc-20160816; b=Z+hvI2m7Wb1xPZZ0Z+acrJExbHz2bEE7+PxOL0IOh1DzW8pD1bVsiCHoQ7KQ6bg0/K LTGqMO+TgtJil+KTA9u8X9UVT7yXUSiEvk2HZdsv6NkrNZQ/HxmalQSwNeb0TH38Y0mJ Lye6Gt5yCGvGHnTH4xAHMB49AS2f9SkQ29LPzDDvDBwosxXVZgzYgx6DNgxqD79WKJmz 7z5zN1/agt2iA14eJYQMLBrfi5qYftrC4eBRnxrbeH0WMLhojjW9mdAAPfmeVAE3kscn j/aYkbRvOBTT1IasUMiyf/PCMa+JHAYqC7RcXcNQkWjwgNhnQn1pPABg5IUEojM0ahhs vIsw== 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=uzOSEwwxlZUn+RZ80uzKZcPZx0SHIWxdqxRKaOr72PQ=; b=jGMWeEChqQ7im34tsbg7uuNEnIZkcyhFxm5IdCB8aaFYh4tB14y3e7FZGEteLAgPRU BtHLPK42LD++tPZQx4dckShLq4LxHA8cdAkE1NYQ/oWfI1AhEKH4aHJblice7jnRbyt4 qQlCe9RdDVcT68TRwkeKWt0Zi5tQ1H1E61TGL7ID3dvYcAV32iQT9Jul/7UMuvlfy9qG JVbD/1lz+GNNGVWi4gvMOR8pGLePfjMjPwC+VH5iqnCXYvT24ESECC5pv9SU85voei/y mlq0QGEWm+ErfIIzQn9fIrfliYs0//t5+EmPwgk/4NLdwdtXwGFHOUnk9p05roX2aIOR GoRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZvxQabNf; 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 r5si16263951edi.349.2019.11.06.14.03.45; Wed, 06 Nov 2019 14:04:09 -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=ZvxQabNf; 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 S1727542AbfKFWDM (ORCPT + 99 others); Wed, 6 Nov 2019 17:03:12 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:37297 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbfKFWDM (ORCPT ); Wed, 6 Nov 2019 17:03:12 -0500 Received: by mail-io1-f66.google.com with SMTP id 1so11393iou.4 for ; Wed, 06 Nov 2019 14:03:10 -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=uzOSEwwxlZUn+RZ80uzKZcPZx0SHIWxdqxRKaOr72PQ=; b=ZvxQabNfRd7utzX5GnZ5Ohq0RX5n5e/BnldYMHQTtRr5eA7bYfiVztyd7qSS/I8T7b Pkz2QCsHupVJxBYzzpLlI2tPOdtQX+WGgeSIlUmUXS507QqeB2/zSuEuRBRZ+6SjIztd c86Pe6BCIzzzR3vQPjkgGhLri8II0y++T1TLwL2Zha0Sed+Fn0nu51IpT7ZkAEQfkbe3 +9MSrewLmo9y8yG1k1UdxgilmEF1qoaGLXq/DuFxLRXLyUE0+dRb0gaEFO0uZlLsc/G1 ccvg5y3LxZkcf1Y5uCbk0uKCFlSacJ1ws5gjwhKZNi6JuTAUxx4UFarPAKp5XFOFC2Lk EriQ== 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=uzOSEwwxlZUn+RZ80uzKZcPZx0SHIWxdqxRKaOr72PQ=; b=qQ9jiJbcWX50Ikkk0mUUxbntdAEFE97uOsmhWy9BWz/PVh/HmtDb3AKUvFgIc+1zxJ V7ihb1kHB5JeIoJ2gXd0KJRcQJjzT1KXSj35jX4htSzpu3+4y8VCzF63GHK0C31t61cs bFpH+lYYhXTUji8qGZV0xi9qw0EGa0Zz1oQvETN/0474JOxV0P59s7esFSwmWfItjBWW BR48nUWyzrQtFZ9o49fWl3/RA8h6PCirj9BdXo/tf3V37Q6OZ+N27bYxveXgraAoSoiL L68WksMJgypL/mcsZM2E2NYkDdU1tYtM10l8aYwIUwX1QBPnUwAensm2lRrl6f1zVjxo MUYA== X-Gm-Message-State: APjAAAWr5We7R3Sy/UC3xGboWwrm5IjuJ4tboSwldkIrhKg4EFrerK+2 /4Q2cK5ul/QZaw9Kjrlie+oVozEpBbmr+SUgLVqS36JhBMo= X-Received: by 2002:a02:7158:: with SMTP id n24mr345719jaf.127.1573077789213; Wed, 06 Nov 2019 14:03:09 -0800 (PST) MIME-Version: 1.0 References: <20191106174804.74723-1-edumazet@google.com> <157307438959.29376.9644507314555163943.tip-bot2@tip-bot2> In-Reply-To: <157307438959.29376.9644507314555163943.tip-bot2@tip-bot2> From: Eric Dumazet Date: Wed, 6 Nov 2019 14:02:55 -0800 Message-ID: Subject: Re: [tip: timers/core] hrtimer: Annotate lockless access to timer->state To: LKML Cc: 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 Wed, Nov 6, 2019 at 1:06 PM tip-bot2 for Eric Dumazet wrote: > > The following commit has been merged into the timers/core branch of tip: > > Commit-ID: de4db39b9f0e682e59caa828a277632510901560 > Gitweb: https://git.kernel.org/tip/de4db39b9f0e682e59caa828a277632510901560 > Author: Eric Dumazet > AuthorDate: Wed, 06 Nov 2019 09:48:04 -08:00 > Committer: Thomas Gleixner > CommitterDate: Wed, 06 Nov 2019 21:59:56 +01:00 > > hrtimer: Annotate lockless access to timer->state ... > -/* > - * Helper function to check, whether the timer is on one of the queues > +/** > + * hrtimer_is_queued = check, whether the timer is on one of the queues > + * @timer: Timer to check > + * > + * Returns: True if the timer is queued, false otherwise > + * > + * The function can be used lockless, but it gives only a current snapshot. > */ > -static inline int hrtimer_is_queued(struct hrtimer *timer) > +static inline bool hrtimer_is_queued(struct hrtimer *timer) > { > - return timer->state & HRTIMER_STATE_ENQUEUED; > + /* The READ_ONCE pairs with the update functions of timer->state */ > + return !!READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED; You probably meant : return !!(READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED); Sorry for not spotting this earlier.