Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4219261pxf; Tue, 16 Mar 2021 08:17:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRyj/68NpqUhKiiZxjdRWVCJO65izX8diexsncP1T/jbi6I69/4yzgPPoiJufG1cTAAnsx X-Received: by 2002:a17:906:3b48:: with SMTP id h8mr30087767ejf.261.1615907873925; Tue, 16 Mar 2021 08:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615907873; cv=none; d=google.com; s=arc-20160816; b=mAo/UbCiepezmeLSp5vpMe3qlZxkPiy8/tsugPJ/bDTbOU8FnQc2J+OI3wAOcjPppQ aw03PtxJsbyZDYVJoFqG8jYkBW7eUs9RyhvXl5cHXEWz4ji8+UEmTKEde9OgVnlVU/MJ Bc9q42Dv97E0VlG25iKoruCuWyt2yJbT5WnkbWixqiwDobv7a6MIc+z+l1qsKlY0pchl ioJy9lk1cSRSAKL3noOW3wKAD5zOFdJ33mmfjrlwGts6M0anttgfNBjfuMEDKqorhu+f r8O7tKxvc3AESDxz8weklu7jSB2TWJBmF0GJ5JN/dB7jD3IjnqEIZdgWJUSyaDZl1XWV tuSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oS0wCpVx3xA1BGt0eSk6Ptge/SvVGNTwNTTh7VAehEA=; b=lUbo05sGOQXJdLNKrZeoHkp03Sp/Nse9xT+udsY3TqzH5A540E19ZEtte6E/SkQHhb oCSY2JDKfw1C8LPs0IYut5YOVyFNp2KC/fzH/4GwXzfLp7KXsHp1z23QTpGapYJL5cAr OOVK3bs28a65xajokLNuYb4oFwFuXJL/23+rDZ0A/85U73zYHnKMhhxj4PpKEzZ0X95J iv7lbGAuzJbmOP0qffY3EM8REVviPP658+eDdZAgUHzG84NzqkDCK1sIHy3JjW0AK2+G 0pogUiz/Szu3h2wdfJUSXpLkRZH7q5KgtIsb3RIDYyNe5V432bXow7fLIUpSL8wf5nOA G/cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P5tAdogx; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si12956772edw.605.2021.03.16.08.17.31; Tue, 16 Mar 2021 08:17:53 -0700 (PDT) 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=@google.com header.s=20161025 header.b=P5tAdogx; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236023AbhCPKAU (ORCPT + 99 others); Tue, 16 Mar 2021 06:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236022AbhCPJ7t (ORCPT ); Tue, 16 Mar 2021 05:59:49 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26306C06174A for ; Tue, 16 Mar 2021 02:59:49 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id p186so36213453ybg.2 for ; Tue, 16 Mar 2021 02:59:49 -0700 (PDT) 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=oS0wCpVx3xA1BGt0eSk6Ptge/SvVGNTwNTTh7VAehEA=; b=P5tAdogxKo5oUR+g0clyfKKbPAZSjFx5bu8+aANk+hLgy1ZbZ9r/rRnb3CT+4kPiHX A57WvJ1U+WXI+5jTjXeZpjH4vwCn2byUJDn3dJfgZiH2oIW8nVzf+0oApxu3gA42K/UO faPO3vzbVNU+EKKCx10KKmdOGQ2a9eaLJeqHePbaB1P4UIB8115z5QQEx/G8DWMtHZup YLF+jg1giJOTBX3byVjAOdvzSPdzUUXlrA58jumni4GUCmPc+XFe4JsfPmqoIXskqlnb Pl01BkqTd7A0jLfpeEuEBpnBO/o6V60PRC6zd4u9CmbR1VIctMDwjTLci81wfV2vhX4F Ejfw== 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=oS0wCpVx3xA1BGt0eSk6Ptge/SvVGNTwNTTh7VAehEA=; b=h4WrOiCdxl9mHnaDe0Mnfb9qofTFmd57xccSXV9CsC7BMjfzRMvuimacWZCc9BWNjr 4TbdiESM1e35z2ikRvmOEG9g+s9ZFNWpJN5e/ASnF1I5vQNUnI9bswGsbMfNQIDmWkpU 0T/0nfvySvdydRwgXjkprUHJSFkDHw3u2drmbyl3Fgf+w698I4qpPtKape3nRZ2dhwPF nnLvaNl8rBNHEn6ApzwICbzERrZN1K6OJ19bVFIslChmHlpN8ojGIbwnxa8z+xPY7O3r g+gRrhWb+sZ1n5G7dsT9vw/stT9x+YOpXY45rPWGzai+/Fwn+Su/ZIha0gj2H0oGTpzd KNkg== X-Gm-Message-State: AOAM530S6kkIEhdYVIUNgb33PJ/iSAZIPNE+Z4asGflsvu9BM3Eifg7W zmPieD39GVibmNifHP/DG1W8WY16MplK8tF4uH537w== X-Received: by 2002:a25:b906:: with SMTP id x6mr5362694ybj.504.1615888788020; Tue, 16 Mar 2021 02:59:48 -0700 (PDT) MIME-Version: 1.0 References: <20210315135720.002213995@linuxfoundation.org> <20210315135720.418426545@linuxfoundation.org> <20210316095049.GB12946@amd> In-Reply-To: <20210316095049.GB12946@amd> From: Eric Dumazet Date: Tue, 16 Mar 2021 10:59:36 +0100 Message-ID: Subject: Re: [PATCH 4.19 012/120] tcp: annotate tp->write_seq lockless reads To: Pavel Machek Cc: Greg Kroah-Hartman , LKML , stable@vger.kernel.org, "David S. Miller" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 10:50 AM Pavel Machek wrote: > > > --- a/net/ipv4/tcp_minisocks.c > > +++ b/net/ipv4/tcp_minisocks.c > > @@ -510,7 +510,7 @@ struct sock *tcp_create_openreq_child(co > > newtp->app_limited = ~0U; > > > > tcp_init_xmit_timers(newsk); > > - newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1; > > + WRITE_ONCE(newtp->write_seq, newtp->pushed_seq = treq->snt_isn + 1); > > Would it be better to do assignment to pushed_seq outside of > WRITE_ONCE macro? This is ... "interesting". You are probably right, this looks odd and was not something I intended. It happened to just work, but feel free to send a patch to clean it up. Thanks.