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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBFFAC10DCE for ; Fri, 8 Dec 2023 11:38:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51E1D6B0080; Fri, 8 Dec 2023 06:38:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CE256B0081; Fri, 8 Dec 2023 06:38:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BCBE6B0082; Fri, 8 Dec 2023 06:38:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2C37E6B0080 for ; Fri, 8 Dec 2023 06:38:43 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F06DDA1082 for ; Fri, 8 Dec 2023 11:38:42 +0000 (UTC) X-FDA: 81543453684.21.FA26AE4 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf26.hostedemail.com (Postfix) with ESMTP id 011FB14001C for ; Fri, 8 Dec 2023 11:38:40 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702035521; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yPcOLI5DPz3MKPgo+8Hg4FeaGP30/hFDhzRY3nRNyw8=; b=TgN1Q51nlnSRrcEDqzQ75qjm8N5nEkpaKEryEZVaNiYKtPj3kSx5wJ2/2O5hcaAqjGUxv1 nf+R2d7E6xLq6BDTsS7+7fGDnmaVS/etuymGNWwXQX8ikcaHTdCNIc7iwb/ny0OyYcPCvf JpjvO+atHGTywQnCH1ce7ICMHyCGEaU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702035521; a=rsa-sha256; cv=none; b=n08BkULAtT0p31mrxZyLyBFnpQhsdZIBSJZhwi+6SToA3s3gyScFuH0oJVq7Ox6P32bGIR l2NOMVI0rwdc+0VLMSUSig7wNxxN5i7F3bkGMLabjrkSCmukmcensYiPpVEEMqVjSZ5kx3 LwjfrErlBN1ksOaLzYIQifbut0Gfm7k= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92DA71063; Fri, 8 Dec 2023 03:39:25 -0800 (PST) Received: from [10.57.73.30] (unknown [10.57.73.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E7B753F762; Fri, 8 Dec 2023 03:38:37 -0800 (PST) Message-ID: Date: Fri, 8 Dec 2023 11:38:36 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 00/39] mm/rmap: interface overhaul To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , "Matthew Wilcox (Oracle)" , Hugh Dickins , Yin Fengwei , Mike Kravetz , Muchun Song , Peter Xu References: <20231204142146.91437-1-david@redhat.com> <993ea322-8cdb-4ab1-84d3-0a1cb40049c9@arm.com> <067753e4-faf0-4bc0-9703-ec97b7de705e@redhat.com> <1ba5dd86-a201-4243-bab0-349395468236@arm.com> <537ac106-e4f6-4845-aa09-29b775269562@redhat.com> Content-Language: en-GB From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 011FB14001C X-Rspam-User: X-Stat-Signature: h889pfiyrt97tsopex88dnk59cbxaned X-Rspamd-Server: rspam03 X-HE-Tag: 1702035520-856139 X-HE-Meta: U2FsdGVkX1+0AS8Ft4zegHpp6jfD5H6cbrmthDYadf36eFDGcsfduPp2LcU8pZtzsIO++xuHDyz2Hc/FQlDU0p3RLUoZQ2wthJ92u2iluDEac8Veb/a+VuA7tb4b/ZQ+d0ByECH0XiIgF6TUMb9M4TXLmQvPsjZXKxPmgBC3SsMF4nMvuB4UYC1HYimcXbU+miNbizRwAhsDnvFX0yyMayAUQYgGP+VlUbI1Pn6Q2Qy6Z1rm4bJqc3JnFBTECmBgqlhlrleN9sditx8+he02g1xXcJF1tdyLGQOZtZDHIVcqRr06NRfoqt00i2uv9sooK0GBGM9Z/QqMFRNXq78435pfO48tlBoUCHXSWyDoPoOBgxOGVC5KWBXcY8/zUJfkTYFhDRaAvblVo22JgpjCp5931OnDfAs057dsJmnALeTpvV0fUvOQzn8VnBM41Tm0o1KmkmSC+eoMDwLXJ9Iaww0ssFaTY3WO6TqclfxouB+OGgnisbxmhfNkG93g+g4GsuavJXH5mZpYPesqBaifqTzKb7bVuUvcIUpsRwyks55FYJv75gr+6GmlOZEHzcCe0Ndqr1sPmCngrN4U219dhANDBk5LExsO1/mTr6l3TYx7VvA5PkTqSqtvseEZD7BWGALWuoZslJSAjsjj1OHB1odiMIPm7yuYv8UqjPrUJohekVZ0rwsSIMIHacxqjgwlLAEdwgavI9ntLejZe1KvnrOQY5zq9k7U1WI8j10SJg8aeIUZewRZcCd0SXZmG+ChusZF4dZjuEHFR7qExPhX6BwJbdtWSboK4OKSmdwOlIUZAygIdNygP6nIFt1d6zVUHvB8J5XL/fI78/bDaMv1EKDC2prn2/BjJeuyEdKt3VGwhlRWjK+KvkbPCfvh0oDbNI2g3+14jzTrr3dmexDUbzdhsGzYXdtLaXEpPyj2D2vMnBwXPbLt2aeOGjUVhbSnlAO6ovXTkH6gWsl2FiN 4GTF28gt umR1nQHwIJ8BUVYvdDQfzRYBYKzNl/9H+MPbd/TyJ5AbyN8hxpSuGHxBmsIGwSUfLrwCQ3jbB3HOnHO/dCWvTizQaVOzxFQtxMSw5w0I/K5SqSHd/mBBsuQ+iq/1kQ0jwjRqYz7cn0v9Pq7X0pE/AKIHbcQ== 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: List-Subscribe: List-Unsubscribe: On 08/12/2023 11:24, David Hildenbrand wrote: > On 05.12.23 14:49, Ryan Roberts wrote: >> On 05/12/2023 13:39, David Hildenbrand wrote: >>> On 05.12.23 14:31, Ryan Roberts wrote: >>>> On 05/12/2023 09:56, David Hildenbrand wrote: >>>>>>> >>>>>>> Ryan has series where we would make use of folio_remove_rmap_ptes() [1] >>>>>>> -- he carries his own batching variant right now -- and >>>>>>> folio_try_dup_anon_rmap_ptes()/folio_dup_file_rmap_ptes() [2]. >>>>>> >>>>>> Note that the contpte series at [2] has a new patch in v3 (patch 2), which >>>>>> could >>>>>> benefit from folio_remove_rmap_ptes() or equivalent. My plan was to revive >>>>>> [1] >>>>>> on top of [2] once it is merged. >>>>>> >>>>>>> >>>>>>> There is some overlap with both series (and some other work, like >>>>>>> multi-size THP [3]), so that will need some coordination, and likely a >>>>>>> stepwise inclusion. >>>>>> >>>>>> Selfishly, I'd really like to get my stuff merged as soon as there is no >>>>>> technical reason not to. I'd prefer not to add this as a dependency if we can >>>>>> help it. >>>>> >>>>> It's easy to rework either series on top of each other. The mTHP series has >>>>> highest priority, >>>>> no question, that will go in first. >>>> >>>> Music to my ears! It would be great to either get a reviewed-by or feedback on >>>> why not, for the key 2 patches in that series (3 & 4) and also your opinion on >>>> whether we need to wait for compaction to land (see cover letter). It would be >>>> great to get this into linux-next ASAP IMHO. >>> >>> On it :) >>> >>>> >>>>> >>>>> Regarding the contpte, I think it needs more work. Especially, as raised, >>>>> to not >>>>> degrade >>>>> order-0 performance. Maybe we won't make the next merge window (and you >>>>> already >>>>> predicated >>>>> that in some cover letter :P ). Let's see. >>>> >>>> Yeah that's ok. I'll do the work to fix the order-0 perf. And also do the same >>>> for patch 2 in that series - would also be really helpful if you had a >>>> chance to >>>> look at patch 2 - its new for v3. >>> >>> I only skimmed over it, but it seems to go into the direction we'll need. >>> Keeping order-0 performance unharmed should have highest priority. Hopefully my >>> microbenchmarks are helpful. >> >> Yes absolutely - are you able to share them?? >> >>> >>>> >>>>> >>>>> But again, the conflicts are all trivial, so I'll happily rebase on top of >>>>> whatever is >>>>> in mm-unstable. Or move the relevant rework to the front so you can just carry >>>>> them/base on them. (the batched variants for dup do make the contpte code much >>>>> easier) >>>> >>>> So perhaps we should aim for mTHP, then this, then contpte last, benefiting >>>> from >>>> the batching. >>> >>> Yeah. And again, I don't care too much if I have to rebase on top of your work >>> if this here takes longer. It's all a fairly trivial conversion. >>> >>>>> >>>>> [...] >>>>> >>>>>>> >>>>>>> >>>>>>> New (extended) hugetlb interface that operate on entire folio: >>>>>>>     * hugetlb_add_new_anon_rmap() -> Already existed >>>>>>>     * hugetlb_add_anon_rmap() -> Already existed >>>>>>>     * hugetlb_try_dup_anon_rmap() >>>>>>>     * hugetlb_try_share_anon_rmap() >>>>>>>     * hugetlb_add_file_rmap() >>>>>>>     * hugetlb_remove_rmap() >>>>>>> >>>>>>> New "ordinary" interface for small folios / THP:: >>>>>>>     * folio_add_new_anon_rmap() -> Already existed >>>>>>>     * folio_add_anon_rmap_[pte|ptes|pmd]() >>>>>>>     * folio_try_dup_anon_rmap_[pte|ptes|pmd]() >>>>>>>     * folio_try_share_anon_rmap_[pte|pmd]() >>>>>>>     * folio_add_file_rmap_[pte|ptes|pmd]() >>>>>>>     * folio_dup_file_rmap_[pte|ptes|pmd]() >>>>>>>     * folio_remove_rmap_[pte|ptes|pmd]() >>>>>> >>>>>> I'm not sure if there are official guidelines, but personally if we are >>>>>> reworking the API, I'd take the opportunity to move "rmap" to the front of >>>>>> the >>>>>> name, rather than having it burried in the middle as it is for some of these: >>>>>> >>>>>> rmap_hugetlb_*() >>>>>> >>>>>> rmap_folio_*() >>>>> >>>>> No strong opinion. But we might want slightly different names then. For >>>>> example, >>>>> it's "bio_add_folio" and not "bio_folio_add": >>>>> >>>>> >>>>> rmap_add_new_anon_hugetlb() >>>>> rmap_add_anon_hugetlb() >>>>> ... >>>>> rmap_remove_hugetlb() >>>>> >>>>> >>>>> rmap_add_new_anon_folio() >>>>> rmap_add_anon_folio_[pte|ptes|pmd]() >>>>> ... >>>>> rmap_dup_file_folio_[pte|ptes|pmd]() >>>>> rmap_remove_folio_[pte|ptes|pmd]() >>>>> >>>>> Thoughts? >>>> >>>> Having now reviewed your series, I have a less strong opinion, perhaps it's >>>> actually best with your original names; "folio" is actually the subject after >>>> all; it's the thing being operated on. > > So far I sticked to the original names used in this RFC. I'm testing a new > series that is based on current mm/unstable (especially, mTHP) and contains all > changes discussed here. > > If I don't here anything else, I'll send that out as v1 on Monday. Get's my vote! > > Thanks! >