Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3789919imm; Mon, 2 Jul 2018 05:44:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJrX2Aw6SQnekFIIqbQLf51Ai7CtWPnJSbWccZLxLfkOL9mI/jDdPhcn+id7Pr8SnET5Mgk X-Received: by 2002:a65:5581:: with SMTP id j1-v6mr22276933pgs.203.1530535482728; Mon, 02 Jul 2018 05:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530535482; cv=none; d=google.com; s=arc-20160816; b=dQpYdOjvZ/O43WrAe/Qh5tvmROABn0ksLwZzJjF8kJRgEvbY7sTch3pfXH5At18kpG v0qZ+gYqhn7xZ35tbddcI8CvjK1QuJqMWXaCSKiW+bwamoMkNMrIRbyDL/ZGimzwD5gZ q3h6UMg4T5H74cJ489LbIZc9TDpj1Zj+DGdKjifYssn+3gW4GhNdYiUEn865Qv6B4+Gq IPZMiBZIlNNM7rsTRnxVIlugsIubb+YPfX+Z/oujsITx4nWPqR7r8JG/gFWm3ysgdALi uSRquTb4bdJUrraNXlcgNfpC3FpvPDuno1o2XcyVDzZLEkEQv9nzcE4U5dYL0gqS5b6O 5xQA== 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=C0TcJWosjSxkL+Ykc9kQjsd2KYgFAlQjv9lb0NbmKsY=; b=lPBCxwLRZ0fFvZ+CTN3UinWnUujAu9OTdaPVbWtzTmHT3cJ42nAyLa6kyEP0ktLCmp +baUf83I6XhuG2elzNV/NhjmPmAVnRF/qpao74udSDcj9p9+c2KCBlIUMJAlRKbKIrcx qRiqP0sG3gBB9ifd7msmQwv4ojepWzejpexu8CIZsvvI3NJ1IOKPvrDFXdazfPoLHfGe FN9r9v2J4FknlRW0EMvtzcBHENpcnt4KN6szU1FewccGeRPrHJStj+nkIr7IUll8MrcH kirr81cfi9fiTYK1JxkWAtXm1kS89fXVZXygpnRyODyQDJ/MmXbAOtWr/KI2fASEm7Lm rTpg== 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 m11-v6si13379840pgq.601.2018.07.02.05.44.28; Mon, 02 Jul 2018 05:44: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 S1754420AbeGBLkl (ORCPT + 99 others); Mon, 2 Jul 2018 07:40:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:50920 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753397AbeGBLkk (ORCPT ); Mon, 2 Jul 2018 07:40:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1DC02AF46; Mon, 2 Jul 2018 11:40:39 +0000 (UTC) Date: Mon, 2 Jul 2018 13:40:37 +0200 From: Michal Hocko To: Jia He Cc: Russell King , Andrew Morton , Catalin Marinas , Mel Gorman , Will Deacon , Mark Rutland , "H. Peter Anvin" , Pavel Tatashin , Daniel Jordan , AKASHI Takahiro , Gioh Kim , Steven Sistare , Daniel Vacek , Eugeniu Rosca , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, James Morse , Ard Biesheuvel , Steve Capper , Thomas Gleixner , Ingo Molnar , Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , Johannes Weiner , Kemi Wang , Petr Tesarik , YASUAKI ISHIMATSU , Andrey Ryabinin , Nikolay Borisov , richard.weiyang@gmail.com Subject: Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64 Message-ID: <20180702114037.GJ19043@dhcp22.suse.cz> References: <1530239363-2356-1-git-send-email-hejianet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530239363-2356-1-git-send-email-hejianet@gmail.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 Fri 29-06-18 10:29:17, Jia He wrote: > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns > where possible") tried to optimize the loop in memmap_init_zone(). But > there is still some room for improvement. It would be great to shortly describe those optimization from high level POV. > > Patch 1 introduce new config to make codes more generic > Patch 2 remain the memblock_next_valid_pfn on arm and arm64 > Patch 3 optimizes the memblock_next_valid_pfn() > Patch 4~6 optimizes the early_pfn_valid() > > As for the performance improvement, after this set, I can see the time > overhead of memmap_init() is reduced from 27956us to 13537us in my > armv8a server(QDF2400 with 96G memory, pagesize 64k). So this is 13ms saving when booting 96G machine. Is this really worth the additional code? Are there any other benefits? [...] > arch/arm/Kconfig | 4 +++ > arch/arm/mm/init.c | 1 + > arch/arm64/Kconfig | 4 +++ > arch/arm64/mm/init.c | 1 + > include/linux/early_pfn.h | 79 +++++++++++++++++++++++++++++++++++++++++++++++ > include/linux/memblock.h | 2 ++ > include/linux/mmzone.h | 18 ++++++++++- > mm/Kconfig | 3 ++ > mm/memblock.c | 9 ++++++ > mm/page_alloc.c | 5 ++- > 10 files changed, 124 insertions(+), 2 deletions(-) > create mode 100644 include/linux/early_pfn.h -- Michal Hocko SUSE Labs