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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B39DC433EF for ; Tue, 19 Oct 2021 16:01:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0D44B6134F for ; Tue, 19 Oct 2021 16:01:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D44B6134F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9B2546B00A0; Tue, 19 Oct 2021 12:01:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96272940007; Tue, 19 Oct 2021 12:01:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8295A6B00A3; Tue, 19 Oct 2021 12:01:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 70CEA6B00A0 for ; Tue, 19 Oct 2021 12:01:44 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 11D4218087379 for ; Tue, 19 Oct 2021 16:01:44 +0000 (UTC) X-FDA: 78713652528.27.265B8A7 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by imf26.hostedemail.com (Postfix) with ESMTP id 6FC7020019F3 for ; Tue, 19 Oct 2021 16:01:39 +0000 (UTC) Received: by mail-qv1-f43.google.com with SMTP id d20so242822qvm.8 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=MDuuc0+JizigU7go/YetQ86S/tM143Ppm1PbRjtIl/rrOGPcMsJ8RFYoSB5PQRus33 y4NgQM7sxFhGVGNqc/Fzt02MvfcpgRlB7Nriv1+V+M1HkreUIVwU2yFvudt3mF8nHSl7 BElTRDkoUmvkF1wdVW+8798e+YQDuqXw/9JiNXa3CpnvVddBhFQyJo70Jrp/hE6FipPO MLky+czxHess4j8lp7ozK7CMeTkZfzAQVnxTd+8UHV16eWnh2fOZOwmZe2870rU9Exv+ kYioBdn7bWRk/MCxidM7sfN6AzomziZlVpNaGd/PJUBNciPbMsHOI9Sr+EmOP44K8OHF NwTg== X-Gm-Message-State: AOAM5302IFGhtU9Pk7gYvsklRUmiFVEE7AQcWRhwrMRYG5bgapAL+Pc2 M+9pHbOHGAnE+7nOVMyTND4I4g== X-Google-Smtp-Source: ABdhPJwvk+8tFb6J3QISFF+F14Y7KiyXAV1U8RUSPAMtZ9qpPCQT16Z2pmMVxiVutxUbz+C+YTG/ZA== 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> X-Rspamd-Queue-Id: 6FC7020019F3 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=ziepe.ca header.s=google header.b=D3VIbh9t; spf=pass (imf26.hostedemail.com: domain of jgg@ziepe.ca designates 209.85.219.43 as permitted sender) smtp.mailfrom=jgg@ziepe.ca; dmarc=none X-Stat-Signature: 44eii44d4fmnf7sd6kcd9o4idnzgmz7f X-Rspamd-Server: rspam05 X-HE-Tag: 1634659299-464855 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 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