Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4437558iog; Tue, 21 Jun 2022 21:02:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vzQSWB0Uw3cJFyirdpDtXZ6cLm+kZIFEtU8TlVJA4tG5pz2+M+ARUOY4iao3xDKPhTnUuZ X-Received: by 2002:a63:7946:0:b0:408:c6ac:939b with SMTP id u67-20020a637946000000b00408c6ac939bmr1196490pgc.349.1655870542934; Tue, 21 Jun 2022 21:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655870542; cv=none; d=google.com; s=arc-20160816; b=xu/LMOLhqHLXLdigKyHeaX10NtaVMGAyBo45WiE/sDqbiNOnwSrYdVYJ7ALIfgd+oH Htd8SOx/iVTrqsKd6MESNExmrsGDsuMK9LQz2L07Dcts6413941tN7m8IwYF60rq7PQX sWfLXXv2/V6yr8wrQfYn/5wi5G1Yz6m+l8OLh5pDV6NU07O7xDWHVfYThwK95mlqoZx9 g9fiGyTwGwns6rSk2W5b+BYB6IjNb1xrZOeXmSvMGK5BHAlJIc4j8YCKsc0v816Y8pOE uIUAX+BA7X7b/wDiV52GPWk8buoNE+oJ9xoCprtoc3MeotH6ZTxBzbyC4Ki5x9XosjgV L5QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=jeXIvyG+fPIiAWcZllL+XxAZd7FyyfACJBUCMpR3g5k=; b=a+egT9TQmbsBUK+5AsYFmp3ymD4arNiLYrIvBQfB5/FLiijt5ZSZUGkzxWEUQu42es bEk4Wi5xP+mxjNb5XNz0iRMkB3K1+xlXOhY2R3jTk4YC6U5H+BkKFa4xhJoFOT1Z3Eu1 n6izraqyh2yvgMCqo+7WYBuXArQQgTIuGJEX5HkJM0mlbSezG7/OVmrnfGsAEgzBDcp5 V18qyoj2SN4NZq0QU6hELY7/A1+as9xylDJZHqVoOcthot4ECjbBT8wXd/sLuCLKyAP+ EAmUPii93yAGsIjGoBGTTPgtlxOsPeZ3Kuy9ukDBvNww/yQKD2QXz6A5D0YKvsKXwaXl w8AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dKUbM58v; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a17090a62c700b001ecc45fc899si4750778pjs.65.2022.06.21.21.01.59; Tue, 21 Jun 2022 21:02:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dKUbM58v; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356032AbiFVDkx (ORCPT + 99 others); Tue, 21 Jun 2022 23:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbiFVDku (ORCPT ); Tue, 21 Jun 2022 23:40:50 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43B592FFC0; Tue, 21 Jun 2022 20:40:49 -0700 (PDT) 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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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