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=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 17256C433DB for ; Mon, 11 Jan 2021 10:14:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9284022283 for ; Mon, 11 Jan 2021 10:14:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9284022283 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B57696B0276; Mon, 11 Jan 2021 05:14:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B07796B0277; Mon, 11 Jan 2021 05:14:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F7BF6B0278; Mon, 11 Jan 2021 05:14:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 8A49A6B0276 for ; Mon, 11 Jan 2021 05:14:20 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 50017181AEF1A for ; Mon, 11 Jan 2021 10:14:20 +0000 (UTC) X-FDA: 77693084280.19.tax42_1a0a1822750c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 2AE1A1AD1B2 for ; Mon, 11 Jan 2021 10:14:20 +0000 (UTC) X-HE-Tag: tax42_1a0a1822750c X-Filterd-Recvd-Size: 6121 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 Jan 2021 10:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610360058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uO5kfFlNrVM4AkXN9lBvHMNTWBU2/y/d3fZj1qc3Lps=; b=SjDwXqd8P41KpdhTb+7ScgkPHHFFTUvgDpfyZPtfzqH0LR9gThjHIE2Pwf2UN1Xi82e6i7 Q0O4HNsEuSQiqgMQi5bR5puM7RyudWZZcXz3jE0/XYG6LfdsXFfKI180vsUK2qsERqj6Aq gouoNR/ddtEnl+053reDfgrClakUxKc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-a06h4cvSOvW0J5VZu1hrfQ-1; Mon, 11 Jan 2021 05:14:15 -0500 X-MC-Unique: a06h4cvSOvW0J5VZu1hrfQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80F5E803623; Mon, 11 Jan 2021 10:13:14 +0000 (UTC) Received: from [10.36.115.103] (ovpn-115-103.ams2.redhat.com [10.36.115.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14E7F19D9D; Mon, 11 Jan 2021 10:13:12 +0000 (UTC) Subject: Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug To: Anshuman Khandual , Sudarshan Rajagopalan , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <66f79b0c06602c22df4da8ff4a5c2b97c9275250.1609895500.git.sudaraja@codeaurora.org> <055b0aca-af60-12ad-cd68-e15440ade64b@arm.com> <3ae8c16d-50c4-c6cc-62b8-922cfc308c95@arm.com> <7939710a-5d03-de2b-73b2-bca472de431a@redhat.com> <5138b97e-41f7-11c3-9a28-7fb2e2f5c387@arm.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <6764cfe0-00ad-20b5-7fc8-2c7d4170751f@redhat.com> Date: Mon, 11 Jan 2021 11:13:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <5138b97e-41f7-11c3-9a28-7fb2e2f5c387@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.01.21 05:17, Anshuman Khandual wrote: > > > On 1/8/21 9:00 PM, David Hildenbrand wrote: >>> To summarize, the section size bits for each base page size config >>> should always >>> >>> a. Avoid (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS >> >> Pageblocks must also always fall completely into a section. >> >>> >>> b. Provide minimum possible section size for a given base page config to >>> have increased agility during memory hotplug operations and reduced >>> vmemmap wastage for sections with holes. >> >> OTOH, making the section size too small (e.g., 16MB) creates way to many >> memory block devices in /sys/devices/system/memory/, and might consume >> too many page->flags bits in the !vmemmap case. >> >> For bigger setups, we might, similar to x86-64 (e.g., >= 64 GiB), >> determine the memory_block_size_bytes() at runtime (spanning multiple >> sections then), once it becomes relevant. >> >>> >>> c. Allow 4K base page configs to have PMD based vmemmap mappings >> >> Agreed. >> >>> >>> Because CONFIG_FORCE_MAX_ZONEORDER is always defined on arm64 platform, >>> the following would always avoid the condition (a) >>> >>> SECTION_SIZE_BITS (CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) >>> >>> - 22 (11 - 1 + 12) for 4K pages >>> - 24 (11 - 1 + 14) for 16K pages without THP >>> - 25 (12 - 1 + 14) for 16K pages with THP >>> - 26 (11 - 1 + 16) for 64K pages without THP >>> - 29 (14 - 1 + 16) for 64K pages with THP >>> >>> Apart from overriding 4K base page size config to have 27 as section size >>> bits, should not all other values be okay here ? But then wondering what >>> benefit 128MB (27 bits) section size for 16K config would have ? OR the >>> objective here is to match 16K page size config with default x86-64. >> >> We don't want to have sections that are too small. We don't want to have >> sections that are too big :) >> >> Not sure if we really want to allow setting e.g., a section size of 4 >> MB. That's just going to hurt. IMHO, something in the range of 64..256 >> MB is quite a good choice, where possible. >> >>> >>>> >>>> (If we worry about the number of section bits in page->flags, we could >>>> glue it to vmemmap support where that does not matter) >>> >>> Could you please elaborate ? Could smaller section size bits numbers like >>> 22 or 24 create problems in page->flags without changing other parameters >>> like NR_CPUS or NODES_SHIFT ? A quick test with 64K base page without THP >> >> Yes, in the !vmemmap case, we have to store the section_nr in there. >> IIRC, it's less of an issue with section sizes like 128 MB. >> >>> i.e 26 bits in section size, fails to boot. >> >> 26 bits would mean 64 MB, no? Not sure if that's possible even without >> THP (MAX_ORDER - 1, pageblock_order ...) on 64k pages. I'd assume 512 MB >> is the lowest we can go. I'd assume this would crash :) >> >>> >>> As you have suggested, probably constant defaults (128MB for 4K/16K, 512MB >>> for 64K) might be better than depending on the CONFIG_FORCE_MAX_ZONEORDER, >>> at least for now. >> >> That's also what I would prefer, keeping it simple. > > Okay sure, will send a RFC to begin with. > Note that there is https://lkml.kernel.org/r/15cf9a2359197fee0168f820c5c904650d07939e.1610146597.git.sudaraja@codeaurora.org (Sudarshan missed to cc linux-mm) -- Thanks, David / dhildenb