Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3354540iob; Mon, 16 May 2022 20:28:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4g/AqyWsTM19EuvkwPAIGNSED0DPIRau3sHER/XOAPSYUbQ3IumG18ZkdnA9Tty18/CGd X-Received: by 2002:a17:906:dc8a:b0:6f9:13e9:4c87 with SMTP id cs10-20020a170906dc8a00b006f913e94c87mr17569769ejc.729.1652758100465; Mon, 16 May 2022 20:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652758100; cv=none; d=google.com; s=arc-20160816; b=xV2auBzCt99Yy1gPrUSUCcLpnKDp0qF5ry4CjbNtMgG7dCqcyWjSAi86da80W4Gohf dabbqp1eCAoPgANkHxz3V8Ll4xCyWqB8/ZY8qX0rRTVDryGv5NrmZgnoSd8oy3E2PNp4 g4w8oJDpP2P+k0W8fTDjOUvTMON+Ld+y4U6BrDklqBWsZl4rzUpBmCAmDHQfpEAzj7RT BfEFhQ3Z65HsmtRxE5AvwblCi8TpIZtOxDMmMlct4Q4ixhyiFq/gV5q8AdVsQEWvk/yv 98UdsqTEJHxE53O1cI9K9rCywXimdS7uJKnM3ijXWlSzL1nFr9O/ldFAYiM6o3CEXfoH 9v0Q== 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; bh=R84IxflJzQsjcs6liOC1xGi2RLfZVO/J/zvMOYtMBKI=; b=lQrkiGha9QZoCwbWM4kNG+m0tDqKYuUc8ZedwlCCSBPlxEwpAP1t+IKWIxgZN5iazn tk/MM8oq/TQl14sQr7NXBvaTirJz3nrYr7udC3wF5UTg0oD7L99yF8hR/fHpVJp4i3Ui mAol2h+LbZa15KQhElI0pMosVdu0nOEm+zfUCBlvriK7M9TWo2L9VzOIt7ZInZJX1k11 4ckEaRsSpg4E7Ys+VpGvTG5W2FLGalzRgejVrFgmXJtHk2JdfVuXno8k7wPoJPzx8/5j 7ICFn7zjztau0hbug9z76Y+dOdMH26GVgELRkEF53Tk21EiiaM/MU1UVc4d3HBm8EUII 4A1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=W7DK2qAT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a056402084700b0042600959715si15201930edz.204.2022.05.16.20.27.55; Mon, 16 May 2022 20:28:20 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=W7DK2qAT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232064AbiEPMEE (ORCPT + 99 others); Mon, 16 May 2022 08:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbiEPMD5 (ORCPT ); Mon, 16 May 2022 08:03:57 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D181F1EC65 for ; Mon, 16 May 2022 05:03:53 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id pt3-20020a17090b3d0300b001df448c8d79so3012023pjb.5 for ; Mon, 16 May 2022 05:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=R84IxflJzQsjcs6liOC1xGi2RLfZVO/J/zvMOYtMBKI=; b=W7DK2qATwEyfvh21pVCPdp+fSj3B28j0KvO+lqsOPxPZIH7RUOgXti2vLaZX56uPLi Zf54oYdtq6IyZAvY5uSVv4DttuV81ENkrczCOrwjaDIK6BuZ9TEuvUnmtPYCDQda5SK1 2UJO3Wpu94Gdhwd/Yp8g9Rz4sXJ3VK/C2xxsZHY0ElYNMbFV7cttoOT3unYS/7uyE5ZQ PCp8z3w4j1eNrioDSgF9sfHye+GKmDpwe/cqZLfIukhxqI9gEH+uocUTdY3ZuzdW8+Rr 8/PJoYZ+p6cGNJWT50couq1k2JPjXlYhEQyNWCCb7k0tVbkNVfl77lsAuuK09mYxx+sm 4Ttw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R84IxflJzQsjcs6liOC1xGi2RLfZVO/J/zvMOYtMBKI=; b=6ZCr5RcXFOGCeyaf3w8fOr0NFKPoKeu8dkBtmDMVkjosVXzm6557ffZfnCfYmoc0Xs e7iTHBA8m5dvZNZl7KIRxpXxpsFBTAGjgjSoNAwRZgz5NQgM56ZpgbW78UTQZwNwliHP Pne/tcYJ6ZN08ROHWD/MHAGJQFYw+0LLAqdhVJLBgjH26Io/mzZsHjCye4/cm+ULr2Sn ShBqFyWYOMkkBfBMG68ijk5YeExQhr9+vrfWhNeXN1wcCVuuJ7fnrsUkhuRJ0yplQgRq DNvvPN2Dazqmqu6Jhv7IUFIbnwF7MiE3Txr1uj65RWPhmoP3dLqyRZ6AaX2PgFMfejPT jWSQ== X-Gm-Message-State: AOAM530PRrDP6kbR4cVoZ9cEMppgQ1ot26NT2Qg+DCoHwi2vevL/Unn2 9PUi+U0DbhwceVejWi9IJyjh+w== X-Received: by 2002:a17:90b:48d1:b0:1df:4fc8:c2d7 with SMTP id li17-20020a17090b48d100b001df4fc8c2d7mr5686526pjb.45.1652702633331; Mon, 16 May 2022 05:03:53 -0700 (PDT) Received: from localhost ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id n22-20020a056a0007d600b0050dc7628139sm7015117pfu.19.2022.05.16.05.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 05:03:52 -0700 (PDT) Date: Mon, 16 May 2022 20:03:49 +0800 From: Muchun Song To: Oscar Salvador 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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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, 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. > I think this should be spelled out more. I think you mean add some comments here to describe the case of early_section + altmap, right? Thanks.