Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3144212rdh; Thu, 28 Sep 2023 04:11:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHew7gJF82t3nBEVp379cNiVzVifm65wB8FCGcFhzZYSkzOtc+dDIqduj3oDCfwTFDoOpUB X-Received: by 2002:a17:902:ab47:b0:1c3:e2eb:f79d with SMTP id ij7-20020a170902ab4700b001c3e2ebf79dmr1200517plb.8.1695899482405; Thu, 28 Sep 2023 04:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899482; cv=none; d=google.com; s=arc-20160816; b=TTCD31pySEcETO3+FlDurEZauLydQ3NypL6Yzw4Tm2IiBQo1opyfhtLMY+0VpJzB59 LO0sRhjQOEZKTxlqtZF8pEUY4/r3DAC8B/JHqQ9g/G7i2qYbX4b7VAXgyzXmvKttA1ch rWykLyjUpy6ToRefeI0xNZy5qicg39XPOG9pHEWvd3Xh2ha3yndH4SLI+xVPcwl0qqrk mqclA+H4FDwVSIMJbZcS55rqJP2VZVgK+5SFAux3IqJr4VtKLzHggWcPqdf4zaMrXdBe rOhai6TQXlfEJAl71zXkBpOIWbRO9nJBhigEJ/42OFvkJ6hRKD8KzlrBHmSgjEd8B8Um k+Zg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SxHL38RjHe6037MBAfXCcMCF+5KiGrNA+/J/Ios0pzA=; fh=YLk39SEzSbF1dCJjIo2Ge7nbFkmkPACi/goYLPerRKw=; b=0f4YO/TxHdJgbdhX2tdF6aLuqsizibmTQKoGP4pS5DkXXBoBFnpd04Admvyh56pmyN Zr30qlwJdCA1bj43tAKf5sCK+bje9SJGOUI1NZ2JgxXFGHFxpxnyW0H6fWgVdIVElrEU Z0wWBwPaqKTudtOgaQ0yk134w4dJgHsP0FNBprgE3dSPLghXsk0oN5LzJVHxq3GZAVZJ jGS+1kn8f1AMIITf8YixbSVjzow+h/eJ5w59yw/+V98JVyS5qRc/ns8BZ8rbSnZmGuxT MHcmIIT3Qo0xNIdaxa+xm0XEgTR6H7VFEntZWtADEqjcs2hAB100HHeirMCIlgtS15SI YJQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eTwumK+n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id d63-20020a633642000000b00577f4d85fd7si17764997pga.316.2023.09.28.04.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:11:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eTwumK+n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B26F5808BCA3; Thu, 28 Sep 2023 02:05:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231460AbjI1JFq (ORCPT + 99 others); Thu, 28 Sep 2023 05:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231467AbjI1JFp (ORCPT ); Thu, 28 Sep 2023 05:05:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D66D8AC for ; Thu, 28 Sep 2023 02:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=SxHL38RjHe6037MBAfXCcMCF+5KiGrNA+/J/Ios0pzA=; b=eTwumK+nrkmGvW5jDynZsL1xPN 2DFOinky5TqWbM8vtEmOEgirgsA7o2mgW/Hxpz/8XX6uRKgu4sxP1h1d6hB7qr++O1hdozdS+HHqc 3NPN+kU4INIShMjAiKCRRPLqiyXfo0OPJFGmYbvfbLC3zNwvzJZ8wZs+p7MhmGfquR2J6XGDcNvGS pAW22hyINKXFkbSZJuoP1XPNdBgNrk+114kD9CyBiaO/bVllzXJxPxjPMQhp9qqFcR1sNFuW/lYdK Fkfj5orENzk2Uqpouabztn+kJajDS2GKTJVMB6zXTU9d0f25VT9VkRzW76rT2sZrVE09RPSpx26vy V3D6xnOA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qlmxn-001Zto-Gx; Thu, 28 Sep 2023 09:05:39 +0000 Date: Thu, 28 Sep 2023 10:05:39 +0100 From: Matthew Wilcox To: Yang Shi Cc: "Vishal Moola (Oracle)" , linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/2] mm/khugepaged: Remove compound_pagelist Message-ID: References: <20230922193639.10158-1-vishal.moola@gmail.com> <20230922193639.10158-3-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 02:05:59 -0700 (PDT) On Tue, Sep 26, 2023 at 03:07:18PM -0700, Yang Shi wrote: > On Fri, Sep 22, 2023 at 9:33 PM Vishal Moola (Oracle) > wrote: > > > > Currently, khugepaged builds a compound_pagelist while scanning, which > > is used to properly account for compound pages. We can now account > > for a compound page as a singular folio instead, so remove this list. > > > > Large folios are guaranteed to have consecutive ptes and addresses, so > > once the first pte of a large folio is found skip over the rest. > > The address space may just map a partial folio, for example, in the > extreme case the HUGE_PMD size range may have HUGE_PMD_NR folios with > mapping one subpage from each folio per PTE. So assuming the PTE > mapped folio is mapped consecutively may be wrong. How? You can do that with two VMAs, but this is limited to scanning within a single VMA. If we've COWed a large folio, we currently do so as a single page folio, and I'm not seeing any demand to change that. If we did COW as a large folio, we'd COW every page in that folio. How do we interleave two large folios in the same VMA? > Please refer to collapse_compound_extreme() in > tools/testing/selftests/mm/khugepaged.c. I agree that running that part of the test-suite would be useful, but could you point to which test specifically would create a problem here?