Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1202491imm; Wed, 11 Jul 2018 20:02:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeyFza2bbplUQJndblQu7hz5uJApgVE9rDrupCPmAVc6pirSjhWR4/jaoJ+xPeHocVQ0yV9 X-Received: by 2002:a63:a745:: with SMTP id w5-v6mr446410pgo.374.1531364546648; Wed, 11 Jul 2018 20:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364546; cv=none; d=google.com; s=arc-20160816; b=ojansLBWf9jHvZy9YX9htSa3MFFkiQl7qmO+WZ3DvPGb1IQTLa/HAch6I8rGrgA243 ubvfCx+O2+oTRr0E20cGhQSN39w2GmEynOVFpQadNflDaykkcHVJMjk2TVbs+eAfFwAB 01ZnoZsA++FNcXSW41Uw0cnCIOczEXe2LwW0aJThc5ziPlz1HJJtcG+/Y7uJK50prZVJ FfV13CrWJ/rIHw0fZmbouR/Q0+CR0CxofhtcU5xRzN+ndzAljB5jg2Y/14sN0gxsynzh iEe3sH4eny0pdAz2Xg2Vp0KhZ18N08FFGpnN/VnuJAekpK3IBWALOpDm/KU6BNUU+l2n sRKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=72JwC1o0eJ/EFcoAeisDQIQI80euNhKG7S32svp5iGk=; b=xbX1bojr1ve3lgmuXpyzw4m7Urn7qQ4H5HeqfgR4zs9LQy2dFHwxSu+PZdmOt5cYGc WX8O3981ruMgrYR3UVyvRr/LtQOmmU+EtR+ynGFf9IfYzJyxxC+LPpaQohjqOZH3v9TO uneNj1/Sy0GDegdaZzTKPxJ2Uc4FUwN+g+27vdjxGqoFanTG5NbX4D0GzbE2vlOD4ZyN WdhpSqpBUg2ewJUCA/7zhzb5h4A+YWN88LFEW87kS3c4lDoLSd/d8R3FiPXj/nR2+Yzj GsMzHw/YN1kx10qT/NavLWY2LyEk5WHZo1r27dSqzm8+38sysxcEfWe215Gfqos7b6V7 IsDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ZXkXgmkm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si22835431pfd.182.2018.07.11.20.02.11; Wed, 11 Jul 2018 20:02:26 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ZXkXgmkm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390642AbeGKWD0 (ORCPT + 99 others); Wed, 11 Jul 2018 18:03:26 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:47896 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389475AbeGKWD0 (ORCPT ); Wed, 11 Jul 2018 18:03:26 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6BLrSaQ095363; Wed, 11 Jul 2018 21:56:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=72JwC1o0eJ/EFcoAeisDQIQI80euNhKG7S32svp5iGk=; b=ZXkXgmkmvZjp2WXG1eYWrMYDkljt9ZNV5UBm4u3lT1//oj9YREmuxI5eWkx/mjXDBX6p I51GJFTM+7nwxSKrmi/17+tfuvWgzVFlZUPjkOpLYfZPFGqvpzE9/owk9vRTixb6D9yH B5Q2yeb9Adcah0nm0KEPS/2Rv5YjSeHB2OxKTRmuTqkjWUq3jpgcJCdfX3s5xDJcI0jp uIWr9q5EsH+cen3FQYWLCY1mIPM0b1TZyVDoS6VIo13lcTg0gJpsm3XWsZXCjA1mJ026 Th1bllG29REw4M05JMHlwvMPI0+SNGYZwwcO7AOulDlaGo3MdSaTRJGFBaVjGcU7z5Ol 5w== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2k2p7601pt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jul 2018 21:56:57 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6BLuvnj022423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jul 2018 21:56:57 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6BLutR3020699; Wed, 11 Jul 2018 21:56:56 GMT Received: from [192.168.1.164] (/50.38.38.67) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 11 Jul 2018 14:56:55 -0700 Subject: Re: [PATCH v2] mm: hugetlb: don't zero 1GiB bootmem pages. To: Cannon Matthews , Andrew Morton , Nadia Yvette Chambers Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, andreslc@google.com, pfeiner@google.com, dmatlack@google.com, gthelen@google.com, mhocko@kernel.org References: <20180711213313.92481-1-cannonmatthews@google.com> From: Mike Kravetz Message-ID: Date: Wed, 11 Jul 2018 14:56:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180711213313.92481-1-cannonmatthews@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8951 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807110231 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2018 02:33 PM, 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, Acked-by: Mike Kravetz -- Mike Kravetz > --- > 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 >