Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp685096pxb; Tue, 3 Nov 2020 09:42:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwP08Q2NGVZmv5Y6XLhmA1Gl0MIWi/ibmO+irjlxnU09ogsyrPADKLN3Jk4CGo6k4OH8OBj X-Received: by 2002:a05:6402:1d85:: with SMTP id dk5mr23768699edb.240.1604425355275; Tue, 03 Nov 2020 09:42:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604425355; cv=none; d=google.com; s=arc-20160816; b=Wshwdwg8KoPrh1n/yUl8FJ4OQjS+mRgM3T2Y79e4OI0JfIX2yzQg2eBA8czxTc0B5Y nkzVzXNGWLFSvNYFUCFxr0mvDJh8Blr9gKlbsPTRM6v6TBVB6eAMxk+95erBC1Kz+i/o Pml+N9ifvZVvzVxZJknLf5KhvpZUcgF+b5CRtXXQ36C5bmRAGydBNlA/a3E1mexisE2Q xxtsqfA0sI19qDLWL3VJ7oV3w0ayWy6eetkPgL/WOrVCqR+Y4QTrqipZuWxM8JVO92vd +lrzvMcF4+dw7BD3Tm98d6mgkDlB6Se5P0mFTwtE5PnnWFAiHcULd0kxyGO9B1sX1lSW WPFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VNuZGY4bpOVQ0MWLoadHLlFU7CajKxxBqUm83XLo9pg=; b=XKQJ803n64laCLKCxHUuBJhBxEGx0LW5mznC59CUXreDPXHQeWOJgftpbb/z9Cu75R rYXW689HwYQpRt51+1/POErXryTw7LqhZPIyJ6ZUZ7LQgstdoyeWv20SIzXHE6s4ZjnU Zij9AAz85bakE9o2sw5OVxHi/QX3D2DNOykXBGLpEGlaoZk3yrI1E0Zl7CHd7kf/pOBP Pv0t2vvabv5Z7UEJCLg10fPJ1H5uzuB1fxzLJua7IbuOo7xI6AF+tRUakx9lkM3AwJdc xdYDbz9C34rjIF4ZjuYZdZJqCSsPD2Wy4R1W7VA4ncBcP8fmRoRVQj0jN5CeP+bqvAPy xJTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HMA9GKwv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si12498163ejz.383.2020.11.03.09.42.12; Tue, 03 Nov 2020 09:42:35 -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=@linux-foundation.org header.s=google header.b=HMA9GKwv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728806AbgKCRkq (ORCPT + 99 others); Tue, 3 Nov 2020 12:40:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbgKCRkp (ORCPT ); Tue, 3 Nov 2020 12:40:45 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E519C0613D1 for ; Tue, 3 Nov 2020 09:40:45 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id y16so20008587ljk.1 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=LmnVFH7UA+zC6t6mvmTbo+Fkw19jGbBmiRkivS9hsY8DUq+UXfM1cyTNSb7xb46rSA IPQ6CQTV1QMkNbs9Z3CO/lT+e/fvUkWBDbMHCusyQuNcTiEinwuuk6xkDPCa+sJKAiTJ FpjOPeck1jSiORAK5eO6ot+WwICG3LCIPuoVQWHjFEdb/LKZdFmQKKFb/JfICmnLOlw9 nqvGdX5B2y1SS3dl0+Hq2cRzrXvQmLnpRFY4ifY4UBUv8NfsyI3BWqn09wseVOeI40KB cP0B10s3L/0KuDGkLT2JWMOElnau9xmRto6AA7hUugGcqv/4wCgS4IIF1XOQEQ8tWLZX W9hA== X-Gm-Message-State: AOAM533CD87gp9u5qQIWBL84sNlSI+1+32TnAb0qtnMl8BIYAGR8Gxwy ThME5IiY5pP4rI3ytgYOjSsvOjh2FQtRFQ== X-Received: by 2002:a2e:9c8d:: with SMTP id x13mr9601732lji.253.1604425242960; Tue, 03 Nov 2020 09:40:42 -0800 (PST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id 21sm4092142lfa.183.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-f50.google.com with SMTP id 141so23335415lfn.5 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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