Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp101649pxb; Mon, 2 Nov 2020 15:20:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhexWvdYZHctBU2G6aLkBvNqA0Ekh+feM69lvDHhn1BAo75jQqUyPt74HPpYw+Kc0e5PTE X-Received: by 2002:a17:906:280a:: with SMTP id r10mr17370340ejc.58.1604359208339; Mon, 02 Nov 2020 15:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604359208; cv=none; d=google.com; s=arc-20160816; b=RBYNhtcjKI1azUohX8On7OjsEU2U9Z6JVkJQ4b0fbeeE18QMX3MIGuuCeSdpBwHh4L dufdw0OM3u+egWsbmU6PusWv6Ec64P2TQ74IZuoS7gnBFSnKdhtA9LirTfH59U9FsFnL t50vmE2PmNe001tD3lc9/ltcKdzNXhBUHBkmq5iidY0EThZVW48Jd3EwnPgKa4rznxcD Y0hzSj8cEekvwbXML7uCZyZCGrRd02cmHc3nmYy2zwJOdwNu2QY3NA+z3f4GpPstgvPW u7wjoh6hW62/upmdqFnqZH3mjFw6V/gU20b+zbvAndmtYRuIakptpTTBYTD5YEBzV2oJ xTYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=yVJlgI2Jg2jaYgAMQidX6deypd1QfekkTNPC7CxbpzQ=; b=MkuT2oSAOUXz2tzzLi4PPpspLOKvwKWUgu/w7cwpfxZUBeovhZpyhNqG5vCOqoRsz2 omWKN+byhlv7QQX5cIEVmeiG3FVzu+WaC1SoxIeAZBaDxCm0Ozz0Ey0+6SSH62udrJwS xHClR2OcxRFM+EAPeo06WJfwhj42KGDS+Dwxhjje53vkdsddts7QQeRAjmVhlP6xntEg Uv7O/mC9qlEmJ+zRsm2DAyAFv2++4K4P1tuMB6OjzMhlS1XZAymQNy+IoElJ3BvFvmNv X5Vq5ejt1Wx3GmZ5IsRrFhdHXSe1VNBO2irrOmjL2B/SQIjn8q8VjantjtIJqUvxesj5 pv/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mRP53UFQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=yfbdBEdU; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si11598997edu.226.2020.11.02.15.19.45; Mon, 02 Nov 2020 15:20:08 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=mRP53UFQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=yfbdBEdU; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726018AbgKBXSa (ORCPT + 99 others); Mon, 2 Nov 2020 18:18:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbgKBXSa (ORCPT ); Mon, 2 Nov 2020 18:18:30 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9407CC0617A6 for ; Mon, 2 Nov 2020 15:18:30 -0800 (PST) Date: Tue, 3 Nov 2020 00:18:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604359108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yVJlgI2Jg2jaYgAMQidX6deypd1QfekkTNPC7CxbpzQ=; b=mRP53UFQTqDKOQYHH0J/Ll3N7qtXQL4HgQwnaphvUQbnJ8ZZByCQJhsGiIMZpQLpH4Knw3 xK9nWzlpLqN1w+8DpL2+KjTsKSnDeLUL/xDrsqn483LUJQtAc7JtbKBnPZTUVdj+/mxg7y sXtuZQwLQrnfrXUUresWpyNAgUiH3O1Sd8N5j2hoVuW92ohCd0HG88DwcWUCX7WfasW1YH gQ0VUirYVADtovgEE8ajyC0ERY9e89HKHek9q2ChpTTwFzd1lag6AlUoEFU2YCQKc20dp1 EdKseBelNT3FQSKfr2nFbvYSCin+6EA8ak1oVd5sIfSSp+hYJui3CMyUGXZEgQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604359108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yVJlgI2Jg2jaYgAMQidX6deypd1QfekkTNPC7CxbpzQ=; b=yfbdBEdU/ow879IuX+su1cP+Z7unJs/HOWIARjR8Nr0VrMZTbrpHwBWdoNAQY9v0bF2gJS VDhc9OyqRHVAHyAg== From: "Ahmed S. Darwish" To: Linus Torvalds Cc: Jason Gunthorpe , Linux Kernel Mailing List , Peter Xu , Andrea Arcangeli , Andrew Morton , "Aneesh Kumar K.V" , Christoph Hellwig , Hugh Dickins , Jan Kara , Jann Horn , John Hubbard , Kirill Shutemov , Kirill Tkhai , Leon Romanovsky , Linux-MM , Michal Hocko , Oleg Nesterov , Peter Zijlstra , Ingo Molnar , Will Deacon , Thomas Gleixner , Sebastian Siewior Subject: Re: [PATCH v2 0/2] Add a seqcount between gup_fast and copy_page_range() Message-ID: <20201102231821.GA51715@lx-t490> References: <0-v2-dfe9ecdb6c74+2066-gup_fork_jgg@nvidia.com> <20201102221945.GA48454@lx-t490> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 02, 2020 at 02:39:49PM -0800, Linus Torvalds wrote: > On Mon, Nov 2, 2020 at 2:19 PM Ahmed S. Darwish wrote: > > > > Disabling preemption for seqcount_t write-side critical sections was > > never a new requirement. It has always been this way, for the reasons > > explained at Documentation/locking/seqlock.rst, "Introduction" section. > > Note that that is only true if you spin on the reading side (either of > the two kinds of spinning: (a) spinning to wait for it to become even, > or (b) repeating if they don't match) > > Which this code doesn't do, it just fails. > > I'm not sure how to perhaps document that. > Sure, and this is one of the reasons the lockdep non-preemptibility check is only added to the non-raw variants of the seqcount write APIs. Presumably, users of the raw_*() part of the API know what they're doing, and they don't need to read seqlock.rst :) (I'm in progress of replying to patch #2, which touches a bit on this and other points).. > Linus Thanks, -- Ahmed S. Darwish Linutronix GmbH