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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFDF1C433EF for ; Fri, 11 Feb 2022 08:30:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 499566B0074; Fri, 11 Feb 2022 03:30:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 449376B0075; Fri, 11 Feb 2022 03:30:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 338BA6B0078; Fri, 11 Feb 2022 03:30:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 26A946B0074 for ; Fri, 11 Feb 2022 03:30:40 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C4E928248D52 for ; Fri, 11 Feb 2022 08:30:39 +0000 (UTC) X-FDA: 79129827798.27.C50703C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id E2F9020006 for ; Fri, 11 Feb 2022 08:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644568238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1gJ72HwgwloQbyW/vwhY0YZ8ZVfHSwHBLwFkNn6x/NM=; b=g8o0LIi+BqJLdJ1c7mWksu74JWBmk4dYwsRBN4dg/ipm9Xyqs/bbR9GudwGFVIMByy/etA InjKsRGg9P1z1NFJHQuXqURuzJZtd1zgKAAtQYOe7qW7teOWkkl+O+sAlJ4mbMefhRTosV f7ZxSJqi8h1Iyt3xYfhuOpt3BSe2U8c= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-672-2jUxLYy0PIOmmlAofU36MQ-1; Fri, 11 Feb 2022 03:30:36 -0500 X-MC-Unique: 2jUxLYy0PIOmmlAofU36MQ-1 Received: by mail-wr1-f71.google.com with SMTP id w26-20020adf8bda000000b001e33dbc525cso3547933wra.18 for ; Fri, 11 Feb 2022 00:30:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=1gJ72HwgwloQbyW/vwhY0YZ8ZVfHSwHBLwFkNn6x/NM=; b=Ea9yZneVAvHWB854SZFlmhybDTrlKBdf9YMYE+1nPsOrgVmTS4zYrCLUUmCnCPErh6 3bAfwTbQmccEqsjz+2HlgDGEB2aeT8ON/hTKv0az/E7oPCiBRwacCmnXT0OPr4I6lnBF aJrW2C8LkNFKHkOmuyU0K0LloCVTJfJr/htHNmUENrO6/RO3KQiWTUuIBgkPSBiBdxlD dT/PGlX8w1UJvCmzAQliWydux3BNDQwgZRn9IXE5z58rmuskb9o9jW9pcJX+C+9tOcvx BrHSqwyDW84rqXs5SgBasoCzuW3pSl4qH4kgx/CvJf3/t1p0Pwr2qqR2WBLhIMFLXGEW t0Ng== X-Gm-Message-State: AOAM531U1kz8Sqx+0cLu91cr3Bz1YWwc3m9xlGdBB7Fb3AosGJa1axXB DIWVapKt15aQE1MCLWo/ySYuhQSERSqgC23sZrWQBZU3cXEEIrd3r50zg25wT9N1JTwvhFVmUMc tD9h8wQBfcx4= X-Received: by 2002:a5d:498d:: with SMTP id r13mr450280wrq.172.1644568235285; Fri, 11 Feb 2022 00:30:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8vYMuvWnrR/SaDvk/g57avVr1I7SWjUg2k8YoUPkdLL+cOea0MwdJ7l0z+okSZQZnKgocSg== X-Received: by 2002:a5d:498d:: with SMTP id r13mr450264wrq.172.1644568234967; Fri, 11 Feb 2022 00:30:34 -0800 (PST) Received: from ?IPV6:2003:cb:c70c:aa00:4cc6:d24a:90ae:8c1f? (p200300cbc70caa004cc6d24a90ae8c1f.dip0.t-ipconnect.de. [2003:cb:c70c:aa00:4cc6:d24a:90ae:8c1f]) by smtp.gmail.com with ESMTPSA id t187sm3356998wma.22.2022.02.11.00.30.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Feb 2022 00:30:34 -0800 (PST) Message-ID: <831ee5f6-8605-02d2-b7e5-543aec4857c3@redhat.com> Date: Fri, 11 Feb 2022 09:30:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v2] powerpc/mm: Update default hugetlb size early To: "Aneesh Kumar K.V" , linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au Cc: linux-mm@kvack.org References: <20220211065215.101767-1-aneesh.kumar@linux.ibm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220211065215.101767-1-aneesh.kumar@linux.ibm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E2F9020006 X-Stat-Signature: 3rzu8ui4j111gqcyua19h1pkdkm7g8qk X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=g8o0LIi+; spf=none (imf03.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1644568238-247873 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 11.02.22 07:52, Aneesh Kumar K.V wrote: > commit: d9c234005227 ("Do not depend on MAX_ORDER when grouping pages by mobility") > introduced pageblock_order which will be used to group pages better. > The kernel now groups pages based on the value of HPAGE_SHIFT. Hence HPAGE_SHIFT > should be set before we call set_pageblock_order. > > set_pageblock_order happens early in the boot and default hugetlb page size > should be initialized before that to compute the right pageblock_order value. > > Currently, default hugetlbe page size is set via arch_initcalls which happens > late in the boot as shown via the below callstack: > > [c000000007383b10] [c000000001289328] hugetlbpage_init+0x2b8/0x2f8 > [c000000007383bc0] [c0000000012749e4] do_one_initcall+0x14c/0x320 > [c000000007383c90] [c00000000127505c] kernel_init_freeable+0x410/0x4e8 > [c000000007383da0] [c000000000012664] kernel_init+0x30/0x15c > [c000000007383e10] [c00000000000cf14] ret_from_kernel_thread+0x5c/0x64 > > and the pageblock_order initialization is done early during the boot. > > [c0000000018bfc80] [c0000000012ae120] set_pageblock_order+0x50/0x64 > [c0000000018bfca0] [c0000000012b3d94] sparse_init+0x188/0x268 > [c0000000018bfd60] [c000000001288bfc] initmem_init+0x28c/0x328 > [c0000000018bfe50] [c00000000127b370] setup_arch+0x410/0x480 > [c0000000018bfed0] [c00000000127401c] start_kernel+0xb8/0x934 > [c0000000018bff90] [c00000000000d984] start_here_common+0x1c/0x98 > > delaying default hugetlb page size initialization implies the kernel will > initialize pageblock_order to (MAX_ORDER - 1) which is not an optimal > value for mobility grouping. IIUC we always had this issue. But it was not > a problem for hash translation mode because (MAX_ORDER - 1) is the same as > HUGETLB_PAGE_ORDER (8) in the case of hash (16MB). With radix, > HUGETLB_PAGE_ORDER will be 5 (2M size) and hence pageblock_order should be > 5 instead of 8. A related question: Can we on ppc still have pageblock_order > MAX_ORDER - 1? We have some code for that and I am not so sure if we really need that. -- Thanks, David / dhildenb