Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4724377imm; Mon, 20 Aug 2018 23:16:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyRiUHS11ndISv5sCvtdTonddNST3+v9MQn6dZpL5607cwSkiXB7W6vACp+YRD0f5h+74X8 X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr15306840plh.78.1534832182744; Mon, 20 Aug 2018 23:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534832182; cv=none; d=google.com; s=arc-20160816; b=ADIEY8kdFrVwHVAFNw8N6om12KIw49nkKQVwYIcLvr1jkdyobFbUKlx46XTmOhWdx/ LTbGZyNEEfV8ce2GdHN1PujX4Ft31A2myAFDZsbNYNrzLHLylUPOf+fFCE6kbLlibXXQ itC2PQh4Rzwzbxl7qymVu0UewHPq2NP4YUIdVH1AeHIFYnKz7lUwP1IuRolyI1xG/UWN +vY5BMHIrdknEgc8Bzi3SvVK4uKKT7RncOLo37Pq4BXVcDzPN2QjgX/CQt6oBcdWuLOH w5deHrGEpPHdKxgs5RbM4dn9d8MwowQQxoqRbJ7a/tdL4RR6CDg/zuqxcSvK2hkjjrNz mmmg== 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=unQ+pnnxANGHld+IlR5H9wWUpJ24FvE5ObGs1mxr09k=; b=FA97GkI/l4QkkMaF10WuaQklxt9mmSdxs856kEZIiJ3Fg63B05MIaWHXSOUnAmy04K PMML7ul85YSLLu3aKaccgzfbYx2fVxoaJYxiJQRRosV93Ds6PK8MsUDPV5M1/PP2n/Xd /Kbbz7Mh7ALMAj4agGkrJH/5GQv2EZxL3+RLcCcowVpWAD7rs8aW4Snx+h6NWHZzQRkX nIiY++luukRKWzM0NAspLsgK//e4eb+M2aniVrkEsvGyzBiFozMb4SwpBz5+uBKBax8q SGsFEB8AS7eYqv/gFZ5O/gt9NCQZyHToNFHwCcTZNnUFWkx6mAucv4RxqSvumr6z2QwU 4GrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y113vv7i; 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 t1-v6si13013407pfm.7.2018.08.20.23.16.05; Mon, 20 Aug 2018 23:16:22 -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=Y113vv7i; 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 S1726628AbeHUJdh (ORCPT + 99 others); Tue, 21 Aug 2018 05:33:37 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44009 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbeHUJdh (ORCPT ); Tue, 21 Aug 2018 05:33:37 -0400 Received: by mail-pf1-f196.google.com with SMTP id j26-v6so7972374pfi.10 for ; Mon, 20 Aug 2018 23:14:53 -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=unQ+pnnxANGHld+IlR5H9wWUpJ24FvE5ObGs1mxr09k=; b=Y113vv7ilmGejea2cODmbZ2YTdwbskS3nuguyiMUXWNELZGMsTvjAa/L37Z/FX0gSO 5Ynr0Ca2W63YKhSaTG0c7EvI8kQgZNkb/aJIJfyIgDH/crlTpX6Lh9NR9KYhoJQ1dC3Q 3jG8PdQiAs9lXNrtRVPjaKE9vHcjOo1dOvm5ftOr04PSUhUyZF1hZ7dQCmYRRy6kfblM ur1FiONnnz+68pgd0NVtuQlHRM5aQ6EllpP/Bl5uZWq7/2aC2r4M5pJ1CVEw/BOxlYlt JkBGcinw/bMD03HZwB8xQyNcSXYulh1UmS8o7RfOYj4pDfE18QBjpAagVWs2/r+mRjRY 1PlA== 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=unQ+pnnxANGHld+IlR5H9wWUpJ24FvE5ObGs1mxr09k=; b=EkkNcwbzQoPDeWuzwJTWFAJ+TFyFeKVcsTkjqFuf+NQIRwbjEIEWuI3TnovEXEKFTk gRtA/9OSryYylW0ljsLFzvPrmDLS8AO1Zfmnn/Ww6gGrfAo5Wuujt6raCmOpVmIi4IBx /kI3D/vn+dvtR1+09j4eHbUaoYQIJyTKO4mlTF5Ett/axwzQgez9vTJv2ob8DNzfZMV9 O1Kvo7ImbAfs+KYrR0JRUdPipt1e1gowYx4AIhdkGu0+Mg+5nzD+pxo5cyy0aThnJjo1 7WUj9HlwMzEsWBU4I8fyQIzRVEgP6LCoq0qFWPuC42i8nKHl/jj5jkUEwRA5U3ABJt81 OTUA== X-Gm-Message-State: AOUpUlF8cc9WNIx8fKBkaDdpFhqY2RmhtvXb9vBIEWQ0grhO4E++L4ON rKO7azt0Z3nM2WZoph3xbDA= X-Received: by 2002:a63:6343:: with SMTP id x64-v6mr15872460pgb.173.1534832093593; Mon, 20 Aug 2018 23:14:53 -0700 (PDT) Received: from [0.0.0.0] (96.45.178.72.16clouds.com. [96.45.178.72]) by smtp.gmail.com with ESMTPSA id x24-v6sm15261745pfh.67.2018.08.20.23.14.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 23:14:52 -0700 (PDT) Subject: Re: [RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn() To: Pasha Tatashin , Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , Andrew Morton , Michal Hocko Cc: Wei Yang , Kees Cook , Laura Abbott , Vladimir Murzin , Philip Derrin , AKASHI Takahiro , James Morse , Steve Capper , Pavel Tatashin , Gioh Kim , Vlastimil Babka , Mel Gorman , Johannes Weiner , Kemi Wang , Petr Tesarik , YASUAKI ISHIMATSU , Andrey Ryabinin , Nikolay Borisov , Daniel Jordan , Daniel Vacek , Eugeniu Rosca , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Jia He References: <1530867675-9018-1-git-send-email-hejianet@gmail.com> <1530867675-9018-4-git-send-email-hejianet@gmail.com> <61ca29b9-a985-cce0-03e9-d216791c802c@microsoft.com> From: Jia He Message-ID: <334337ca-811e-4a2e-09ff-65ebe37ef6df@gmail.com> Date: Tue, 21 Aug 2018 14:14:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <61ca29b9-a985-cce0-03e9-d216791c802c@microsoft.com> 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 Pasha On 8/17/2018 9:08 AM, Pasha Tatashin Wrote: > >> Signed-off-by: Jia He >> --- >> mm/memblock.c | 37 +++++++++++++++++++++++++++++-------- >> 1 file changed, 29 insertions(+), 8 deletions(-) >> >> diff --git a/mm/memblock.c b/mm/memblock.c >> index ccad225..84f7fa7 100644 >> --- a/mm/memblock.c >> +++ b/mm/memblock.c >> @@ -1140,31 +1140,52 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size, >> #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ >> >> #ifdef CONFIG_HAVE_MEMBLOCK_PFN_VALID >> +static int early_region_idx __init_memblock = -1; > > One comment: > > This should be __initdata, but even better bring it inside the function > as local static variable. > Seems it should be __initdata_memblock instead of __initdata? -- Cheers, Jia >> ulong __init_memblock memblock_next_valid_pfn(ulong pfn) >> { > > Otherwise looks good: > > Reviewed-by: Pavel Tatashin >