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 EEE14C001E0 for ; Thu, 27 Jul 2023 10:55:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68D5C6B0074; Thu, 27 Jul 2023 06:55:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 63F1B6B0075; Thu, 27 Jul 2023 06:55:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52CD16B0078; Thu, 27 Jul 2023 06:55:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 403056B0074 for ; Thu, 27 Jul 2023 06:55:12 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0F7B5161007 for ; Thu, 27 Jul 2023 10:55:12 +0000 (UTC) X-FDA: 81057084864.16.59470C4 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf05.hostedemail.com (Postfix) with ESMTP id 2BFB110000C for ; Thu, 27 Jul 2023 10:55:09 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=HoIxeaM2; spf=pass (imf05.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690455310; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=03ocS2CkLhvohMqLX/92YU/WWyH6YW59W+34dQnBH7s=; b=ky0t2EOUoJ0iNnzoyI43n9bUHYOoj+bjctnFzo8++Nl84g5WwOTYI8IHUzZ2VAR1f/k8T9 j/ucqlYQ1cN67UlUKKDw4yvR3sGD/bwJeuZqoNDvJ6MH9Cw6CHxrX9UuypMSaRtxTxnrOU FOrTPCTOKvU8PYUNv7evyAygXrrlWBg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690455310; a=rsa-sha256; cv=none; b=LbWmnPa5FY+eA0EmMFauT7U9H5O0FiHUb0r6mygnkmqQyrGHItp4chLZebvyg190PbimLq KEPKV3la+jnyb11SM9sT3aFSamP1Dez7Hai9ajvvyRCSHkVEQm/dWtlyiza22s5tnkj9yg f/HbAZWwTVEZ0QWgqKMK9TFMPapz/EI= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=HoIxeaM2; spf=pass (imf05.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6B9371F37C; Thu, 27 Jul 2023 10:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1690455308; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=03ocS2CkLhvohMqLX/92YU/WWyH6YW59W+34dQnBH7s=; b=HoIxeaM2rz7MaAKAhiqORT7me6xBbcPKIr31jxIYx8uWwbVWYrSTo8dPykyD9QOXdZQQWX HQYMsbxEbe78wrPz2+FV4yMp8GXACgiMk1lYEHkcD3+ymg4i1eUJW2dR3f75WAGUOO4j8L rR+3y1YahibbdCfuIK14UoE+Qric6F0= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 48D8013902; Thu, 27 Jul 2023 10:55:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NyvYDgxNwmRNGQAAMHmgww (envelope-from ); Thu, 27 Jul 2023 10:55:08 +0000 Date: Thu, 27 Jul 2023 12:55:07 +0200 From: Michal Hocko To: Aneesh Kumar K V Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu, Oscar Salvador , David Hildenbrand , Vishal Verma Subject: Re: [PATCH v6 4/7] mm/memory_hotplug: Support memmap_on_memory when memmap is not aligned to pageblocks Message-ID: References: <20230727080232.667439-1-aneesh.kumar@linux.ibm.com> <20230727080232.667439-5-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: uzhz7tbxn4ibrpwmq8deb7nwj719n5e8 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 2BFB110000C X-Rspam-User: X-HE-Tag: 1690455309-87275 X-HE-Meta: U2FsdGVkX19pa6r+ILQoCozEj6SvUtTTj8SHvGeJ3XC25GAYIdvMm0IUhauPkAkFg4ltjl7MFkvvaGcVD2rwThGNTpLZAc9wS9gCuuUerDtYP7V05nMggc5no2jf+VJUGi6/xlAKfVMjVm4umUAj9CoVrbuiy+zrNQ/Gxw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@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu 27-07-23 14:57:17, Aneesh Kumar K V wrote: > On 7/27/23 2:53 PM, Michal Hocko wrote: > > On Thu 27-07-23 13:32:29, Aneesh Kumar K.V wrote: > > [...] > >> + if (mode == MEMMAP_ON_MEMORY_FORCE) { > >> + unsigned long memmap_pages = memory_block_memmap_on_memory_pages(); > >> + > >> + pr_info_once("Memory hotplug will reserve %ld pages in each memory block\n", > >> + memmap_pages - PFN_UP(memory_block_memmap_size())); > >> + } > >> + return 0; > >> +} > > > > Why should we print this only for the forced case? Isn't that > > interesting for any on memory memmap? Also is this the above sufficient > > on its own? the size depends on the block size and that can vary. > > I think it would make more sense to print the block size and the vmemmap > > reservation and for the force case also any wasted amount on top (if > > any). > > > > For the other cases the space is completely used by for struct page allocation. What > the information is indicating here is that for each memblock we add we are loosing/wasting so many pages. > May be I should have used the term "waste" instead of "reserve" ? OK, so I have clearly misread and it just confirms this would benefit from a clarification. In any case I still think that it would be benefitial to also report how much of the memory is used for vmemmap on the hotplugged memory. Maybe as a separate patch. -- Michal Hocko SUSE Labs