Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1877381imu; Thu, 10 Jan 2019 04:40:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN5BB2cX1WznbSARpCT6YoKX+eCZvL0xwYoNcAMggFIhcZxs9972s/fWZPiMBZ0rgVjvUwsv X-Received: by 2002:a63:20e:: with SMTP id 14mr7035552pgc.161.1547124049820; Thu, 10 Jan 2019 04:40:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547124049; cv=none; d=google.com; s=arc-20160816; b=0rtl7nwgaFPczx8vxlp5agqDiSAPkiEpwfHGJr+qAFHfzfRGTpEEGzD78+7fTNcpr5 4T6bOTYoKlgHtcJQZO2DLE8JPQ2q1lN7HfRaozXSDTFvAhcD8QebEo4QIUpFvCY1WZZG wVQytIQ6c/PPNxMLNxFVSd7LT5JaPdWPQRGNSWFuAz96uidHy/FAQFwQwEIuxI3sJrmj 3UOLSAlfQ9IIvarCLd7xDT/s0TUI6X59A3kLfHJriDrzJIzvoyJR7K8PQ1O+SIU6RI9U 8QlNRRvI9MIP33+266UXp1L5YGh+rnS83t6ywes40cGWc/QanHloOslJbzEbM4aWyT6C zUeQ== 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=Is70u82OulI8r2hpqedctR5XcSdrZyGNzKWtrRZEWsw=; b=e7GtS39QCKsOvNAJ7k5nseg6sdebKf+VEGDhoYj1ZvVFIUTCm63+TzNfsNfO8tTyDh RUZFuzj9+qmOWixj576drH6VZHcbcvXmcRjttxEGg7ivtbm3XSCjuMJpwPpTyNC3UOw0 /0oLsnynEIUZjfVas+SDTuMXKUlu7ZXsrMyyCxuohyoLrrxJy40YuSQqJH0+/rs6DnbF zUccDELuMEn2p9UsOUnfL+kwO4utno/4IfcHq3/EcdbarMBfGTS8pBEGUIVrzjDF8oiJ sZShTMYVJnWBNtgXFT6Dj3J7PPgWR6hKXLXXsqK4Cff6wyulZ6u93wHTngqvoIRPpcna PCSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LIqFwI6M; 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 w11si30141378plz.327.2019.01.10.04.40.33; Thu, 10 Jan 2019 04:40:49 -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=LIqFwI6M; 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 S1728596AbfAJMiY (ORCPT + 99 others); Thu, 10 Jan 2019 07:38:24 -0500 Received: from mail-it1-f171.google.com ([209.85.166.171]:33937 "EHLO mail-it1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbfAJMiY (ORCPT ); Thu, 10 Jan 2019 07:38:24 -0500 Received: by mail-it1-f171.google.com with SMTP id x124so15338892itd.1 for ; Thu, 10 Jan 2019 04:38:23 -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=Is70u82OulI8r2hpqedctR5XcSdrZyGNzKWtrRZEWsw=; b=LIqFwI6MA6GrG7FNcLdvlXmGmP9Fvb7ekQgUDVahyGh4L+Ip8f8L++hBJ7fEC618yP MAyApy0l9rpNxWkIV/kF9IMWvN1vxIfWqdYWtwo9ZqiLVcgF7tCxBC0XtU1U+XDCf16A FubhWUxFZkcVEX9uiVXYdrzHagFKAOhgmb2HzvIPUfPyQRmbwSlCQ4tExPM7U7zu21BX qXnFhuji/gE2oMnMMjU5I9GXSJoeyDV/h4A8DgA3z+QBIfx/52J5I96j9A0dvvJoHGRS HI4wpCZg6S2v/dFmgchoz/zOe0G1G1Vs7xVADvisWUJrqZ6nI6slVCtGmolfWcJ7EoPD Xaeg== 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=Is70u82OulI8r2hpqedctR5XcSdrZyGNzKWtrRZEWsw=; b=cxgizuBmOPkJgOYIFjhCzp1Q2oxdocOc4EGbbt3TNGK47CNRE7LVN9CSKn+ZvpH4FR gqfkIa06skHIrshECVBtMlK5s73GKeOQq/VK1TX/rJPkn8jSrnySneUoll+QtBy8n4Os DVpNM3bGLtV7EnHcjBG/ovWBYvxiRtkozJJjHP2c2ixYzz8icIp891N6PQZSsdbfRgAU OYXkKXMZ0m571AdXLPUZxUxhKdBwMlKbyqppe5EqL/r6kWjSI2zV61JDxtqIApsMtb73 XYgMvOXX1rejNV7UzldVUmKeBEzpR21pgbxMd/2bxsd+k9HhmrWAZSrUbsEfLg9jhS5e DWtg== X-Gm-Message-State: AJcUukdQNteBQsowvbPH5Rm4SvNMoHTN26x+N0nZHayMDotGSYS7FR02 8PEFqskxagcua/cVIPt4sL4ouJWThxM0EHZecOf4hA== X-Received: by 2002:a24:f14d:: with SMTP id q13mr6374495iti.166.1547123903191; Thu, 10 Jan 2019 04:38:23 -0800 (PST) MIME-Version: 1.0 References: <20190109000214.GA5907@andrea> <20190109112432.GA6351@andrea> <20190109121126.GA7141@andrea> <20190109171053.GY1215@linux.ibm.com> <20190110123008.GA13625@andrea> In-Reply-To: <20190110123008.GA13625@andrea> From: Dmitry Vyukov Date: Thu, 10 Jan 2019 13:38:11 +0100 Message-ID: Subject: Re: seqcount usage in xt_replace_table() To: Andrea Parri Cc: "Paul E. McKenney" , Anatol Pomozov , Florian Westphal , LKML , Andrey Konovalov , Alan Stern , Luc Maranget , Will Deacon , Peter Zijlstra 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, Jan 10, 2019 at 1:30 PM Andrea Parri wrote: > > > For seqcounts we currently simply ignore all accesses within the read > > section (thus the requirement to dynamically track read sections). > > What does LKMM say about seqlocks? > > LKMM does not currently model seqlocks, if that's what you're asking; > c.f., tools/memory-model/linux-kernel.def for a list of the currently > supported synchronization primitives. > > LKMM has also no notion of "data race", it insists that the code must > contain no unmarked accesses; we have been discussing such extensions > since at least Dec'17 (we're not quite there!, as mentioned by Paul). How does it call cases that do contain unmarked accesses then? :) > My opinion is that ignoring all accesses within a given read section > _can_ lead to false negatives Absolutely. But this is a deliberate decision. For our tools we consider priority 1: no false positives. Period. Priority 2: also report some true positives in best effort manner. > (in every possible definition of "data > race" and "read sections" I can think of at the moment ;D): > > P0 P1 > read_seqbegin() x = 1; > r0 = x; > read_seqretry() // =0 > > ought to be "racy"..., right? (I didn't audit all the callsites for > read_{seqbegin,seqretry}(), but I wouldn't be surprised to find such > pattern ;D ... "legacy", as you recalled). > > Andrea