From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B66DC2D0A3 for ; Tue, 3 Nov 2020 17:40:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D408C2242C for ; Tue, 3 Nov 2020 17:40:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="HMA9GKwv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D408C2242C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D4ED26B0036; Tue, 3 Nov 2020 12:40:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CFE2E6B005C; Tue, 3 Nov 2020 12:40:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BEDC76B005D; Tue, 3 Nov 2020 12:40:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 934D46B0036 for ; Tue, 3 Nov 2020 12:40:46 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3816E1EF1 for ; Tue, 3 Nov 2020 17:40:46 +0000 (UTC) X-FDA: 77443822092.14.voice14_2900bdc272ba Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id F2B8218229837 for ; Tue, 3 Nov 2020 17:40:45 +0000 (UTC) X-HE-Tag: voice14_2900bdc272ba X-Filterd-Recvd-Size: 5028 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Nov 2020 17:40:45 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id 141so23335856lfn.5 for ; Tue, 03 Nov 2020 09:40:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VNuZGY4bpOVQ0MWLoadHLlFU7CajKxxBqUm83XLo9pg=; b=HMA9GKwvbdKK/+0mVxuViEE+jonKrCcpg4izx74kjD6cePewJ27tQSij8RYpkFdSs1 w/SVIscNoPKqcQGjWeedtzu6vz+iecm8rT4dumRlRdUsVWQGr2OnOXiqvB1acZS2dN/I I9ODfraNHzaYMpRzWgSmjhMzYpYEx67/w2iyo= 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=VNuZGY4bpOVQ0MWLoadHLlFU7CajKxxBqUm83XLo9pg=; b=sG3wmeL7CWzFsPz+llaaTDuGSCDmLBBxnNLWSwzmRDXLToSt/w5HI8Gt9tC5lmSg2i jl60sw4PKnTdNf+ktmFpyx/tb1qsEd8R95V8slm3os1oWS/lEaipZJuT5qWQw345GX+f iNgnnwt55TYxact0EtTkdmeFMI1NDPpk0ns6d/cbjGvxR/F9yQzx5QoWgRSi1jMQloFL 7s4X44VsSFb/hstjgKeD8iISQ7Ci0iv8aSEM3IHWiQVhVJSLsDsWK1d0wcR6vXWL9q59 UFQ1fOqDVq1f+A6hsSNpH1sSx/+7n29PyguxrteomJzgy2uU9oC3fO4X+7KqukKavi0j DH1g== X-Gm-Message-State: AOAM530b55DpvFurRvKy5EwFzuNYUqYkxLHbCL1zJPEA/Oqazi+O3d9w XdCeizER4t+0dA3I68k0DNixYABVmUP0hA== X-Google-Smtp-Source: ABdhPJyorMYHPh3P32RRpEHzsU4a6xUFYjUEQAKsgJIzWbtwwhSp/OB0Iq3hWnXLlLtIJq0ST4/GNg== X-Received: by 2002:a19:ec2:: with SMTP id 185mr7627223lfo.425.1604425243100; Tue, 03 Nov 2020 09:40:43 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id a15sm3468131lfj.224.2020.11.03.09.40.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Nov 2020 09:40:39 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id b1so23273905lfp.11 for ; Tue, 03 Nov 2020 09:40:38 -0800 (PST) X-Received: by 2002:a19:83c9:: with SMTP id f192mr7604236lfd.148.1604425238332; Tue, 03 Nov 2020 09:40:38 -0800 (PST) MIME-Version: 1.0 References: <0-v2-dfe9ecdb6c74+2066-gup_fork_jgg@nvidia.com> <2-v2-dfe9ecdb6c74+2066-gup_fork_jgg@nvidia.com> <20201030225250.GB6357@xz-x1> <20201030235121.GQ2620339@nvidia.com> <20201103001712.GB52235@lx-t490> <20201103002532.GL2620339@nvidia.com> <20201103004133.GD52235@lx-t490> <20201103065225.GA63301@lx-t490> In-Reply-To: <20201103065225.GA63301@lx-t490> From: Linus Torvalds Date: Tue, 3 Nov 2020 09:40:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] mm: prevent gup_fast from racing with COW during fork To: "Ahmed S. Darwish" Cc: John Hubbard , Jason Gunthorpe , Peter Xu , Linux Kernel Mailing List , Andrea Arcangeli , Andrew Morton , "Aneesh Kumar K.V" , Christoph Hellwig , Hugh Dickins , Jan Kara , Jann Horn , Kirill Shutemov , Kirill Tkhai , Leon Romanovsky , Linux-MM , Michal Hocko , Oleg Nesterov , Peter Zijlstra , Ingo Molnar , Will Deacon , Thomas Gleixner , Sebastian Siewior Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 2, 2020 at 10:52 PM Ahmed S. Darwish wrote: > > The problem is, I've already documented seqlock.h to death.... There are > more comments than code in there, and there is "seqlock.rst" under > Documentation/ to further describe the big picture. Well, honestly, I think the correct thing to do is to get rid of the *_seqcount_t_*() functions entirely. They add nothing but confusion, and they are entirely misnamed. That's not the pattern we use for "internal use only" functions, and they are *very* confusing. They have other issues too: like raw_write_seqcount_end() not being usable on its own when preemptibility isn't an issue like here. You basically _have_ to use raw_write_seqcount_t_end(), because otherwise it tries to re-enable preemption that was never there. Linus