Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp113473iob; Tue, 17 May 2022 20:40:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzli7ivNhI/xgeU3m8+P/GRsHB2RyHdEQUkxWD8luu4AkJEJYpjDKNmLGmphtI4112JtUze X-Received: by 2002:a17:90b:788:b0:1df:5ffe:ad15 with SMTP id l8-20020a17090b078800b001df5ffead15mr12774062pjz.141.1652845206217; Tue, 17 May 2022 20:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652845206; cv=none; d=google.com; s=arc-20160816; b=avGPemOedZdjvlT7sWC8NIid8YAxi+D03maSTkEjiKemZz1YNrDJCMqbJycE+cKuxg fxnOqFQRfjNaT034Pe7tQvu2HG34R3quvwogTLfVzVCDM+K/NxCYUU5RMzHSVjHpJx4q XPD9EhCZz5dsoSG1meOwquoEGsHmrHhsIZDe0B79z+irR9GoPZQcQ1jM+pM6GFuqTNUz 7kkHpW1RfaC2zRY++w9dJ8PlR0Pa+Y6wL1U+y4jMq0bnRZ16XQFhiJuUdRcFAEnv4sjt HyqiLR2FG2TctwkxS8D20P2xNWKsh3bE+PPVl+LU1mw6eqltfp/gfDbyWl3fPmmEttV9 3j/g== 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=/Ld3gfS/GkRdwRqnbgW3T6n5zLeUyB6RrpS/DHnDz9I=; b=ocZhbdMVQ0XjILohsmqerNHQ+E+JnZxPD0UFsL85iaUBNIluopKKY6fKPbq5bJd23c 4RlWkK+fNAihcLTt2Drk/mlnKA/uyz+M3yzX8cMd3rQTLawZETkwMFYZqcf7hPkMw+qE SEecajcXXF7S2t0SJLWn5kyRBGaZ7iGjNJ7CAUq2qSu1wxOI92qYuLbaXfbjjHx1aRCh jevtrC6awjvkMLkX4yjrkQxJ5rgdRsZU1C1NfoTOcv4VoJSOoyoY4kgHooM9UgJ0qqwg WyKbJDZutF4ksu+4LuiDQ+xTUHmj00ItZ+iQgrqvFCGeyHBPYwLVGvZDSfk6wCkp3XVN GveQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=yembhjIL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=1vDhTW5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c10-20020a170902724a00b00153b2d16407si1298503pll.15.2022.05.17.20.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=yembhjIL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=1vDhTW5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EE1C776296; Tue, 17 May 2022 20:28:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiEQHwp (ORCPT + 99 others); Tue, 17 May 2022 03:52:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbiEQHwl (ORCPT ); Tue, 17 May 2022 03:52:41 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 952813336C; Tue, 17 May 2022 00:52:40 -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-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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, 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