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 D6303C43334 for ; Wed, 22 Jun 2022 03:41:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3005B6B007D; Tue, 21 Jun 2022 23:41:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B0F08E007C; Tue, 21 Jun 2022 23:41:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 177138E006E; Tue, 21 Jun 2022 23:41:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 063E16B007D for ; Tue, 21 Jun 2022 23:41:21 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B55F1353E1 for ; Wed, 22 Jun 2022 03:41:19 +0000 (UTC) X-FDA: 79604471520.04.42CF985 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf15.hostedemail.com (Postfix) with ESMTP id 5EBF4A0004 for ; Wed, 22 Jun 2022 03:41:14 +0000 (UTC) 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 CE5791F86C; Wed, 22 Jun 2022 03:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655869246; 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=jeXIvyG+fPIiAWcZllL+XxAZd7FyyfACJBUCMpR3g5k=; b=dKUbM58veNma+6AqhJX4djD7Ja1SaxFaSeAziPjuF4tMdf5xwB+eCeyNbaCHwLnEDidRvo nQUT3/gOA8huOLVkOnvl/ENu7A85bVkeITWMVmXXRFS2hCpr1mcyxcgv3TI51z6T0N3zQW D3RU589h7mhgx2lcCc1mp4rhaHlfrMA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655869246; 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=jeXIvyG+fPIiAWcZllL+XxAZd7FyyfACJBUCMpR3g5k=; b=MEuGvTyAqBHAx/bVdPsPW0HY67LJfovTu392gs17hV9r5V83i/Eaeim4/nG5/1UyDNOvJu PcQ2hTD1ueF8uLAA== 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 1C3561342C; Wed, 22 Jun 2022 03:40:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8x//Az6PsmIlDgAAMHmgww (envelope-from ); Wed, 22 Jun 2022 03:40:46 +0000 Date: Wed, 22 Jun 2022 05:40:44 +0200 From: Oscar Salvador To: Muchun Song Cc: akpm@linux-foundation.org, corbet@lwn.net, david@redhat.com, mike.kravetz@oracle.com, paulmck@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com Subject: Re: [PATCH v5 2/2] mm: memory_hotplug: make hugetlb_optimize_vmemmap compatible with memmap_on_memory Message-ID: References: <20220620110616.12056-1-songmuchun@bytedance.com> <20220620110616.12056-3-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220620110616.12056-3-songmuchun@bytedance.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655869280; a=rsa-sha256; cv=none; b=Rg5LG4PEK3n52ovj6ZJyI7pRVkYqPPK99xp/Vgx615UmUEKljESr6lBuuBkqMIaSYFvczE aFANjhcKOUUbGOdSkJW1b04x0KGqo4u1qTWJfZqxXxxKAdH1mIWt1Uysicujo2ky6BzfTc yUkA+nIpJ8ml7e4aMSSFI1B+ETA7Xz4= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=dKUbM58v; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=MEuGvTyA; dmarc=temperror reason="server fail" header.from=suse.de (policy=temperror); spf=pass (imf15.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655869280; 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=jeXIvyG+fPIiAWcZllL+XxAZd7FyyfACJBUCMpR3g5k=; b=Xj23plQKgspDkvpP5rMG6P53fQZ/OJceLdRXT+hJSuHyBui1ovP990gqsgB59QeozR2EUO /dJFXBJaDnmpuun6y+5teSpyEiXAEAN3PEXSnpHnjAQHzSITKSkjzn+z06UwytkiAr8DSH u92AkKOdZ+9Ri0DSPhqEWAe87/6lOr0= X-Rspamd-Queue-Id: 5EBF4A0004 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=dKUbM58v; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=MEuGvTyA; dmarc=temperror reason="server fail" header.from=suse.de (policy=temperror); spf=pass (imf15.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Rspamd-Server: rspam03 X-Stat-Signature: gzw5t5nwxsxmx8i8t5mbt78kixwa5g7n X-HE-Tag: 1655869274-395728 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 Mon, Jun 20, 2022 at 07:06:16PM +0800, Muchun Song wrote: > For now, the feature of hugetlb_free_vmemmap is not compatible with the > feature of memory_hotplug.memmap_on_memory, and hugetlb_free_vmemmap > takes precedence over memory_hotplug.memmap_on_memory. However, someone > wants to make memory_hotplug.memmap_on_memory takes precedence over > hugetlb_free_vmemmap since memmap_on_memory makes it more likely to > succeed memory hotplug in close-to-OOM situations. So the decision > of making hugetlb_free_vmemmap take precedence is not wise and elegant. > The proper approach is to have hugetlb_vmemmap.c do the check whether > the section which the HugeTLB pages belong to can be optimized. If > the section's vmemmap pages are allocated from the added memory block > itself, hugetlb_free_vmemmap should refuse to optimize the vmemmap, > otherwise, do the optimization. Then both kernel parameters are > compatible. So this patch introduces VmemmapSelfHosted to mask any > non-optimizable vmemmap pages. The hugetlb_vmemmap can use this flag > to detect if a vmemmap page can be optimized. > > Signed-off-by: Muchun Song > Co-developed-by: Oscar Salvador > Signed-off-by: Oscar Salvador LGTM, thanks for working on this! -- Oscar Salvador SUSE Labs