Received: by 10.223.185.116 with SMTP id b49csp1692251wrg; Thu, 22 Feb 2018 01:17:07 -0800 (PST) X-Google-Smtp-Source: AH8x225lM5wH12FUzyePvstunOttSsnFG0DS1gLoY1mDAkNKAeY+7QuY3jv6BNyrEAG2Hr7EoYig X-Received: by 2002:a17:902:1a2:: with SMTP id b31-v6mr5693480plb.28.1519291027756; Thu, 22 Feb 2018 01:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519291027; cv=none; d=google.com; s=arc-20160816; b=iscZhEQLvU45W2kkuRsg4p7ClIUM7UWnjXqlbz2NLY/QqvTHSEr2Ej6lPzby2s1T7o JF7ihXwNiWYppUTk77XCPdpmYbe6WMTD6qWHYVcdATcIlLLGd6BI1iYh3QFq2Z6DYaN3 ykaTgMyliScchTNfGDQ1JV8o1NYA2kkrjG1duMl+KjwnZOHhfqJamLtQjw8FUuCFDL0U mnuaL2YujEOooP3x9nPDEpdfcsv8B00dDdRrHnsI4bmqKAG0phtrmBe3DbiRBHn0rmVc EWq3w5wHHOPOXqWsTujthgbVkz7ldInnVXnzdvv4xVKbOSGTS67de/HHRJBLAUiNkslC SN2Q== 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=7sHZUj/+2SSScwJXykelCsadBHS8JNz0XhTwSHRtUZc=; b=dtPKLVGwMxEIAS81nK4RE++awSXi9sayvITIvJCLxv6TGbKPibhqURzrFvJDglvRuZ dUjrAbnBNLKy6TBoMFeNZfYuxm+CHLZP4dM1tti3aBPSU8poGRCXI/6f5pdJEnN6SBfF BTK9+1Waz4W5ZkWM1Sh98N7bXX6WTvz4LmZZnf/YJaLnFBaDza1CM7rNThPb9a5BjQP/ qbAEZaNhsWSymNCKeHju3hqV0tQL337dRZiHAChJjc+Xn+vEzTTnxRkZ+wgfK4OIf1b9 tca1HrgUk5HAkfQs3Smdcdcjhogs7xLzTkfU+307HXh8LKETwObyPhCC5m0LsAT6bYKB fSnw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 17si358620pfw.21.2018.02.22.01.16.53; Thu, 22 Feb 2018 01:17:07 -0800 (PST) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753054AbeBVJPv (ORCPT + 99 others); Thu, 22 Feb 2018 04:15:51 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54446 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752892AbeBVJPu (ORCPT ); Thu, 22 Feb 2018 04:15:50 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DBF68182D3A; Thu, 22 Feb 2018 09:15:50 +0000 (UTC) Received: from localhost (ovpn-8-20.pek2.redhat.com [10.72.8.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A90B10A96F6; Thu, 22 Feb 2018 09:15:49 +0000 (UTC) Date: Thu, 22 Feb 2018 17:15:46 +0800 From: Baoquan He To: linux-kernel@vger.kernel.org, dave.hansen@intel.com Cc: linux-mm@kvack.org, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mhocko@suse.com, tglx@linutronix.de Subject: Re: [PATCH v2 0/3] mm/sparse: Optimize memmap allocation during sparse_init() Message-ID: <20180222091546.GA693@localhost.localdomain> References: <20180222091130.32165-1-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222091130.32165-1-bhe@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 22 Feb 2018 09:15:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 22 Feb 2018 09:15:50 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/18 at 05:11pm, Baoquan He wrote: > This is v2 post. V1 can be found here: > https://www.spinics.net/lists/linux-mm/msg144486.html > > In sparse_init(), two temporary pointer arrays, usemap_map and map_map > are allocated with the size of NR_MEM_SECTIONS. They are used to store > each memory section's usemap and mem map if marked as present. In > 5-level paging mode, this will cost 512M memory though they will be > released at the end of sparse_init(). System with few memory, like > kdump kernel which usually only has about 256M, will fail to boot > because of allocation failure if CONFIG_X86_5LEVEL=y. > > In this patchset, optimize the memmap allocation code to only use > usemap_map and map_map with the size of nr_present_sections. This > makes kdump kernel boot up with normal crashkernel='' setting when > CONFIG_X86_5LEVEL=y. Sorry, forgot adding the change log. v1-v2: Split out the nr_present_sections adding as a single patch for easier reviewing. Rewrite patch log according to Dave's suggestion. Fix code bug in patch 0002 reported by test robot. > > Baoquan He (3): > mm/sparse: Add a static variable nr_present_sections > mm/sparsemem: Defer the ms->section_mem_map clearing > mm/sparse: Optimize memmap allocation during sparse_init() > > mm/sparse-vmemmap.c | 9 +++++---- > mm/sparse.c | 54 +++++++++++++++++++++++++++++++++++------------------ > 2 files changed, 41 insertions(+), 22 deletions(-) > > -- > 2.13.6 >