Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1512978pxk; Fri, 25 Sep 2020 17:46:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJNG2ZUiP88py5tcBqlFqUmsqVDeHAvqKA8L5Wi6kFHKwsjxY6yKjCA6noVNlJyRW4s/6M X-Received: by 2002:a17:906:194b:: with SMTP id b11mr5184250eje.159.1601081159843; Fri, 25 Sep 2020 17:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601081159; cv=none; d=google.com; s=arc-20160816; b=UzotmyFCFRoG/+Cd6o2h0Qyw0Rhdc+1pkZwoMEzxovx6SxO4mgxCgCV1InjE18vZtf loapDA0EVUobabHjYgwi3gIVdXlzCApyLN07B7879rCzGZCJPepQhptTE1o2cMKn1oB3 2q+VhIoiGGON5A4rjRUAbT2nRoBNTVSVsOYFHgJUkVhv+kWVReIF2ZbgiRy0PFhP0Fwd dO8ZUAIlRQgOXoe2VuPZNoHBWlp7CWL6AaYGlce1sJvKO6FZy/bfyMM40+7gAYs95N9M sPwu3SavZed9rzdnCzEI/+10l80FbKeq5wpnUha1sRSwfgT46ioTHbUMKrH1LtMssxg+ EU3Q== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z03jhkM5FKCSytBVpDf3SoLlQk6jxAYhSPYM141uH90=; b=T9Ur4WavA5JwwegEtmUivMT0UuhfH/qszYSTeLHGF4lFW6YUnTfy/JMJyJxXLcchCA Tl8S5qzhE9T8Yt3TYJM+F5m2ObJPJt/xe36GaNHBk0IwoOi6zp/KDLRmjED3uESryjk7 s8a1/ckP+mBC+kk5s3AHwMslOKteny3CP/aca4aq9kK8KksYMB3E/PRmZg4rifxveO9p 8uF2WBw/VztjrLFkfuOduJCg9XbICnukDcqR1aQRJSG3snZVgFGstoxikmREaFZkYwJN N/sHI1jbbNa/gqhKvVkS6gU5jxeW0AlnJKtrGRTELmaICYjwjUhL4vRZUI5RlXDs8veJ icsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=FTPekw7l; 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 lw21si2823646ejb.724.2020.09.25.17.45.36; Fri, 25 Sep 2020 17:45:59 -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=@ziepe.ca header.s=google header.b=FTPekw7l; 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 S1729823AbgIZAlk (ORCPT + 99 others); Fri, 25 Sep 2020 20:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725208AbgIZAlj (ORCPT ); Fri, 25 Sep 2020 20:41:39 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3026C0613CE for ; Fri, 25 Sep 2020 17:41:39 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id w12so4815132qki.6 for ; Fri, 25 Sep 2020 17:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Z03jhkM5FKCSytBVpDf3SoLlQk6jxAYhSPYM141uH90=; b=FTPekw7lMtsQCdEiTyzoxRlbkw5QfkvghMrgncYfcqWss9HCGNjDu5TPKURgdy7D/g RizmwtJOAtmIQO9Dk5cAiVA1o/Z+vP5RbGJKDG76FrHiTzJnXQmlbnWkbDFs0AMi0ml0 jR1WZ+Y3Vkpa0RTGcGM9my9UNuP9EXrKWvVd1v97fKTUV66bQMFWMNEVoQciMzWauzDL uf3yfHiB0Bze+EdrIkXWEYvgA8R4DpqwsPjW8WcyZf8q8AHbix89dYta56oYhew5xIOC F7jXpOwPGYWyDw+78ISqo4uDkRvISrtAYYNwgJk6YY11jgqoFxh8QZC6bFIagIlyBldZ gtZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Z03jhkM5FKCSytBVpDf3SoLlQk6jxAYhSPYM141uH90=; b=Y0uKJscZQgbHAVbUFUfmLriPxV3rW9r1qVqweejKau2Brr3ghR3A4nE8Pz6alOXbmU /4FM9XupVEuy5dtH7hjBj3ozGzY8XEgb4HZm3ROwJTgeA3ly+JjiQIGZhsSFnjcO3Uci VdCdsq1ViE3lHoFtq7Qnl0BvfP5CzFhGQJy0OugJpWFliudYLnYrFxAc72hDNH0Bi4tP riojWfL52d2zn6wAHfInknQXf/g9pilB7XDfjO7pBwTYGbVWnpUZVaAArtV9Xq2U9Sf9 mQEuCBPEvcQTItkNInHUNwI2eX2bsS8PVST+uTOb75JsYi4cZcSAE01NnYPbgm2BuN1X VX8w== X-Gm-Message-State: AOAM533Cp/604cjoWbtHFDDS78ewCS+KIUQlf4DAFDzqP+yBM195m5VH z8bF4ZmhWAqirRsPxK9qwEi+qw== X-Received: by 2002:a37:9f07:: with SMTP id i7mr2632006qke.440.1601080898519; Fri, 25 Sep 2020 17:41:38 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id t10sm2868220qkt.55.2020.09.25.17.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 17:41:37 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kLyHQ-001DeG-L7; Fri, 25 Sep 2020 21:41:36 -0300 Date: Fri, 25 Sep 2020 21:41:36 -0300 From: Jason Gunthorpe To: Linus Torvalds Cc: 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 , Leon Romanovsky , Jann Horn Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned Message-ID: <20200926004136.GJ9916@ziepe.ca> References: <20200923170759.GA9916@ziepe.ca> <20200924143517.GD79898@xz-x1> <20200924165152.GE9916@ziepe.ca> <20200924175531.GH79898@xz-x1> <20200924181501.GF9916@ziepe.ca> <20200924183418.GJ79898@xz-x1> <20200924183953.GG9916@ziepe.ca> <20200924213010.GL79898@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 02:06:59PM -0700, Linus Torvalds wrote: > On Fri, Sep 25, 2020 at 12:56 PM Linus Torvalds > wrote: > > > > And honestly, since this is all getting fairly late in the rc, and it > > took longer than I thought, I think we should do the GFP_ATOMIC > > approach for now - not great, but since it only triggers for this case > > that really should never happen anyway, I think it's probably the best > > thing for 5.9, and we can improve on things later. > > I'm not super-happy with this patch, but I'm throwing it out anyway, in case > > (a) somebody can test it - I don't have any test cases It looks like it will work and resolve the RDMA case that triggered this discussion. I will send it to our testers, should hear back around Monday. They previously said Peter's v1 patch worked, expecting the same here, unless something unexpected hits the extra pre-conditions. Though, we might hit the THP case and find it fails... > (b) somebody can find issues and improve on it The THP hunks from Peter's series looked pretty straightforward, I'd include at least the PMD one. As a tiny optimization, the preconditions in copy_normal_page() could order the atomics last to try and reduce the atomics done per fork. > I'm happy to take Peter's series too, this is more of an alternative > simplified version to keep the discussion going. I don't completely grok the consequences of the anon_vma check. We can exclude file backed mappings as they are broken for pinning anyhow, so what is left that could be MAP_PRIVATE of a non-anon_vma? Feels obscure, probably OK. If something does break userspace could use MAP_SHARED and be fixed. Otherwise, I do prefer Peter's version because of the GFP_KERNEL. To touch on your other email.. It was my hope we could move away from the "This should never happen". From a RDMA POV this idea was sort of managable years ago, but now I have folks writing data science/ML software in Python that deep under the libraries use RDMA and has pinned pages. It was a Python program that detected this regression. Having all that "just work" regardless of what foolish stuff happens in the Python layer is very appealing. Jason