Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp872703imm; Wed, 11 Jul 2018 12:27:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpetLu3Zzvtd7ek75F4QBLRpcCMadufGoc7aWdbJcJjyGshZamq4lDiHh/MTMNbw/DAhtknk X-Received: by 2002:a63:375b:: with SMTP id g27-v6mr28182838pgn.59.1531337269618; Wed, 11 Jul 2018 12:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531337269; cv=none; d=google.com; s=arc-20160816; b=EX+FSUrJiPVNViqBmXWxBftX3AWK5bE8xyfSJP46tMctcPYrkE8gNGE2M6QUq2hL4Y /wbTe4kGaOSZkSdZ7nHjZhuPHvp1SrH8ffT4Kfpj9AUK+K23AysFc5XCkbaXwMNWm+mT 2zNLGo5XIlhaPsOih0vh3cXySlFWBnTcCLdg5CqwbnH2aJGREtQ1E2aAV/+Bqa3bnT+l UgHHdK904ULeObsbk7gpiSVq03czZpxL6zDUSaeOXSSa/VNJoEZ3TFrSZDLYyMAQcsIv DuTELw1daOnwPjmvKi9oAslmu6N5OQilTeuSOcp7QPqhEAKJQiZkouyXc9Hy15C3l0Sm clbg== 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=yvvJPtO6xiWM3JjD+Tnmb5/66cfjhiDerlZiJCl1t3M=; b=nMWe+6kpBa8NZm6wyw96g9azd6zLqVmqGYb9W0AnlBIXJLgyi1UVP5VsCJJzYiGQC7 Oi/47LSVEifvpB+W6/W7VD5XmWJ62IdgWq/NWPWydzDye8XgyxiMjQXMBfh32hPcY1Uw OmfEchEQtVKq/4JZ+5cp+jWlczdcFSx9f48ZPG8w8ucygaW4A+ZQgPpGRylV0vLDBTuw KM8ZGvZE8N/okVMO0Ct3mAnGOV4MXH6T+CHPFTGmOHQUj0clWJtcS7Km7MyrINmMV9Sa MrOPqBB/+X/BB6hbgxhnasL07alTJzZRQrUpY3o9oRL5/0jCG/7aL75Vl50dSUnxuR2H DUbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=06j8vPQV; 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 j67-v6si5013960pfg.34.2018.07.11.12.27.34; Wed, 11 Jul 2018 12:27:49 -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=06j8vPQV; 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 S2389931AbeGKQwo (ORCPT + 99 others); Wed, 11 Jul 2018 12:52:44 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:44812 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733026AbeGKQwo (ORCPT ); Wed, 11 Jul 2018 12:52:44 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6BGirVS035843; Wed, 11 Jul 2018 16:47:28 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=yvvJPtO6xiWM3JjD+Tnmb5/66cfjhiDerlZiJCl1t3M=; b=06j8vPQVd0V/b8oDh/XFSnl/S6vaElWwvjAFOTrzh0ewhQfjbalA7GqdjvaKhZ51gNCC +ojmvrBa4ZIIdFthCXXVZzmJQVy/8/0Mng0aZ/Vdysm3d7YQ2tvhORA9uGZmWbFCsdYD m/yqL1802VGQrqdrbuany9LdeiPnQZDRplXvuTQSmxpcVC5yQSiOI0NIFwG+lqwX8y78 yzEjbWdge7t3YFpCwoW+3FL8sUSqRdyV2UfaVbbNkbxJ5egw4rCgZxLTlqI09TukkR1C JvYQIGVR+kjUxOt7nAKXvjqr4+BXl56cepLwO0Ogw7Fk5BC25Z1avUreiSA56GZpiQvP HA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2k2p7673ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jul 2018 16:47:28 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6BGlRMt030356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jul 2018 16:47:27 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6BGlQGZ022844; Wed, 11 Jul 2018 16:47:26 GMT Received: from [192.168.1.164] (/50.38.38.67) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 11 Jul 2018 09:47:26 -0700 Subject: Re: [PATCH] mm: hugetlb: don't zero 1GiB bootmem pages. To: Michal Hocko , Cannon Matthews Cc: Andrew Morton , Nadia Yvette Chambers , linux-mm@kvack.org, linux-kernel@vger.kernel.org, andreslc@google.com, pfeiner@google.com, dmatlack@google.com, gthelen@google.com References: <20180710184903.68239-1-cannonmatthews@google.com> <20180711124711.GA20172@dhcp22.suse.cz> <20180711124801.GO20050@dhcp22.suse.cz> From: Mike Kravetz Message-ID: <3f639e81-f8d2-5010-4a4b-331d198b1ce9@oracle.com> Date: Wed, 11 Jul 2018 09:47:25 -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: <20180711124801.GO20050@dhcp22.suse.cz> 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-1807110179 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2018 05:48 AM, Michal Hocko wrote: > On Wed 11-07-18 14:47:11, Michal Hocko wrote: >> On Tue 10-07-18 11:49:03, 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. >>> >>> To be safe, still zero the first sizeof(struct boomem_huge_page) bytes >>> since this is used a temporary storage place for this info until >>> gather_bootmem_prealloc() processes them later. >>> >>> The rest of 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. >> >> The patch makes perfect sense to me. I wasn't even aware that it >> zeroying memblock allocation. Thanks for spotting this and fixing it. >> >>> Signed-off-by: Cannon Matthews >> >> I just do not think we need to to zero huge_bootmem_page portion of it. >> It should be sufficient to INIT_LIST_HEAD before list_add. We do >> initialize the rest explicitly already. > > Forgot to mention that after that is addressed you can add > Acked-by: Michal Hocko Cannon, How about if you make this change suggested by Michal, and I will submit a separate patch to revert the patch which added the phys field to huge_bootmem_page structure. FWIW, Reviewed-by: Mike Kravetz -- Mike Kravetz