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 8665AC433F5 for ; Tue, 17 May 2022 07:52:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 240616B0072; Tue, 17 May 2022 03:52:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EE266B0073; Tue, 17 May 2022 03:52:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DEA66B0074; Tue, 17 May 2022 03:52:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 00C4D6B0072 for ; Tue, 17 May 2022 03:52:40 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B817932C7B for ; Tue, 17 May 2022 07:52:40 +0000 (UTC) X-FDA: 79474468080.28.20A8199 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf14.hostedemail.com (Postfix) with ESMTP id 9BEB11000C7 for ; Tue, 17 May 2022 07:52:37 +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-out1.suse.de (Postfix) with ESMTPS id 096EA21F58; Tue, 17 May 2022 07:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1652773959; 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=/Ld3gfS/GkRdwRqnbgW3T6n5zLeUyB6RrpS/DHnDz9I=; b=yembhjILv7EzLAVzkuhekIlyZw8FSiu18w6aWNDYb9qjtPjCvk6EavjIOduCYKcIxeltBT 24vuYynDeGNim7Qx+kS8hvBH/1N4R7jSf/u0xSID/ChWtewkAXJD4NQMZnBDN6jqILEDQe BAMM/3dtgzmmq83eFo69woW6YHgdP5g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1652773959; 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=/Ld3gfS/GkRdwRqnbgW3T6n5zLeUyB6RrpS/DHnDz9I=; b=1vDhTW5q004P0rbkJDzYq0PtFSUKwj2JDXPGvVt/C9GJs8r6Y4mxsGaiHqrTCJaiI5OsI/ EZ9+GC2K3D0wG0Ag== 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 3B0E613305; Tue, 17 May 2022 07:52:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rruwC0ZUg2LEAgAAMHmgww (envelope-from ); Tue, 17 May 2022 07:52:38 +0000 Date: Tue, 17 May 2022 09:52:36 +0200 From: Oscar Salvador To: Muchun Song Cc: corbet@lwn.net, mike.kravetz@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, david@redhat.com, masahiroy@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 v12 4/7] mm: hotplug: introduce SECTION_CANNOT_OPTIMIZE_VMEMMAP Message-ID: References: <20220516102211.41557-1-songmuchun@bytedance.com> <20220516102211.41557-5-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9BEB11000C7 X-Stat-Signature: 7xxrruea7oxco9j76w7rohd5adbjkmaq X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=yembhjIL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=1vDhTW5q; spf=pass (imf14.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de X-HE-Tag: 1652773957-405342 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, May 16, 2022 at 08:03:49PM +0800, Muchun Song wrote: > On Mon, May 16, 2022 at 12:38:46PM +0200, Oscar Salvador wrote: > > On Mon, May 16, 2022 at 06:22:08PM +0800, Muchun Song wrote: > > > --- a/mm/sparse.c > > > +++ b/mm/sparse.c > > > @@ -913,6 +913,13 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, > > > ms = __nr_to_section(section_nr); > > > set_section_nid(section_nr, nid); > > > __section_mark_present(ms, section_nr); > > > + /* > > > + * Mark whole section as non-optimizable once there is a subsection > > > + * whose vmemmap pages are allocated from alternative allocator. The > > > + * early section is always optimizable. > > > + */ > > > + if (!early_section(ms) && altmap) > > > + section_mark_cannot_optimize_vmemmap(ms); > > > > Because no one expects those sections to be removed? > > IIRC, early_section + altmap only happened in case of sub-section pmem > > scenario? > > Right. The commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") > has more information. > > > I guess my question is: can we really have early_sections coming > > from alternative allocator? > > > > We can't. The early section does not consider partially being > populated currently. Then, IIUC, we can forget about the early_section() check? -- Oscar Salvador SUSE Labs