Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1945201imu; Thu, 10 Jan 2019 05:52:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN7twAssVHQ2kpOyNrCfo6GNFa2qEiniyTPoKXYHEYTTwBg2XHSV+8TIT/1c2T3LQL7WBqSt X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr10128965plp.247.1547128327179; Thu, 10 Jan 2019 05:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547128327; cv=none; d=google.com; s=arc-20160816; b=s1ejAEka4+wBlRyo8kq7bLCE2rR+JAY82+1LGljS3HmwVDzTqgwu/bzagT7VktT0ds r+35jAkaUiH3XsT5TeoYBDtk1qYIdjcni+YJeKiaJoQKnNO1luouH6M71YJcKefxqpr2 rG0PrOO6LEzIXjeuvcrkk/mEIkwPu6iaagBeG1AL5Squob36Qiswngw6UJ9bWcX81rQa IgIRhKPXzbuNYv8qqzqEqT58LoLoNqDc+dtDhVMsfjGUgksZEdPMUNXD1B1VcgrsE8VU 7BUxfqt4Be1GOVIraSitqlY6QNlJeFzexyJDc4b6pzvco5tCE52BJF0LTwkQH6f13Psq mwXA== 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=b5pwS76upqu7bf/WK5Q8xprKyMjmubH4YvD9bF2stR4=; b=m5N7QjvYUbdxZ3yS1L7ZpJbe2myRCQzy9/3StAlpP9H5VDbSedWxF4eyVBBZHyQZSX wcwhe6dgru4UyYk561hfro4VCMqo4jVq2POGGb+Z8rUClM8pOLNFtlbjw5IsF2RChlIm KaSO09+8w77OuMStDwE16kzX7BDmhFnNWkGo0qVgR2jVg+arVglfOGDp/FfcsUSNKL8E r8OlVDnPI3aOjSV+mB9GiYxwdGB9iC03E+NYuVoyFqnIHJNz9d1j9So2+aRbJzCPk5mO udvduU9G6gfQVbzO1HypuKZl2vj8XyuYgYUNnx9ypRs6yBbm31F6Gm/XcPEe2VI4cApY aspw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c8wv7QKV; 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 89si23424725pfr.242.2019.01.10.05.51.52; Thu, 10 Jan 2019 05:52:07 -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=c8wv7QKV; 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 S1728376AbfAJMaR (ORCPT + 99 others); Thu, 10 Jan 2019 07:30:17 -0500 Received: from mail-ed1-f52.google.com ([209.85.208.52]:37887 "EHLO mail-ed1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727623AbfAJMaR (ORCPT ); Thu, 10 Jan 2019 07:30:17 -0500 Received: by mail-ed1-f52.google.com with SMTP id h15so10067934edb.4 for ; Thu, 10 Jan 2019 04:30:16 -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=b5pwS76upqu7bf/WK5Q8xprKyMjmubH4YvD9bF2stR4=; b=c8wv7QKV90iU4qXqQd07I0F5nV9SFIYzw3qlmfVNHbVhBMGy5fE98sXcmuKj8ILBI+ 7fVnjxgY40+gTsvmhvX5YUVwNYHzw8SDWb3Zf8pmeon625KZScUyGmoGC0RcRzMyZCSx UvX8+1vpaPWL2ubc/bfz5i6aaLoexbgMgcnRs= 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=b5pwS76upqu7bf/WK5Q8xprKyMjmubH4YvD9bF2stR4=; b=EBzm52W0Lido2/iS/oK1T6g0w+wPT27q+BBRhVHJSRR6ThLqmisT+H3jPvR2hPoNQT iQLuZNJhbjS5cI6CdqtzrWsEVmvnvlI9Br9rIA+hM+IL3VwMxixTe2UryYBd9OKxwSOY +1G2OY2F69z3u5mMVUwhJHQnZRwcPiYq5kfjQSbqJZcojhTdllfW/kLaPdDcGFtAc/Fk voKm5VtmnQhSDZpCekuej4SIb/+loxZThy7mXZ8EMBWEYOiaBdtFjhP0r6z9OootUEQd yF3eKMiRYqpXy/pae+b/JXB/24WeQUdWBu0UVy2KDMem0u7WlajG+UTk1HMh+ajkL0Ox OPWg== X-Gm-Message-State: AJcUukccPCcoX5ZuEsA3ABLiJazld4DSJfc34gaEBwUL7bfizzMINnPJ pB/NfpQUARj440uo3PcIES+v6e+v/5+4lQ== X-Received: by 2002:aa7:c605:: with SMTP id h5mr9664169edq.9.1547123415557; Thu, 10 Jan 2019 04:30:15 -0800 (PST) Received: from andrea (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id 97sm1709025edq.45.2019.01.10.04.30.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 04:30:14 -0800 (PST) Date: Thu, 10 Jan 2019 13:30:08 +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: <20190110123008.GA13625@andrea> References: <20190109000214.GA5907@andrea> <20190109112432.GA6351@andrea> <20190109121126.GA7141@andrea> <20190109171053.GY1215@linux.ibm.com> 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 > 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). My opinion is that ignoring all accesses within a given read section _can_ lead to false negatives (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