Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2047428rwb; Thu, 27 Jul 2023 00:51:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8utz7pQTNzUJWe2Anly4F/TRLPiQD5OmFRDZKdO+YVHiC7BHhRXO17GK87YtAIuuvfpE5 X-Received: by 2002:ac2:488d:0:b0:4f9:cd02:4aec with SMTP id x13-20020ac2488d000000b004f9cd024aecmr1029413lfc.29.1690444314824; Thu, 27 Jul 2023 00:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690444314; cv=none; d=google.com; s=arc-20160816; b=Y2ruW8j+Fkc0vveFn/z+ax/TLxAELEVCoh4qUEQbpbDKUEB+4n80OoJkbwkwy707rR MiRvsFyikL6+V4+OGwr/G9g3h93OlsiPqW71wExsx21tngyaFkpwa6k0Oa4E7uU9HYIY jysKDuLFZ5WaKkzqGYljYUxfsGcbEOmTHZiA2CmyNIdWD0VL6oJdPI+3VIDzP9dY/uQv Ee4VYahEpND2/XpPKd6RLASsLfchP9EmbrhpMuiv8eQHHSmOTteyYgykpj7NWEMHvrEi b4UjFfkyPPpZ0foluL0IM+JJkTNIUgLnFto4Rofya+fmpx0Ud18g67sfxe80lKmPFPxt /nAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=EYZXC01U+v3pKY+IU2N058KWBcAKvVO2g7rE1nWCXdY=; fh=urgBJQN0DVsMEmHQH4eHisfDKMAzEzk1Gu5YDQyvSsg=; b=aOer41j72iRMz3YUWHjaX/10WOP58FAbp2Ks6Cqjfg61/erTzCPaW0dGO/tq9ofq2G J9yy+qoWHE94j+3kAEdv/DiuHzjn25KX0Zfj+ScSyT5qPFj38aweAgkK+9oi6+nGDurh A8mys1AJ80k4KWMKZTIbgwu9lnJs4PK6C6WMTE9ClqFo6+o0zU+MDiZj7ofBUcLwCJjw zEeNrLhWhKHjfA3ds4ahoEKYx7ZzpbdIvKHg053rWB82IS54clbB6KqjqqKhPmHHi1cX IDpMfX3i+ZwUN0K/yI0HI90tl4Xl1XjiCU2vvyUQcSL0dd1kuE+GJVLqr7qdAkaA+3BV vGQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a1709064dc500b00988afd7e58asi725120ejw.350.2023.07.27.00.51.30; Thu, 27 Jul 2023 00:51:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231723AbjG0Hhn (ORCPT + 99 others); Thu, 27 Jul 2023 03:37:43 -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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.