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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54130C001DC for ; Thu, 27 Jul 2023 07:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232233AbjG0Hhp (ORCPT ); Thu, 27 Jul 2023 03:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232816AbjG0Hh0 (ORCPT ); Thu, 27 Jul 2023 03:37:26 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E8DC3D5E6 for ; Thu, 27 Jul 2023 00:27:10 -0700 (PDT) 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 C597FD75; Thu, 27 Jul 2023 00:27:30 -0700 (PDT) Received: from [10.57.77.6] (unknown [10.57.77.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 617EF3F67D; Thu, 27 Jul 2023 00:26:46 -0700 (PDT) Message-ID: Date: Thu, 27 Jul 2023 08:26:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 2/3] mm: Implement folio_remove_rmap_range() To: Matthew Wilcox , "Huang, Ying" Cc: Yu Zhao , Andrew Morton , Yin Fengwei , David Hildenbrand , Yang Shi , Zi Yan , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20230720112955.643283-1-ryan.roberts@arm.com> <20230720112955.643283-3-ryan.roberts@arm.com> <87r0ouw39n.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/07/2023 03:35, Matthew Wilcox wrote: > On Thu, Jul 27, 2023 at 09:29:24AM +0800, Huang, Ying wrote: >> Matthew Wilcox writes: >>> I think that can make sense. Because we limit to a single page table, >>> specifying 'nr = 1 << PMD_ORDER' is the same as 'compound = true'. >>> Just make it folio, page, nr, vma. I'd actually prefer it as (vma, >>> folio, page, nr), but that isn't the convention we've had in rmap up >>> until now. >> >> IIUC, even if 'nr = 1 << PMD_ORDER', we may remove one PMD 'compound' >> mapping, or 'nr' PTE mapping. So, we will still need 'compound' (or >> some better name) as parameter. > > Oh, this is removing ... so you're concerned with the case where we've > split the PMD into PTEs, but all the PTEs are still present in a single > page table? OK, I don't have a good answer to that. Maybe that torpedoes > the whole idea; I'll think about it. This is exactly why I think the approach I've already taken is the correct one; a 'range' makes no sense when you are dealing with 'compound' pages because you are accounting the entire folio. So surely its better to reflect that by only accounting small pages in the range version of the API.