Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2537353pxk; Sun, 27 Sep 2020 11:21:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZn4SZg4JQrLlHEbDWsUeaYm0+3DfDELveV2uTwoOp+uiopMdAB8McDvL+8eCWaNeL3iRz X-Received: by 2002:a17:906:7e42:: with SMTP id z2mr12120781ejr.206.1601230882792; Sun, 27 Sep 2020 11:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601230882; cv=none; d=google.com; s=arc-20160816; b=xAKCA/zbDr7Jd0EKVWPSsJtA3FlhV1A8/tL9y6K/hdKY7y9CBmeS6mggvTq8MNGEaS wVkZ6R2WOpISLHto/Zsvmv9WoQ/dCKvtSrNL4PIq44bpRSA89MxI0rPTW0JqXf8LyozH eWWuPWpj70XM5UTooQG8oKDsoq4+tzV312pA8bVuMIjZJbBIYyGGrI1RMoKbCpImMIpt oFXVrk/w5bybiHxcrm6QGRoEWEtauC1MBTB1QM7ZlV7itThni7ubxn1TdBlA475BJPzW ti0bldAsHvIWTjcI9flKTrZBqBxYHYkTPkszX4b7ap8t5/K8ygMXyabPcK5FqC0Np7Ay yGPQ== 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=797OM3T7rQIjzBdDITGh5Pq4vHALZju8suVPvtIgEOY=; b=cpALo4s//nB7USGENA9j68vE+oqlkacp5oA/ZDORe2dXyLs6EX//+e34hhVNN/UqVU btdRctANJJ/b9VFaYCeiiRLH6wXq0xZFnQ2U3jdiXTdAzQr5hxSm4ccNwiEfWeSdI6Lp hjCM5GXCZj5E1RE2PGdeJOzDrELR8xftK4Ni3Z4VZmnGwFxPg9Tfdj4ASQ6oh5G5hc5i uMNAz6lg5dtJfiFqqixO4vuzaTiGTArQt63An//v+K/kVG0Rxfa1pUXA4Nsoyq5a/T9z AWLogi42dFQLyYCG/uwGlkX9R8DSDTUMirBVVj7asrdu4dH5SzTTrUQWItgEtAUcL+J5 k7Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=eVuX7Xae; 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 h11si6340590edw.573.2020.09.27.11.20.58; Sun, 27 Sep 2020 11:21:22 -0700 (PDT) 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=eVuX7Xae; 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 S1726757AbgI0SQ4 (ORCPT + 99 others); Sun, 27 Sep 2020 14:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726460AbgI0SQ4 (ORCPT ); Sun, 27 Sep 2020 14:16:56 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69BBC0613CE for ; Sun, 27 Sep 2020 11:16:55 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id 77so8520736lfj.0 for ; Sun, 27 Sep 2020 11:16:55 -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=Dr/g71IBOoO2erOOFQn/HFyuSnpQ0sJxRQ/WXDh20PZhvQszL/VVQbdOXwdmrQqvwi 3hW3ZfJNZ30Uw1NTQtmauKqEMLoCOL03pKgCXSCw8x59Jk7n3HF26c+sl72UBpsIZZl4 pUHH4Wj/zDEZvV2bzC4yvNMpQnOmiYTF53tBfC/lRodjEDqxwaMOXW7XnAfAUclC/6fk vQAcAWp1BPGKu1PRWnL01MxLx60fNeL4oPZwj7CW6J44A7ce0vPNPb/7oj8CJYL26Fcm kUsHPQLPgLl/41siX0X0kRVL4lhB2yWVsOhVC+Qg2blSFWulip7FSHdTQVtc5j3N3rAp abfQ== X-Gm-Message-State: AOAM531C2V3fZjIEIQ/DWH78e94BpKR/+P/zD5vuj6rTYjLPpdTftRee NtlKthqsLcMQZkwlpIcE8bAQD0eWbS6u6w== X-Received: by 2002:ac2:4648:: with SMTP id s8mr2604524lfo.280.1601230613843; Sun, 27 Sep 2020 11:16:53 -0700 (PDT) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id q22sm2584590lfp.40.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-f181.google.com with SMTP id u4so6465064ljd.10 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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