Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1396312imm; Thu, 12 Jul 2018 00:49:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMfpMPG3gIvO2IuoQdaasEvNAfJYcKN+7duQNIw3+QMiYTahKk7rOBx1nJoTV8GTFEjznz X-Received: by 2002:a63:2043:: with SMTP id r3-v6mr1129486pgm.105.1531381782322; Thu, 12 Jul 2018 00:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531381782; cv=none; d=google.com; s=arc-20160816; b=zmXT0LcgavF0M2EsrijfQ5cujHfX0SkOFCaaax4s/KNeCKWXKr9fTCWgDuCGzEiaQS vO/K41/Q2aSKfDxT1/vB9SrFLtqcNRl7x+NbxJlfMvbNsFj0pbk2rNoXDYZfzta0OiiA 5UlVS6nHroTy1txBNGGlJMo7lwC0TE6x+EzWC3n6I6CEYoGzSWRNEvNL9TZ1z2SSz6vO /3i5JVkiFgi3q4t3d3Wbiu+czxHSXjRx5B/EMKfGU+KqFkQn2/apRrY6F1ktwjb53nWp 9T9MZRZZEyyjaAWCxzvFO+/Chc7poClC6KSBU0+copCm82Z900PH/xXFVh/YpWJVeT2G zqZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Grw2+kqNIPQqtCVcxaffrOebjHvY20oR/mUhInR7nbA=; b=EAtaVGiJbfx1yU1oYKNZyRAuTzBDHgl6v6pA9Ifi0naNOS77CgYs52tMcIYUcy4OSW wLMAnF/9suKrlLC+mbzX1gw2uArmye14kasHjk43dPAQbXRpT1Lmu9RQgSN0m2vYdlyl bnnK7BpTuBjnqlnyaemMR1rXefNGVq6pHVo9YGziHQBqi3+uhZnLH+D8Cwk10atZ96qm A4eT0hLts9qVH57bXTl0LywSzRqB+2VVnf6oamL/M4uF6bjqrjBfQhBMVNNuCUvJUfd5 gCfIJFgAD2N0sVpjVYxLmSQ8MUqlXWO3I2SfaaxlpO6KZDFQASDJYy9lDS1C5cpy6jwU h3QA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j61-v6si21242635plb.68.2018.07.12.00.49.26; Thu, 12 Jul 2018 00:49:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727045AbeGLH42 (ORCPT + 99 others); Thu, 12 Jul 2018 03:56:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:56794 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726227AbeGLH41 (ORCPT ); Thu, 12 Jul 2018 03:56:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 764BBAE54; Thu, 12 Jul 2018 07:48:04 +0000 (UTC) Date: Thu, 12 Jul 2018 09:48:03 +0200 From: Michal Hocko To: Cannon Matthews Cc: Andrew Morton , Mike Kravetz , Nadia Yvette Chambers , linux-mm@kvack.org, linux-kernel@vger.kernel.org, andreslc@google.com, pfeiner@google.com, dmatlack@google.com, gthelen@google.com Subject: Re: [PATCH v2] mm: hugetlb: don't zero 1GiB bootmem pages. Message-ID: <20180712074803.GB32648@dhcp22.suse.cz> References: <20180711213313.92481-1-cannonmatthews@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711213313.92481-1-cannonmatthews@google.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 11-07-18 14:33:13, Cannon Matthews wrote: > When using 1GiB pages during early boot, use the new > memblock_virt_alloc_try_nid_raw() function to allocate memory without > zeroing it. Zeroing out hundreds or thousands of GiB in a single core > memset() call is very slow, and can make early boot last upwards of > 20-30 minutes on multi TiB machines. > > The memory does not need to be zero'd as the hugetlb pages are always > zero'd on page fault. > > Tested: Booted with ~3800 1G pages, and it booted successfully in > roughly the same amount of time as with 0, as opposed to the 25+ > minutes it would take before. > > Signed-off-by: Cannon Matthews Thanks for the updated version. Acked-by: Michal Hocko > --- > v2: removed the memset of the huge_bootmem_page area and added > INIT_LIST_HEAD instead. > > mm/hugetlb.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 3612fbb32e9d..488330f23f04 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -2101,7 +2101,7 @@ int __alloc_bootmem_huge_page(struct hstate *h) > for_each_node_mask_to_alloc(h, nr_nodes, node, &node_states[N_MEMORY]) { > void *addr; > > - addr = memblock_virt_alloc_try_nid_nopanic( > + addr = memblock_virt_alloc_try_nid_raw( > huge_page_size(h), huge_page_size(h), > 0, BOOTMEM_ALLOC_ACCESSIBLE, node); > if (addr) { > @@ -2119,6 +2119,7 @@ int __alloc_bootmem_huge_page(struct hstate *h) > found: > BUG_ON(!IS_ALIGNED(virt_to_phys(m), huge_page_size(h))); > /* Put them into a private list first because mem_map is not up yet */ > + INIT_LIST_HEAD(&m->list); > list_add(&m->list, &huge_boot_pages); > m->hstate = h; > return 1; > -- > 2.18.0.203.gfac676dfb9-goog -- Michal Hocko SUSE Labs