Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1884652imu; Thu, 10 Jan 2019 04:49:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN41YgwHkk5RyE+Y2du/pBxLXE2GFiBLVyLrZc+P/6yr2S5R5aQuYSK04AG4tYbELzAzXIeR X-Received: by 2002:a17:902:4:: with SMTP id 4mr10263686pla.20.1547124588027; Thu, 10 Jan 2019 04:49:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547124587; cv=none; d=google.com; s=arc-20160816; b=mCKt4vghvf1wWSw1i6qNz8pgTgxu8YrS0PCSccOafAFo0gBxpaEHqm36GXPyMYGI0g F8kggqUJtccDzJLDWcRwz/uwbq0BCinBEQGrpkt1FkTDCJjwUSEhiVwTPTF9K9rzHAXT z0ESU85YLlB+q2vGr0GhK5kRRDpQS7oImQE0/0GCKnzygi6CUoE/C81tnBiKbJVWn2oP 66sKrTnMu4mXqqNVX69Y2hnWT9IOepsRY+5HvmdSDKBzRqzxaokUQpmCYyN3P35l3OPg +/mnMQ0OIAMd/J5j+Rk9ptXDhlqHbx8Faf5zhvH+WF3+J9WmYJv2hZrT8T40ofh2JkXr 62Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tYi9UWHv4poWaAe7xdCVB/ME9MYSdW/l2osgWXicvxM=; b=wdgs9y5ViG0L03yOsCfERTr0TWiz/6hgtJgs+gyhmyxknt7c2HDNk0UamVBPDPZM5x riDzPtsVmkl7FO+yqVOdD+Kck6mx5xJZNzCKwxOk4Kbr1VGbTGOVO//IXc+TQ9u+CDGU P2Oca2XJB7CBorQG6tzwuQe2VnDbZJi3zZLMNnfU8o2BCBYt412xTdjlg2NRNcilJXz9 D0nSlLspYAvs9FZN++43PLTObgptqBWUH6Lw05OOiNn9p7/ZCuIlNPpYaOCtALXqN15t Q63CgO7m0AQp6LHe0vMStu2huPpYFuKmOZ36PDf+zEGw95lw5MD54mln7J8OKtaXb+HW uEvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KIv2goHc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si47507454pgb.371.2019.01.10.04.49.31; Thu, 10 Jan 2019 04:49:47 -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=@amarulasolutions.com header.s=google header.b=KIv2goHc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728620AbfAJMrE (ORCPT + 99 others); Thu, 10 Jan 2019 07:47:04 -0500 Received: from mail-ed1-f48.google.com ([209.85.208.48]:41533 "EHLO mail-ed1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727391AbfAJMrE (ORCPT ); Thu, 10 Jan 2019 07:47:04 -0500 Received: by mail-ed1-f48.google.com with SMTP id a20so10083812edc.8 for ; Thu, 10 Jan 2019 04:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tYi9UWHv4poWaAe7xdCVB/ME9MYSdW/l2osgWXicvxM=; b=KIv2goHcx4YRImBY2oqIXmTX0KUQgBlTAuqkiK3Ln0tpR/+YSaBrAbtlKJg9ynGKTO cXfp3wcjWgLICOUYUEFHhmFpHPEgW2Rbv6llWarmuAJ6tfVcGHs5NiYUzJTi4T/YLRGh wtMEtqqaP8mWP8fX4r7EYmju3d5KsF+OnoH1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tYi9UWHv4poWaAe7xdCVB/ME9MYSdW/l2osgWXicvxM=; b=X1qTyR1ebD7AzRlaVOOsAWTQo94RjvlpU4QK79snYcuL3KLJ0aumTitmv76LHJ50a0 D8BrGvtvsK1+ecJAW7s9EQNHhK9RhqhITwI5b8vN++BnRyghl48lZkQX/h7EWfa9c4VH Qvs0kvvFnIqYSypzBfdIGVjnOrZMxrq8Sxcrxi1qSqx/SvKIf9woAVukz+bTD/6Ww94h r2pj9ls7uLzaz2DQqFhr3T4b+Y7YUhG6Ccu0k4L6cIuovET5sT83l3b5kgcabCHMcK9s fXinPbJwF01ecoUlb1K5qFOfFKQPEMJbAp1GE5PY/YvdfLcPHaL5H8sVzXz5Dh8rfqhr yTAg== X-Gm-Message-State: AJcUukcOv/Dl083sM2UKhWZCEH8SMxJzL7+Q46k7Z6Nag00JCPwHKswx +tVH7K4GCMkQTmzptmYhlQybAg== X-Received: by 2002:a17:906:8301:: with SMTP id j1-v6mr8687812ejx.60.1547124422238; Thu, 10 Jan 2019 04:47:02 -0800 (PST) Received: from andrea (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id f31sm2024381eda.16.2019.01.10.04.47.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 04:47:01 -0800 (PST) Date: Thu, 10 Jan 2019 13:46:55 +0100 From: Andrea Parri To: Dmitry Vyukov Cc: "Paul E. McKenney" , Anatol Pomozov , Florian Westphal , LKML , Andrey Konovalov , Alan Stern , Luc Maranget , Will Deacon , Peter Zijlstra Subject: Re: seqcount usage in xt_replace_table() Message-ID: <20190110124655.GA13986@andrea> References: <20190109000214.GA5907@andrea> <20190109112432.GA6351@andrea> <20190109121126.GA7141@andrea> <20190109171053.GY1215@linux.ibm.com> <20190110123008.GA13625@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 01:38:11PM +0100, Dmitry Vyukov wrote: > 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? :) "work-in-progress" ;), or "limitation" (see tools/memory-model/README) > > > 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. This sound reasonable to me. But please don't overlook the fact that to be able to talk about "false positive" and "false negative" (for a data race detector) we need to agree about "what a data race is". (The hope, of course, is that the LKMM will have a say soon here ...) Andrea > > > (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