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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAE43C2D0E4 for ; Tue, 17 Nov 2020 21:23:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E341A24248 for ; Tue, 17 Nov 2020 21:23:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vzOxukK9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E341A24248 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 090CC6B0036; Tue, 17 Nov 2020 16:23:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0400A6B005C; Tue, 17 Nov 2020 16:23:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E73676B0068; Tue, 17 Nov 2020 16:23:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id BB2126B0036 for ; Tue, 17 Nov 2020 16:23:02 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 53881824999B for ; Tue, 17 Nov 2020 21:23:02 +0000 (UTC) X-FDA: 77495185404.22.face29_3f09bb627334 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 2F32518038E67 for ; Tue, 17 Nov 2020 21:23:02 +0000 (UTC) X-HE-Tag: face29_3f09bb627334 X-Filterd-Recvd-Size: 3806 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Nov 2020 21:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8Le6nenVdfqug4GtB+TuVFFmGAO2UeQg8aKMVmpcDyQ=; b=vzOxukK9yDaGfyVYUmioAz5KU0 MIcMpKA70ufQ7Gjat7Zm3T8FPDQU3BEmO8kyrTbBFe22r/dxfkMhgG0UK68dsUpNx3ISfu5ffBg+i J764GpsRUjtb5zmFjAE0xteJeP/fGCEUx/5yEx8PhZJ7bVRDBThuxJhW0GCCuSLb6GpNVEpDHkId3 jcEzwjrNvoAgPrtf5g1SFXsqpiyigeQyFjBYCoyputpzR3zVH79ekkbAoUHKZn/2uMC52ndo+lX3X CPuQsNI5X180Q0x8iagaKdG3sd8Xth3L403wZg+tIAyA7jCK/Biw9GSELCV31CaCyxYa2u9QtFNH8 l7w8rMzg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf8RD-0004N9-Ox; Tue, 17 Nov 2020 21:22:55 +0000 Date: Tue, 17 Nov 2020 21:22:55 +0000 From: Matthew Wilcox To: Zi Yan Cc: Roman Gushchin , linux-mm@kvack.org, "Kirill A . Shutemov" , Andrew Morton , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Yang Shi , Michal Hocko , John Hubbard , Ralph Campbell , David Nellans Subject: Re: [RFC PATCH 3/6] mm: page_owner: add support for splitting to any order in split page_owner. Message-ID: <20201117212255.GZ29991@casper.infradead.org> References: <20201111204008.21332-1-zi.yan@sent.com> <20201111204008.21332-4-zi.yan@sent.com> <20201114001505.GA3047204@carbon.dhcp.thefacebook.com> <20201114013801.GA3069806@carbon.dhcp.thefacebook.com> <20201117210532.GX29991@casper.infradead.org> <3E32BC50-700F-471E-89FD-35414610B84E@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E32BC50-700F-471E-89FD-35414610B84E@nvidia.com> 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, Nov 17, 2020 at 04:12:03PM -0500, Zi Yan wrote: > On 17 Nov 2020, at 16:05, Matthew Wilcox wrote: > > > On Fri, Nov 13, 2020 at 05:38:01PM -0800, Roman Gushchin wrote: > >> On Fri, Nov 13, 2020 at 08:08:58PM -0500, Zi Yan wrote: > >>> Matthew recently converted split_page_owner to take nr instead of order.[1] > >>> But I am not > >>> sure why, since it seems to me that two call sites (__split_huge_page in > >>> mm/huge_memory.c and split_page in mm/page_alloc.c) can pass the order > >>> information. > >> > >> Yeah, I'm not sure why too. Maybe Matthew has some input here? > >> You can also pass new_nr, but IMO orders look so much better here. > > > > If only I'd written that information in the changelog ... oh wait, I did! > > > > mm/page_owner: change split_page_owner to take a count > > > > The implementation of split_page_owner() prefers a count rather than the > > old order of the page. When we support a variable size THP, we won't > > have the order at this point, but we will have the number of pages. > > So change the interface to what the caller and callee would prefer. > > There are two callers, split_page in mm/page_alloc.c and __split_huge_page in > mm/huge_memory.c. The former has the page order. The latter has the page order > information before __split_huge_page_tail is called, so we can do > old_order = thp_order(head) instead of nr = thp_nr_page(head) and use old_order. > What am I missing there? Sure, we could also do that. But what I wrote was true at the time I wrote it.