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,URIBL_BLOCKED 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 1A85EC4727C for ; Sat, 26 Sep 2020 00:41:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 870AB2076D for ; Sat, 26 Sep 2020 00:41:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="FTPekw7l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 870AB2076D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AD2EF6B005C; Fri, 25 Sep 2020 20:41:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A83968E0001; Fri, 25 Sep 2020 20:41:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 971C16B0068; Fri, 25 Sep 2020 20:41:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 7E8E16B005C for ; Fri, 25 Sep 2020 20:41:40 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 34BEE180AD801 for ; Sat, 26 Sep 2020 00:41:40 +0000 (UTC) X-FDA: 77303359560.22.trick27_0a0f4cd2716c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 0B30318038E60 for ; Sat, 26 Sep 2020 00:41:40 +0000 (UTC) X-HE-Tag: trick27_0a0f4cd2716c X-Filterd-Recvd-Size: 6198 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Sat, 26 Sep 2020 00:41:39 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id n133so4771364qkn.11 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=Ej/VZP6vOyLL/GBzGp15j4RFMAtdYMWQdyrusJSGtVAmS3P3vaeKAE6GdV+ZbUOG6k DIkbr04PY0VpK0JuXJDEuxrZdDsfuLdP5nkWSl5NANnV7ZsYdhmQBvt4uOd2aBklCCGC AUMLfw+SVZZQ2gbB0xuWaodw3KtRZIiCZx1NFaLQ5RKOZ3n6Ew+JT4uWVv2/X4Jh0gRe tlUBA5TY1GfOSW0cHRnTyDz4vZLXV4t+5D796dYJMXJpn+Bhkh0NJB2MOnkCaC5prIsa xbX6RuQklwuUuX5uA1RXioiUHMYzuUPoE2By7a2FoClU2FTh42I0o2fizdcP81YkEFLN LHGA== X-Gm-Message-State: AOAM530EXvZxjvddlCvf66A57/7Gh791YXaPbXdYHjgg3NRPaK+HI449 qMnTvi5Sy6Z9i1yq5zdYyFO/gw== X-Google-Smtp-Source: ABdhPJzezC9vwnwQ2IkSDwPBL44Lz64ZH+hLN4/gvamgv6OT5N1b1qb0I/1kjNXvldA5bLCpTp1QAg== 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: 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 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