Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp629960imm; Wed, 11 Jul 2018 08:20:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf57LSV0u8/k4N8JTDd1oz4UfSS3H8tcwhffoQUN2Y/cCuf9dZuR5qrZ8hjzhWqQt9UsbUu X-Received: by 2002:a62:8995:: with SMTP id n21-v6mr30274611pfk.83.1531322411482; Wed, 11 Jul 2018 08:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531322411; cv=none; d=google.com; s=arc-20160816; b=G7CvkCXh3UQhZePzFYPc2I6s6YvvF7+bYS/JY4pxxx/Mrin52Em5Au6CKmGgL/Q543 IucXl4YNGKBB5CcfPQv8r8rwOGLx9YmP4tEX603gKA9fj4MEdTXfGPsQbMnIGJWRmCEA JxxQXapRrxVroXF80Hz42KAws4CjAMYww2LHwk5Slk5aD9dFxWq0AsGSC7b/lj+1WLGe H/LoO7SGCt/WvBQi6rIfmdTlslBboijFo3Rp96yA0pKop8K2fPrtQSHlxQGt2RZPEFvZ 8p0biv8ag2HI2wG0QD5c5dsj8Ou3fT2JT+MEN6hIr/con+1cvIdwglu117VFuox1/5jV zZUQ== 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=w9k8j+cIyqiEyn3bDGxKmbVr8lTZG1D4mrK1f2KQqFU=; b=s1f5pcP8yg8neGeB1dIEFJsOY/vN3ooqRFMZoU3pu3/Hgd88w6bVQHe7QcoiivTehq fo06kzr117SFg18jpPq9G/RbDk1NgUu38KNlLtHKH23QG38kGDIWqG5qbqT9TnKtHPEC Zgxi/VJvJeADA+LbTv6TA9uqu/bZxJZCWjg5kQgDVVWZFxbN2lSm1vre0SsGIWC5QYvG wkI6gXBca4QumCqn+K6zRK8G+TQSLk8vR/Y1yvDDTtGW3jbNNWkTC8GMJK529jlEcbdK d6ISEc1ZjL39eOUKVzDQiQRYTK11pXlPCxQTmNqu1SiARbbca4gWp3k0XsjX+0d+p2qO sAuQ== 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 l8-v6si17778120pgq.432.2018.07.11.08.19.55; Wed, 11 Jul 2018 08:20:11 -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 S1732551AbeGKMwO (ORCPT + 99 others); Wed, 11 Jul 2018 08:52:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:37932 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726457AbeGKMwO (ORCPT ); Wed, 11 Jul 2018 08:52:14 -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 738DCADAB; Wed, 11 Jul 2018 12:48:02 +0000 (UTC) Date: Wed, 11 Jul 2018 14:48:01 +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] mm: hugetlb: don't zero 1GiB bootmem pages. Message-ID: <20180711124801.GO20050@dhcp22.suse.cz> References: <20180710184903.68239-1-cannonmatthews@google.com> <20180711124711.GA20172@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711124711.GA20172@dhcp22.suse.cz> 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: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 -- Michal Hocko SUSE Labs