Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp342528rdh; Thu, 23 Nov 2023 05:37:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLfRjeGQ8zyGKhfPVFWoEPqJIBRrCBZnixPwZktr3yoFKvj15bd+RmSmYWsCql0pUyJzEY X-Received: by 2002:a17:903:1cf:b0:1cf:6b9d:ede5 with SMTP id e15-20020a17090301cf00b001cf6b9dede5mr3884873plh.20.1700746640289; Thu, 23 Nov 2023 05:37:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700746640; cv=none; d=google.com; s=arc-20160816; b=aK5Tl9FVHMbeMiyuZf5ydSzqPgHdlXswcUJTDQ64QPh3OVFEoEEJOVpr2WZyGJJyY9 +se4eVDE4FjFK2qJc0u9Y+o/JrX+dV2zsfV4CCoR4R9Ryg/1LHpQf6+TVXosTsin/1cH 0JJAv6TxvyqlH2A3HHINujlIkQPNdr1ejJG2Q1YXcrPFKUFvaQ+L7L194It5nSzzxkc9 awI+u8SPC5khJpEkP0hTwbVbjbtLze9M64xTrgUP3WQzflLAEoFfxaZitEFtOT/IXv+8 PtkxWg5uxX+XA7j1ZutwectSU1kOC+OvE1zhVlghx65hvGyT749c85Z6GCn4FTO2a7PX UppQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZmVKGX3xWVsiaI1L9mmzJOcNAtj7qPzayoGRggtSBII=; fh=Mfp6tXIfhm0wKwJBfrCMEq/ET4PmqmqmqGe1ZOy3t1A=; b=XyiHQ9mRUDCI1g+pdrLOHeVakBq4EIRXt5Fh4713csiTzCJmBUwo/y3bn5TL8uJx/x VTHvu07FQTr8UDWgdYMApnKzBE3GY/0BNlfDdn6UySBfgY9zwR9+1/HxWJjawNkRchYU uR3FEjycNQgi94O+ad/CkesBvYmuVw4fz4Tt8f62R7zurg/VrCNri/TC8cWC4Z715iPR XUOXTGBOlHs7p/1ntQbYYPQ90ybc7cd5H+aNSgIhf8KP+5a0wjl036yPpkG7lNT8VxWB GaXTnmpfltvdVEIUpxhFh6/k2sEiVFqIU8tLgzaxQYPcTwNAq8oleH3tBUeDurty+IuV 3Wow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Ztzwn0HQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j18-20020a170902da9200b001cf7c82c00asi1183281plx.499.2023.11.23.05.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 05:37:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Ztzwn0HQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 985888329A28; Thu, 23 Nov 2023 05:37:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345557AbjKWNgj (ORCPT + 99 others); Thu, 23 Nov 2023 08:36:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345504AbjKWNg0 (ORCPT ); Thu, 23 Nov 2023 08:36:26 -0500 Received: from out-175.mta0.migadu.com (out-175.mta0.migadu.com [IPv6:2001:41d0:1004:224b::af]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAABD1B3 for ; Thu, 23 Nov 2023 05:36:31 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700746272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZmVKGX3xWVsiaI1L9mmzJOcNAtj7qPzayoGRggtSBII=; b=Ztzwn0HQtIgdF3nrfOjRTmuus6uH05VuvO5saXWr5t12Q51VOnt0v0Tdqe3fTgV29LfEAj ZlpS/GGfT1xwjVdXl9k5LFCEe038RDKIRwdprffhWUuffvY73PgEemYmViGVybE5iBDRMn 6grrj48RxSO/qOyc0/yPWH8AYNiUtwQ= From: Gang Li To: Mike Kravetz , Muchun Song , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Gang Li Subject: [RFC PATCH v1 3/4] hugetlb: add timing to hugetlb allocations on boot Date: Thu, 23 Nov 2023 21:30:35 +0800 Message-Id: <20231123133036.68540-4-gang.li@linux.dev> In-Reply-To: <20231123133036.68540-1-gang.li@linux.dev> References: <20231123133036.68540-1-gang.li@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 05:37:17 -0800 (PST) From: Gang Li Add timing to hugetlb allocations for further optimization. Signed-off-by: Gang Li --- mm/hugetlb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 7f9ff0855dd0..ac8558724cc2 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3563,7 +3563,7 @@ static unsigned long __init hugetlb_hstate_alloc_pages_non_gigantic(struct hstat */ static void __init hugetlb_hstate_alloc_pages(struct hstate *h) { - unsigned long allocated; + unsigned long allocated, start; /* skip gigantic hugepages allocation if hugetlb_cma enabled */ if (hstate_is_gigantic(h) && hugetlb_cma_size) { @@ -3576,11 +3576,13 @@ static void __init hugetlb_hstate_alloc_pages(struct hstate *h) return; /* below will do all node balanced alloc */ + start = jiffies; if (!hstate_is_gigantic(h)) { allocated = hugetlb_hstate_alloc_pages_non_gigantic(h); } else { allocated = hugetlb_hstate_alloc_pages_gigantic(h); } + pr_info("HugeTLB: Allocation takes %u ms\n", jiffies_to_msecs(jiffies - start)); hugetlb_hstate_alloc_pages_report(allocated, h); } -- 2.20.1