Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4177459pxb; Tue, 17 Nov 2020 13:28:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJydE2mCoX41FocdUOmEZ0nJtYAc2cVoDMLTz413962n1e1jsnJUHTxrmS5R4Zg/oG/6xbR4 X-Received: by 2002:a17:906:c312:: with SMTP id s18mr20842994ejz.185.1605648501849; Tue, 17 Nov 2020 13:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605648501; cv=none; d=google.com; s=arc-20160816; b=x9z4LM1NCJTKdaPPBm46twyXlanQizp5K4mcQ8flVhwo/Lryden5mWKjMU4YawHrhv aBiwZ+VhoOW4eRAErjN9eY1HKgtBv2EkdB8RknX35Mipu8AYZrRIjm6SRZ+0TQRRiKit 2VEfJ+7Mua3jgivXx4Yb71Bzl9QXzuxPuehQxv1ZlqCzegzzPgWXUWBLSr6RS2Hc8vnT 6HYmWVYf9AvHRaAsRTUijk/9d8jSHngAu73ZKIWsI8c2iZZJlse0VgBPUkyjfhnFvtaw IJWM2MCm/sWL8Sy5zaDtwygBeICsjDLmrZQhZQNN9L4+1Z/XPvvKDFKuwdIiwiZEBZsw rQBg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8Le6nenVdfqug4GtB+TuVFFmGAO2UeQg8aKMVmpcDyQ=; b=vocDoFqF3BT9wB7IiZzOq3HbPbLvcZJJyYBYfXYC43GG5YW+WAlzvF6nn5ETiHiHuv r0/IptkENaOe2Tug70z+0xjumSrg2FeA15C7VPuJFeihoVAfWqA5loNeLGeY39gdgnMl J7WSpgsK2eLDY9WQA0iI9FDwxvUQKeW9G1RG6C+EYhcIE5QIXNdOi94g217XqI/Ekexy e82+2Tt0BCWbKcSVkMUVDIbj/UgNHZMckQnGPTPDzMq431g2cgcKxk8KdJMYVroNdFdp tr6uUUq6Vm9m27gkwCiTGL4vc3O8ollr28xXPWqPeNRK+Zlj7Lv1kSfxkx4B4+KaC54w 1elw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vzOxukK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd12si14063284edb.382.2020.11.17.13.27.58; Tue, 17 Nov 2020 13:28:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vzOxukK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727761AbgKQVXG (ORCPT + 99 others); Tue, 17 Nov 2020 16:23:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbgKQVXE (ORCPT ); Tue, 17 Nov 2020 16:23:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 369B3C0613CF; Tue, 17 Nov 2020 13:23:04 -0800 (PST) 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.