Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp922241ybx; Wed, 6 Nov 2019 10:22:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxVtNSdnhrviOIedp1Jqy5iyZ381UVSc2H+EVTikq104zshQesHdSHaDb7b3bexE2laOZvY X-Received: by 2002:a17:906:edd2:: with SMTP id sb18mr18269810ejb.112.1573064559845; Wed, 06 Nov 2019 10:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573064559; cv=none; d=google.com; s=arc-20160816; b=k4OVwyRE9ddqBxBwa381R+fznBRFf1ZJoTMStSXX1znOBHkvupGRomtfcfIp8uttxD ug563TcpBZhRX5OMwWxi2/cgN3dicEdZuT2CWRvhtxPLb+b/bTos5iDnguwqZO0QRSB/ iEgIiTkVlugF3dErmBvY+RWXq+5TXU6LqMP2Nn5YzH9htXku0axg235KsqUikgIEiZ+j lkp97UP44UZ7izvB4S/Jdaxm74QX8VQDpR3+72ClQjw/5H4SYeSnXuxGKo6MjCdn5wDs B11FnblU/hkt0ykWhQvXB88xIlOTZdJi6XX4QpOMip52scp4CknLnMqZR1bY/scVlxaY HKCg== 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=eJKRqW4UvaqMAOnNpXsdjszI/drzmMv8UZ9GHtHpvWw=; b=maN7SAU8UpuNqArF8mNOA9feTXohKkJuh/mEqr9xd0RiLInODTNcJa9ILj3dt83RP1 DZXcN8NKo61Cd9eJqGUMS180IE5FItGSVtt+q4jvKswJezgpOxCYYdtzJMU5LUyBna+D js2fqgIDO78FxFQysyWI9I/YxmaL7G9cqhtm4QFpg/kRLW5fOYYUsWHUXQjeEQjKsTvN aGyXh2jYc2DGHF62y6ed7AW42Hk9Vvc6gPEfET3s0hkN7AXYhs/goVLbSR1c6UklEVZD DodQcAVQ89gWqKsWYNEMWFDva14UvrqaN1Tp05lEkbcJlmklj5QAECSMig8RlxrTpsCm oGXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LFsGgP0B; 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 k26si6939136eja.58.2019.11.06.10.22.16; Wed, 06 Nov 2019 10:22: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=LFsGgP0B; 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 S1732444AbfKFST6 (ORCPT + 99 others); Wed, 6 Nov 2019 13:19:58 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:46394 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728798AbfKFST6 (ORCPT ); Wed, 6 Nov 2019 13:19:58 -0500 Received: by mail-io1-f68.google.com with SMTP id c6so27988809ioo.13 for ; Wed, 06 Nov 2019 10:19:57 -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=eJKRqW4UvaqMAOnNpXsdjszI/drzmMv8UZ9GHtHpvWw=; b=LFsGgP0B6fgRwfJ2GnQXlpWI9IU0ebBBFM4TMgwo9SQ3z3Nh+sofKkCT7or6p/qmnk tQ9JfjRd1n0iUIRhjchZ+N0BgE7EExFsxdbElUM+TGgd2kAdNtPOQaVkuqkHWUTAlv+/ xERx/BC/2u8BlUzSnaySZnATW3+QNWWFfEw36TT9orP+xZ3S6gGSwnXXCJI4x0IkNWHn kH4hC6wPgRrpLWYoykyTt/1K2EXZL/S4JXICIb/5+LP4Vy5ieqPNGksFi+TwtD0HzzWo RZJweFxB2Gq6IMlEc81biuLbPYygNV3dH54jt60DlzTl0ZQFQPy2H2XBg9ufBEaOm+jy rSGw== 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=eJKRqW4UvaqMAOnNpXsdjszI/drzmMv8UZ9GHtHpvWw=; b=KHKeix2Q5CziyuRzSpzcrvFh5T/Al1yeqbU510mruu9bl09pwn6HzPP8ajsC7xNleK YH3D/aInJyAJkj8dEDknGUqd9niI0pZj4RSlHyu6paVVj68YR+uD4isX4gdwpx/0ELJz hFIW4m4pxvvhk+zqVEAn4FezVQsbm2NELeL8CS+sIXMeN7wVpDtlz/sFe/b8AHqlpieI 30XNIhg9VL+DJLBO9g/IAu+vtUZufJwnoB/8Wcss12SEnSIhGGM95JyNvIWfZzwqejCh Uf9HR1kMJCpq5wYIqlR1MjIL2yFYqPQGi7IboSgAwVs0g/JQ97shG7jM7n9pLnAbEiCo bykA== X-Gm-Message-State: APjAAAVn/UTdJ3f0ze7CnuP6NoF5qp8mKz8OahWoqYWLLFypKyS/ru+j lqAN6Q8Xrdj6nP1y+Ff6wc47yxhze7fSDRxPKzKqfzS1 X-Received: by 2002:a5d:8953:: with SMTP id b19mr278484iot.168.1573064396804; Wed, 06 Nov 2019 10:19:56 -0800 (PST) MIME-Version: 1.0 References: <20191106174804.74723-1-edumazet@google.com> In-Reply-To: From: Eric Dumazet Date: Wed, 6 Nov 2019 10:19:44 -0800 Message-ID: Subject: Re: [PATCH] hrtimer: Annotate lockless access to timer->state To: Thomas Gleixner Cc: linux-kernel , Eric Dumazet , syzbot 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 10:09 AM Thomas Gleixner wrote: > > On Wed, 6 Nov 2019, Eric Dumazet wrote: > > @@ -1013,8 +1013,9 @@ static void __remove_hrtimer(struct hrtimer *timer, > > static inline int > > remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart) > > { > > - if (hrtimer_is_queued(timer)) { > > - u8 state = timer->state; > > + u8 state = timer->state; > > Shouldn't that be a read once then at least for consistency sake? We own the lock here, this is not really needed ? Note they are other timer->state reads I chose to leave unchanged. But no big deal if you prefer I can add a READ_ONCE() Thanks. > > > + > > + if (state & HRTIMER_STATE_ENQUEUED) { > > int reprogram; > > Thanks, > > tglx