Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp593830pxb; Tue, 19 Oct 2021 09:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi+cjMOwYWC+QJyi9US4kB7FhfRGzbyB6lSY1QoLAnDxW5DQXkMAj3lGapgkRyPkZCWkGC X-Received: by 2002:a2e:3005:: with SMTP id w5mr7408132ljw.228.1634659349943; Tue, 19 Oct 2021 09:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634659349; cv=none; d=google.com; s=arc-20160816; b=eVqJnthbZD9Jql3Tybu6SgGRK/EH1DVT67iU35EMVHFbgAP3IJpoxzzYNAyhQYirGX 4TWKJq9W5VEzPQ0Or7kQcWPyXFCEucx7xpVRDfV/SO0pomm7NkWP1C5mZiZZVkLBShhU ZUjLpPq4b0QGVqd3vxOgIuqD8vJDndLzUS4pJenYYy3tD89jwr3K86PcQNTb7hk0Bxdr /7qos5xSnSnr8jq9Up+M3GVG3H2le6Fj0+GWtrGQVlyUfvt/VfI09a9LYyDYIG0B5wgm qDmNn9ubWfYl6duY+ZOkehJ7MOwHWvyN7St0L1gvPvPLoI8p7zLJpCvygGJJo9DxnuPi 3kbw== 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=3BGJn1dXdpzUd3tv3q+EmhfGtbVhe0Qd67sISQeDnw4=; b=ZJdclKQrOiUoGiKs5HHxy0kqHfHRHVcFahoZXNJ9CVxIi8nRuMEIibZS5Z4RpbDlAc B803Yj876IaId3dbuiqq7wHmSAMVOrd4k1R1PeT0oJca2NUc6dt7gQWcvcMzHtqu1H9e yv84j+I7u+DTJ4r8P3ZXDDprIuHXjKYFIQnm+/Je2fEmC4XaN6f7yWdq9pIl5GLQpjia mpq/11fVZuQbMIJTh6FeIzR+F8OvmyXRXMjWDQ4tVMvizuhEHZq10O1qU9WcJ1QUdbaz ulAifpKTpJhlv6SHVafzQ3m+y6pbecGMIq+Bzyp9T+Fzcuno7hyXjtXOTS0dVrFGLUqy p1nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=D3VIbh9t; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 sg20si13541712ejc.607.2021.10.19.09.01.57; Tue, 19 Oct 2021 09:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=D3VIbh9t; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233499AbhJSQDw (ORCPT + 99 others); Tue, 19 Oct 2021 12:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233052AbhJSQDv (ORCPT ); Tue, 19 Oct 2021 12:03:51 -0400 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A220C06161C for ; Tue, 19 Oct 2021 09:01:38 -0700 (PDT) Received: by mail-qv1-xf29.google.com with SMTP id k29so248578qve.6 for ; Tue, 19 Oct 2021 09:01:38 -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=3BGJn1dXdpzUd3tv3q+EmhfGtbVhe0Qd67sISQeDnw4=; b=D3VIbh9ttclotZ84lKsDn3X7RfkFlngL41uIfucxHeTNtiYydE1whz/r7jFojWxJzr IwRCHVsSlqyCKuylJCeriD2Qefn+j1/fvnIlM3d65YZUJrz7ZL7fl9tLcXBW9mYUvhqy 5xpDPE/RU9PMih7sDjXvMU0edSmFgIV+++/zaNE2J4zW5uztqyyYAkJzV/1C4A3U+gyW U6b9VBKLc/Ca1IxjKLG5lhBNp9XrN8Hu+qrhLy38rNdpoUl7KOZ4xReT8hcKkCZ0/Hu/ Yc6EMXS7JJJ0dd4WHusGYr40To/zWTF7J1Xh5LlZnFmkNu7G/b+P57DnWMN0taZYehmd AKkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3BGJn1dXdpzUd3tv3q+EmhfGtbVhe0Qd67sISQeDnw4=; b=WXZ7oWZnXnTUvOuI+68NR3X2mLkbE4dWv5Ms5Ql0QKgbmwCQOCSdGKOlF6tNnqE40F 5CrP1xiBUhr1C0yAOOUNso4aJCdT8Ifclb7ZbXjXab0kSD5yPdzJdqmlYHgzyAJTQAOy Sxa/MLDlrXvzTgOEuyjfZQGYx2AejizZlgOsoInH/ePETSIVwp/2K4uDhCVoa8GcE9Vm Yum5jiW5g1RNk0rvtNk0sbfzz7B81s2Nh/Fw4CCD4tvU1AHWIK2t+avXKB+OSKamAVQD TTyHWISactUgR7Wsz70OSqOmn8HJKXrdlCkSKAJ96goo7ptGezyGltmQbVLT11udCWO8 eO3g== X-Gm-Message-State: AOAM533upR92VCichv6X6sWWydTXmv+osj/8hZhE1a5XHVvg6FEJ7GpK 84/XVDafK+zgUFVFX09n76vIMw== X-Received: by 2002:ad4:4725:: with SMTP id l5mr651407qvz.3.1634659297591; Tue, 19 Oct 2021 09:01:37 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id d6sm8054384qkj.11.2021.10.19.09.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 09:01:37 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mcrYW-00GjRc-GQ; Tue, 19 Oct 2021 13:01:36 -0300 Date: Tue, 19 Oct 2021 13:01:36 -0300 From: Jason Gunthorpe To: Joao Martins Cc: Dan Williams , Matthew Wilcox , Alex Sierra , Andrew Morton , "Kuehling, Felix" , Linux MM , Ralph Campbell , linux-ext4 , linux-xfs , amd-gfx list , Maling list - DRI developers , Christoph Hellwig , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Alistair Popple , Vishal Verma , Dave Jiang , Linux NVDIMM , David Hildenbrand Subject: Re: [PATCH v1 2/2] mm: remove extra ZONE_DEVICE struct page refcount Message-ID: <20211019160136.GH3686969@ziepe.ca> References: <20211014230606.GZ2744544@nvidia.com> <20211016154450.GJ2744544@nvidia.com> <20211018182559.GC3686969@ziepe.ca> <20211018230614.GF3686969@ziepe.ca> <499043a0-b3d8-7a42-4aee-84b81f5b633f@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <499043a0-b3d8-7a42-4aee-84b81f5b633f@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Oct 19, 2021 at 04:13:34PM +0100, Joao Martins wrote: > On 10/19/21 00:06, Jason Gunthorpe wrote: > > On Mon, Oct 18, 2021 at 12:37:30PM -0700, Dan Williams wrote: > > > >>> device-dax uses PUD, along with TTM, they are the only places. I'm not > >>> sure TTM is a real place though. > >> > >> I was setting device-dax aside because it can use Joao's changes to > >> get compound-page support. > > > > Ideally, but that ideas in that patch series have been floating around > > for a long time now.. > > > The current status of the series misses a Rb on patches 6,7,10,12-14. > Well, patch 8 too should now drop its tag, considering the latest > discussion. > > If it helps moving things forward I could split my series further into: > > 1) the compound page introduction (patches 1-7) of my aforementioned series > 2) vmemmap deduplication for memory gains (patches 9-14) > 3) gup improvements (patch 8 and gup-slow improvements) I would split it, yes.. I think we can see a general consensus that making compound_head/etc work consistently with how THP uses it will provide value and opportunity for optimization going forward. > Whats the benefit between preventing longterm at start > versus only after mounting the filesystem? Or is the intended future purpose > to pass more context into an holder potential future callback e.g. nack longterm > pins on a page basis? I understood Dan's remark that the device-dax path allows FOLL_LONGTERM and the FSDAX path does not ? Which, IIRC, today is signaled basd on vma properties and in all cases fast-gup is denied. > Maybe we can start by at least not add any flags and just prevent > FOLL_LONGTERM on fsdax -- which I guess was the original purpose of > commit 7af75561e171 ("mm/gup: add FOLL_LONGTERM capability to GUP fast"). > This patch (which I can formally send) has a sketch of that (below scissors mark): > > https://lore.kernel.org/linux-mm/6a18179e-65f7-367d-89a9-d5162f10fef0@oracle.com/ Yes, basically, whatever test we want for 'deny fast gup foll longterm' is fine. Personally I'd like to see us move toward a set of flag specifying each special behavior and not a collection of types that imply special behaviors. Eg we have at least: - Block gup fast on foll_longterm - Capture the refcount ==1 and use the pgmap free hook (confusingly called page_is_devmap_managed()) - Always use a swap entry - page->index/mapping are used in the usual file based way? Probably more things.. Jason