Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp93198rdb; Wed, 18 Oct 2023 20:13:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuPP9Ce+aANhaonuXt0TjcFem7d5KDGU9l9Mqzh5TQmqIe35IUZyLw+DnoK+pciKcg35a4 X-Received: by 2002:a81:4ed3:0:b0:5a7:a817:be43 with SMTP id c202-20020a814ed3000000b005a7a817be43mr1177543ywb.6.1697685210848; Wed, 18 Oct 2023 20:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697685210; cv=none; d=google.com; s=arc-20160816; b=bf4CbjYaJt9uw5WGqFERFqwCYRudhx20fLGtjQCUHFBurb74H8zNwQ/idjrKLJ4WQf urHdEqA4YDnlIXRD5uvvwGucigkmqGBAFPaUSBlTPzMOsOuxAJWtu+hunAi2S95ObTCs 1XxSVDweZd9zYlXlKrrbLRij/ctVR9L9qfAdcYkUnMkkfNBC2ipYtnllW9zoy+hzfODi uXxdxrBZErQLUKY+vBOj9DSLxG1Sx70d0GqpHoSNbeRaSyq2yXSPy7Xr2BSUmAvO/fpJ Jy5LlJ4nJyDnFtaIfE2phzcJaKwuVoDkczQ/BHv4ssaDyzmTxJQs7RDpQIyAJNFTBAOb Lu4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=dCELsRGpQtBTf7R2azG7q2KcnWrjo9t9BqbdwSm/g60=; fh=WHckZaAL4dFl4PKzH4+cy0iVXeukBN0TEFu97vQ1r0U=; b=slsfyeJOPjsB2ftJejf4MgDNTLjWt1qs7xn5UlFVDUEls81KHFNjEc8ebre+1gQ13+ 8qperJ3Xq3NplHT5g7sfn/9o7R4XSlSFNm7a/pC3K9z5yh+PjpF5vlknTMWZoYgw7Zx4 K0OTivnjnoBZzIgJrJwZXmC0bywbUNKyN3suekQB72QEzJQKpeP/4WjzJwOcSTvbyy/B CdPhRqeOKDypMk9c72+Xh2YUE+YJizYVDbde6n4T7K90ZgoK2udihuix7HGLbPkReEKV y/ipKZD9tDcNi9YMAWJAA884xoZF5XUJ7/EPi+dHDFet6RVM4YvEabWZqeCSt4VzTbs3 pq7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YLXmnfCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id pg12-20020a17090b1e0c00b002680f00f8f3si1329934pjb.17.2023.10.18.20.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 20:13:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YLXmnfCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D5613802A62F; Wed, 18 Oct 2023 20:13:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232350AbjJSDNK (ORCPT + 99 others); Wed, 18 Oct 2023 23:13:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbjJSDNI (ORCPT ); Wed, 18 Oct 2023 23:13:08 -0400 Received: from out-205.mta1.migadu.com (out-205.mta1.migadu.com [95.215.58.205]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BD229F for ; Wed, 18 Oct 2023 20:13:03 -0700 (PDT) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1697685181; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dCELsRGpQtBTf7R2azG7q2KcnWrjo9t9BqbdwSm/g60=; b=YLXmnfCzsdB37AnUhu39i9fq1hffTF8aKBp5TUuQzCcLmHLlQoSbHChZVnRrQImtvJQKWt FG2yCQn+t+x/uNRXXNWv4lh8WJ0QTfQ2I0WfCVbKGJt+tOvOsqtXuQ0o0jOtUdZ6CN5bAO 8eGR/6vfX3H9ExeRv6nGekhBIEKeOM0= Mime-Version: 1.0 Subject: Re: [PATCH v8 3/8] hugetlb: perform vmemmap optimization on a list of pages X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20231019023113.345257-4-mike.kravetz@oracle.com> Date: Thu, 19 Oct 2023 11:12:24 +0800 Cc: Linux-MM , LKML , Muchun Song , Joao Martins , Konrad Dybcio , Oscar Salvador , David Hildenbrand , Miaohe Lin , David Rientjes , Anshuman Khandual , Naoya Horiguchi , Barry Song <21cnbao@gmail.com>, Michal Hocko , Matthew Wilcox , Xiongchun Duan , Sergey Senozhatsky , Usama Arif , Andrew Morton Content-Transfer-Encoding: 7bit Message-Id: References: <20231019023113.345257-1-mike.kravetz@oracle.com> <20231019023113.345257-4-mike.kravetz@oracle.com> To: Mike Kravetz X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 20:13:24 -0700 (PDT) > On Oct 19, 2023, at 10:31, Mike Kravetz wrote: > > When adding hugetlb pages to the pool, we first create a list of the > allocated pages before adding to the pool. Pass this list of pages to a > new routine hugetlb_vmemmap_optimize_folios() for vmemmap optimization. > > Due to significant differences in vmemmmap initialization for bootmem > allocated hugetlb pages, a new routine prep_and_add_bootmem_folios > is created. > > We also modify the routine vmemmap_should_optimize() to check for pages > that are already optimized. There are code paths that might request > vmemmap optimization twice and we want to make sure this is not > attempted. > > Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Thanks.