Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp624632imm; Mon, 2 Jul 2018 19:01:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ3nV+oo4ApcqM8f1OAxa9Po9d8yF/vmln7JFiAezCyD5O0+lZEy/A5b7+Y3/Jx+Fb5e8gK X-Received: by 2002:a17:902:1566:: with SMTP id b35-v6mr28313563plh.107.1530583314114; Mon, 02 Jul 2018 19:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530583314; cv=none; d=google.com; s=arc-20160816; b=kJcp6ct6YZxy1bhCdHl6AdICyxlPcUT2boe1eAbVPg9kQFHpLBlGJw6ZNYMCTuKtpT ZNzutOm7Rb5suCxhzt5Yo1GoHbsJ4JeSv8t7xeH2FH7FvL7lpRms+Id5qqzBWD0IjCpM bFbFBRRGiqoeOzsW8Nd37U4gE88UAFQkBeJAXAbHSyLaQbJvCUmFPkRQVpf07KDwrjmD Y05rz2UwBdiiqMP0egbR44lYnFbvcO+v5jGBKOZav0q65kCP+LAZyv30oM14gKAC4HZx p5Q5917ILiiigWuBMddKOW1eVP+wypBVRJjoZr0g4Y3TuZ7MVdFbWBOUj4I77s70k9Iu rszw== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature:arc-authentication-results; bh=haX6QmtiDZtjBII6V7n5ZZh8GVHhCw23vd3sL1p09Ec=; b=qhEkJF1KUozohtOfTVKcQgpXD+tWaT7oECZ8nX8QCHM9g+k0GC1XTwZcsucXV9jnDE VjcZLsDIpLvOf6q5wgwhRTQYw2A1Pifbt+jBFePdAMPEwdDPK+pdQbn0U4jsK1bD3TJD WhSbtvW70mBDzrRR+s75jIHTQdnU2BsD0T1m/lQNMUpRFqxMH5t2Ie3jJ28Q2vxLbg4w J5gzv1+NjyFdEd03j8DPvzs9mvOoK1d9BsOUWmDD5hgYygt3pfOrDSfkgnG4PA5KCYxU kPjBaChl1Ci5LCqDfwoQdeshSIH7CC9iGQBeulxEtQ642VewSC5uEZ1jvy/x6RDudQLo /WIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YR1u9s8W; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6-v6si4377186pgz.592.2018.07.02.19.01.38; Mon, 02 Jul 2018 19:01:54 -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=@gmail.com header.s=20161025 header.b=YR1u9s8W; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753631AbeGCCA6 (ORCPT + 99 others); Mon, 2 Jul 2018 22:00:58 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39380 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085AbeGCCA5 (ORCPT ); Mon, 2 Jul 2018 22:00:57 -0400 Received: by mail-pf0-f193.google.com with SMTP id s21-v6so194956pfm.6 for ; Mon, 02 Jul 2018 19:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=haX6QmtiDZtjBII6V7n5ZZh8GVHhCw23vd3sL1p09Ec=; b=YR1u9s8WSs30Z4Erx2y31bez0pjb34ipyUjJ0Ozjikn3LptogmO6Ojvw+4UflDDCyI o56zKyuJLZO4xVStpoAX3830JExi6fVS6KS2bGIxY0lyntE/zSUZBHtclCYCMfwQcLmR RAGLqQ/TWGyKb9gZkFGPu9EZcC2EqM3lIQTcokx2FnKVgd5UhwplErXjObn+U7lZEElq Je4J6XOeNl8kFEHGTTPBfmU22kOan76AS3efXkUDrSCt+oaxHsF2hSs/55zii+LfQA0a lBU9AGe3Ny3ZtEhWIrybiH5BLxDKcEaWbc8P9A4mOXdWuckhcIC3w1Tt2w/7QaOs8Ec1 Kpjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=haX6QmtiDZtjBII6V7n5ZZh8GVHhCw23vd3sL1p09Ec=; b=rdJFarOxtgs9zaNhxGtKfahyWfQjERMIPVPKU8walJnRzsATiUXb0dFkaMVKVxOyXz m1iuKA4dFjjnc2qo/fbuQhILNtyCHgjEEGV6iZI1k28S5XkhBXGrgai3CX5MpQg5GbjC YHouboF33lxZFyLvXp1iHCIWQ2DHfDrIVw0YllY7SUCpCQtYA+8BjESfL9R8jiINSaH7 KQ5gRHQSy0oPcJWT+VnF0tWd8+cF5MsNNFs6A+LwtGvuiWMQp6dAcF1O8mbYm1QsJ7K/ WJDrH1MsFUR3pEG0Q1lbN5dlvPHmMeAsxLjhi0iOmgOGSTO8Yt7xXb+liuoRHbvno1xu KYiQ== X-Gm-Message-State: APt69E07hE8QZ29Bu9T6ZOijhR+J10r96oJRZ8zfrdqV4ZTjW+Z98kRH JMGAvFO5ra0cQqHHDzXQGFw= X-Received: by 2002:a62:2ec1:: with SMTP id u184-v6mr27826859pfu.184.1530583256551; Mon, 02 Jul 2018 19:00:56 -0700 (PDT) Received: from [0.0.0.0] (65.49.234.56.16clouds.com. [65.49.234.56]) by smtp.gmail.com with ESMTPSA id n18-v6sm10779091pge.37.2018.07.02.19.00.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 19:00:55 -0700 (PDT) Subject: Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64 To: Michal Hocko 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 References: <1530239363-2356-1-git-send-email-hejianet@gmail.com> <20180702114037.GJ19043@dhcp22.suse.cz> From: Jia He Message-ID: <1466b490-76f8-86a4-f39a-3bef3bb0501f@gmail.com> Date: Tue, 3 Jul 2018 10:00:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180702114037.GJ19043@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal Thanks for the comments On 7/2/2018 7:40 PM, Michal Hocko Wrote: > 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. Ok > >> >> 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? hmm.. Currently my answer is no. But I believe it can shorten the boot time when the memory is larger than n TBs. -- Cheers, Jia > [...] >> 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 >