Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp138077pxb; Mon, 2 Nov 2020 16:35:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwiu/j1h+aMJbQnzqRcTEQkzqkxQ5GUPN88h9B8DGR8hROi+ipuj7hgwkFYkmiWpfVA+hB X-Received: by 2002:a17:906:8812:: with SMTP id zh18mr16816424ejb.361.1604363745035; Mon, 02 Nov 2020 16:35:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604363745; cv=none; d=google.com; s=arc-20160816; b=rE2mNNOONfBLmavM+lVCNU7+uFt32PmQi85pIoBKnq7rX0c3Ybyt/gxo8s6JI6JTIg OptgzW0zxr/6/5wbktwmdn9qF6ZPiZ3LqgwbrlomDnh+Zy+RitTkmvhLYasY3JBaeEtT KQj0VZ7lM0re9iqK3wmqg8FsCS+Zbf3omfuSsmInb4L44G7oqIRam3CsoGr+gKK9XQtJ y8Ru4c8yTJbA780WsL/ddIi66Dd55ZpoRacd0kNZeunAp20UjARlVynA3WsLqmUth4wK pfOsgEYov3tcGYzPi74O0xabN/HXSt6Q3PRupe3mdp9eaWANt+xoVEAZwVaajr7oqm84 YKcg== 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 :message-id:subject:cc:to:from:dkim-signature:dkim-signature:date; bh=Y77zxdoENlOcmN7TXezQoE5rEB/c1724Uvi6xgzFbN4=; b=QboX8BEXGsqqERFWZ0nc3OvDVurvE5YtKNOCbiWOfVX3/ifUCpj9ls7Vh+rfw8Gekh QH6Xq12KGPxYp+LgJboE88F2oFAHAiodoFh7UIpC2qzHu+kowDFHrtKbbyy0piIo+3Qc j0UOd+zNwms7v7OmF1uldD5f//natO6pui0h8K/6e3Vk31GrlTKwpMoZ5G9ZEFHs2UIJ bJyKfdhiB4IcnPjhPDepmbfcv9M2G15JqzxKiQH7C7O2HZm8gODcSuzxfq1cIWSw3tdF N9nD9r0bQXhOYJFnk5Oq1WbJ1NIUFhMAR0Z/25IHW5BnFC2BwiLNemSea1HvnDXZnmJB IObw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IDtvJilp; dkim=neutral (no key) header.i=@linutronix.de header.b=U66ioQL9; 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 k10si4204951edx.251.2020.11.02.16.35.23; Mon, 02 Nov 2020 16:35:45 -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=IDtvJilp; dkim=neutral (no key) header.i=@linutronix.de header.b=U66ioQL9; 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 S1726172AbgKCAdu (ORCPT + 99 others); Mon, 2 Nov 2020 19:33:50 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:34176 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725921AbgKCAdu (ORCPT ); Mon, 2 Nov 2020 19:33:50 -0500 Date: Tue, 3 Nov 2020 01:33:46 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604363628; 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; bh=Y77zxdoENlOcmN7TXezQoE5rEB/c1724Uvi6xgzFbN4=; b=IDtvJilpB3dhGEU4+MoaabkPWj1Pw3lho68xze8cDPoOjGCanGINaxHLOnPsudUqdb0Jse DA7zOfTnQEPSvoi53R96yAfkV/9Dack82pfFCyCi4/0C8U03uwsgHLP+QYRJvUQcskP9rF SOJpakh9HBuI1ghZWN7Ft6Ufw9p+gxRHcUE3yTjhLHSpSsL/jYQAfbdAQEfrvl/G5/xnfe TPEwRilkCPace4WIySmPjMbQW4Z5cWTClC4RzVK1Y4MBmwrNrKBp6/+jiH0iT/CuCYSVM9 b7G9FWhgWVxoAqTsU1cpK5fZ9yhHs6kuRe90DfJeqOpUSJMjg81JqIYQhy7q7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604363628; 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; bh=Y77zxdoENlOcmN7TXezQoE5rEB/c1724Uvi6xgzFbN4=; b=U66ioQL9OTKucJydCuw1jdnhEYPGbmmLfaUA0Fb4gCxBhyuOUz9tL7Mmu7qTyad8RuNFlE T+Q/RCXP7KOhSHBw== From: "Ahmed S. Darwish" To: Peter Xu Cc: Jason Gunthorpe , linux-kernel@vger.kernel.org, Linus Torvalds , 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 2/2] mm: prevent gup_fast from racing with COW during fork Message-ID: <20201103003346.GC52235@lx-t490> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031152605.GD6357@xz-x1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 31, 2020 at 11:26:05AM -0400, Peter Xu wrote: ... > Shall we document this explicitly (if this patch still needs a repost)? Yes, this patch series needs a v3 :) > Seems not straightforward since that seems not the usual way to use seqcount, > not sure whether I'm the only one that feels this way, though. Yes, this usage is correct but not common. I've proposed a more explicit comment above the write section code, in my reply to patch #2. ... > The other thing is, considering this use of seqcount seems to be quite special > as explained below, I'm just not sure whether this would confuse lockdep or > kcsan, etc., if we decide to use write_seqcount_t_begin(). > Lockdep won't be confused as it's not used in the raw_*() variant of the seqcount APIs. AFAIK KCSAN also has some margin to protect itself from this: see seqlock.h KCSAN_SEQLOCK_REGION_MAX. Thanks, > Peter Xu Ahmed Darwish Linutronix GmbH