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=-4.0 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 4EF49C4346E for ; Sun, 27 Sep 2020 18:16:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7DB6823A33 for ; Sun, 27 Sep 2020 18:16:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="eVuX7Xae" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DB6823A33 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 AB7666B005C; Sun, 27 Sep 2020 14:16:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A68B06B005D; Sun, 27 Sep 2020 14:16:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 957BA8E0001; Sun, 27 Sep 2020 14:16:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 7EEA66B005C for ; Sun, 27 Sep 2020 14:16:55 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 49E314DA6 for ; Sun, 27 Sep 2020 18:16:55 +0000 (UTC) X-FDA: 77309647590.27.trick24_5c13f632717b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 2B61F3D663 for ; Sun, 27 Sep 2020 18:16:55 +0000 (UTC) X-HE-Tag: trick24_5c13f632717b X-Filterd-Recvd-Size: 5918 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Sun, 27 Sep 2020 18:16:54 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id y17so8460902lfa.8 for ; Sun, 27 Sep 2020 11:16:54 -0700 (PDT) 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=797OM3T7rQIjzBdDITGh5Pq4vHALZju8suVPvtIgEOY=; b=eVuX7Xaef7re4SeKM4iOgRTBQBkOaTHR2bT2XyBBKlQqaSenhTQ+Y6rW5rya3V9/M9 yPTNt744J1/Z4dQGIkSYhBpafc3alaMGNmJL5Ci94CEyPoD3xJ9LaIYl7Y4PZpDcG4UJ pD8/gkQwEAwJJvIQbcIq39e8W4mziVUDX+RIg= 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=797OM3T7rQIjzBdDITGh5Pq4vHALZju8suVPvtIgEOY=; b=oXMoQ08x50LrwgZdjaIJJXMw7UbLHc5gbdtCzCzcNvng0prC1GDDsxKIlZCpc2wd/i 9oqTRn37H8NJESLCcssc0L135KOxQN+5drrL7uIwh7N+Yn0upQX2Nx7SsLyYvHIozSOK pSG9MX5KWCWsvZjTHxF7dqOJ/pfJk3YZF9FRsqkbnaDFqaq+buteFsz1YxB/dZKJOp88 JzwLiEj00+ZhS8sZxbDD1teTk0tufyuex6vXhPSQ5DAlf9yxRea4+oXoUB7fNJ1tsiQ8 3cnBGU1gkmVYgkZEFUGGoyI7Gs/j2PXM+8p0KM5eUnX51iYVMNZbMHletEq9bo9K4EvO jcww== X-Gm-Message-State: AOAM533CM19uo687MrYgTQVgRsbbjk2cPhxOFMcw4iKNNk6EsfyFlIv3 LkNds2kOWaaeAJW8mF3vH1OFFAMgBjHT2w== X-Google-Smtp-Source: ABdhPJyUJFSXM9q6LWJ8RoZ1cXpJGQ0RleRLf/FTD6tigx1puIISH3CxD844781yhRds0pmAZbVkvg== X-Received: by 2002:ac2:43a2:: with SMTP id t2mr2958869lfl.421.1601230612815; Sun, 27 Sep 2020 11:16:52 -0700 (PDT) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id m1sm2539744lfh.99.2020.09.27.11.16.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Sep 2020 11:16:51 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id k25so6521764ljk.0 for ; Sun, 27 Sep 2020 11:16:50 -0700 (PDT) X-Received: by 2002:a05:651c:32e:: with SMTP id b14mr3745551ljp.314.1601230610424; Sun, 27 Sep 2020 11:16:50 -0700 (PDT) MIME-Version: 1.0 References: <20200924175531.GH79898@xz-x1> <20200924181501.GF9916@ziepe.ca> <20200924183418.GJ79898@xz-x1> <20200924183953.GG9916@ziepe.ca> <20200924213010.GL79898@xz-x1> <20200926004136.GJ9916@ziepe.ca> <20200927062337.GE2280698@unreal> In-Reply-To: <20200927062337.GE2280698@unreal> From: Linus Torvalds Date: Sun, 27 Sep 2020 11:16:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned To: Leon Romanovsky Cc: Jason Gunthorpe , Peter Xu , John Hubbard , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , Oleg Nesterov , Jann Horn 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 Sat, Sep 26, 2020 at 11:24 PM Leon Romanovsky wrote: > > We won't be able to test the series till Tuesday due to religious holidays. That's fine. I've merged the series up, and it will be in rc7 later today, and with an rc8 next week we'll have two weeks to find any issues. I did edit Peter's patch 3/4 quite a bit: - remove the pte_mkyoung(), because there's no _access_ at fork() time (so it's very different in that respect to the fault case) - added the lru_cache_add_inactive_or_unevictable() call that I think is needed and Peter's patch was missing - split up the "copy page" into its own function kind of like I had done for my minimal patch - changed the comments around a bit (mostly due to that split-up changing some of the flow) but it should be otherwise the same and I think Peter will still recognize it as his patch (and I left it with his authorship and sign-off). Anyway, it's merged locally in my tree, I'll do some local testing (and I have a few other pull requests), but I'll push out the end result soonish assuming nothing shows up (and considering that I don't have any pinning loads, I seriously doubt it will, since I won't see any of the interesting cases). So if we can get the actual rdma cases tested early next week, we'll be in good shape, I think. Btw, I'm not convinced about the whole "turn the pte read-only and then back". If the fork races with another thread doing a pinning fast-GUP on another CPU, there are memory ordering issues etc too. That's not necessarily visible on x86 (the "turn read-only being a locked op will force serialization), but it all looks dodgy as heck. I'm also not convinced we really want to support that kind of insane racy load, but whatever. I left the code in place, but it's something where we might want to rethink things. Linus