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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C2A4FC56201 for ; Sun, 22 Nov 2020 19:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7811A2076C for ; Sun, 22 Nov 2020 19:01:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="AbOOghMs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728122AbgKVTBI (ORCPT ); Sun, 22 Nov 2020 14:01:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727888AbgKVTBI (ORCPT ); Sun, 22 Nov 2020 14:01:08 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34539C0613CF; Sun, 22 Nov 2020 11:01:08 -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=fGB9UccTdY0+D9VrR+d9ZW2mq8OJlKvYmZDecnPFxFs=; b=AbOOghMsKGuO/MimYt9TzwXc4y D23Vjq5RKRH7z0hC2d0YiVo4+BtOyeafryfipLTaUSInSm0xQpwA+pupmeVKDRHWf2qAnx91ujj5B V7QZBceXHD6YFltefPvOlHokjWTpFNz/n3LHoCAprVzHCcL7m6ZoNEddAfsSYodQ6D+B3PUAnBO2e WAhzAxVjN8yWBek4xAdssdfNAhpIswRu7waHRguasAtXt8sp0DlYZmbpfCv67aOrd51KtCrCja35v RIdncxCIelYPqPGJ450JC3Zpnm3AO6Xoh7FCo5ikHh9guWBFbGvz7t79sGBVgSLe95XxBPlQlYOpG OL4wnXLg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kguag-0005a7-KD; Sun, 22 Nov 2020 19:00:02 +0000 Date: Sun, 22 Nov 2020 19:00:02 +0000 From: Matthew Wilcox To: Michal Hocko Cc: Muchun Song , corbet@lwn.net, mike.kravetz@oracle.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com, osalvador@suse.de, song.bao.hua@hisilicon.com, duanxiongchun@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v5 21/21] mm/hugetlb: Disable freeing vmemmap if struct page size is not power of two Message-ID: <20201122190002.GH4327@casper.infradead.org> References: <20201120064325.34492-1-songmuchun@bytedance.com> <20201120064325.34492-22-songmuchun@bytedance.com> <20201120082552.GI3200@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201120082552.GI3200@dhcp22.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2020 at 09:25:52AM +0100, Michal Hocko wrote: > On Fri 20-11-20 14:43:25, Muchun Song wrote: > > We only can free the unused vmemmap to the buddy system when the > > size of struct page is a power of two. > > Can we actually have !power_of_2 struct pages? Yes. On x86-64, if you don't enable MEMCG, it's 56 bytes. On SPARC64, if you do enable MEMCG, it's 72 bytes. On 32-bit systems, it's anything from 32-44 bytes, depending on MEMCG, WANT_PAGE_VIRTUAL and LAST_CPUPID_NOT_IN_PAGE_FLAGS.