From patchwork Thu Jun 9 08:30:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 12874998 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0EEFCCA47D for ; Thu, 9 Jun 2022 08:31:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.344764.570365 (Exim 4.92) (envelope-from ) id 1nzDZ4-0001CN-JV; Thu, 09 Jun 2022 08:30:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 344764.570365; Thu, 09 Jun 2022 08:30:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzDZ4-0001CG-Gm; Thu, 09 Jun 2022 08:30:50 +0000 Received: by outflank-mailman (input) for mailman id 344764; Thu, 09 Jun 2022 08:30:49 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzDZ3-0001CA-5J for xen-devel@lists.xenproject.org; Thu, 09 Jun 2022 08:30:49 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzDZ2-0002Mb-SA; Thu, 09 Jun 2022 08:30:48 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nzDZ2-0001qx-HE; Thu, 09 Jun 2022 08:30:48 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=bP2JcB/LIDxgF1FeJGcHxrQnobjWYEcKaQQDMM+Bw+8=; b=3VdsdL hjxXUUKU0Yia/jxq61CgSoOrjEWSBbE122ilmqISlFIyOPx1+mqR/ISeEeSm8nAbRBxCYXerNQ5xY dHZZMN0HnKXwzOf15N08uTnOP3hcX3fA7xD4aNhqThQfdjfKSRdDIn0CodKApLjxSOODoYxgCiW0D q+jMVjyEGqE=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: bertrand.marquis@arm.com, Julien Grall , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 0/2] xen/mm: Optimize init_heap_pages() Date: Thu, 9 Jun 2022 09:30:37 +0100 Message-Id: <20220609083039.76667-1-julien@xen.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 From: Julien Grall Hi all, As part of the Live-Update work, we noticed that a big part Xen boot is spent to add pages in the heap. For instance, on when running Xen in a nested envionment on a c5.metal, it takes ~1.5s. This small series is reworking init_heap_pages() to give the pages to free_heap_pages() by chunk rather than one by one. With this approach, the time spent to init the heap is down to 166 ms in the setup mention above. There is potentially one more optimization possible that would allow to further reduce the time spent. The new approach is accessing the page information multiple time in separate loop that can potentially be large. Cheers, Hongyan Xia (1): xen/heap: pass order to free_heap_pages() in heap init Julien Grall (1): xen/heap: Split init_heap_pages() in two xen/common/page_alloc.c | 109 ++++++++++++++++++++++++++++++---------- 1 file changed, 82 insertions(+), 27 deletions(-)