Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp203033imm; Thu, 16 Aug 2018 18:40:11 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyPmJIeDc7wwEBgtzDmicXUATBOKZ/H53sY8jYi5ZL2zh5z43o4XKWPXqSbZMzt2MvXpjtM X-Received: by 2002:a63:f80a:: with SMTP id n10-v6mr15876229pgh.82.1534470011556; Thu, 16 Aug 2018 18:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534470011; cv=none; d=google.com; s=arc-20160816; b=rZoYbuAVKrXqkjB8rEoc2g8TtaKVMkVL+f/6vGnmNlqKKRsF4Se2kv6OKwsnoP/PoU E/n0VXE68KS0COW9leuEYRY2w5gGCAjztEzlGgT38IFnmpFKKQnx/ZINSVRtUyCUCmkp LWlOBP5QfYT9Bl7bm0iu8nSO98rGkOrqI/GDBNdpgohowv6lvPEea5PQsxxHXEBFeTai x5urPEonj6v5TOx2vJrmCF/6ZcdLUandM+Sr3Ux3gTLtajs2CKCbSjwqC6Qj65WCEdoE TvZoGsvz5xebjD3LD5mOJuJ6ZYZNRK5A7tahAMKEnFLG2KZI+LdwluEgwCVgXLB2j4wl GLAQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=drs5m/Z7it3VsVydjSOV5B8rjYYc2WvfDiZhnSn+YGM=; b=unU4Mkn05E71RzIwUiDhtvsP8bg+ji0uX5VSUgecp/oC2SNCrgfnNkxcizWtHF8UDo A8dDoLE8S04UuANMbU2cgwNQv+dv59octJ9uyP/WvuytSDSej9gkiPO+sER07YcLDgNE lTCUuvRooJLiw95scKhM+OUbGYOeLdRRR/OR6WnVKDUZE9aw5s8lqr521aMq3IL9bFPu wOdQPjGFw56qTOk/6M1AMV0k4k77OqZWezOSLEYg331nKUfAxzqqx2/Jxbo7ir0TjuHq aJf1K73Zg0DfGHhvNTIBPEuLE+l8VdonvU00KUl6iM7T8X1HnNa4dNJQamhZVNKqDr12 jkHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aj4MVkXb; 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 bc6-v6si877832plb.115.2018.08.16.18.39.56; Thu, 16 Aug 2018 18:40: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aj4MVkXb; 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 S1726094AbeHQEjl (ORCPT + 99 others); Fri, 17 Aug 2018 00:39:41 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:35172 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725769AbeHQEjk (ORCPT ); Fri, 17 Aug 2018 00:39:40 -0400 Received: by mail-yb0-f193.google.com with SMTP id o17-v6so1394756yba.2 for ; Thu, 16 Aug 2018 18:38:19 -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-language:content-transfer-encoding; bh=drs5m/Z7it3VsVydjSOV5B8rjYYc2WvfDiZhnSn+YGM=; b=aj4MVkXbf5V3Ra9A1JFwanXjKcqBT5LioL3X75ypz70VRwUZy8HJvY5njUn9tAbi5H 0zWmbY01a56XbN5pwcgXRv26sEmRvT0ux6phrFhX2X603M5zyoB9CEFHOqNLHIOKkPFm ZoMAFNDr5puTJmwmASEs5u+vgaraZvRYnKLNUtk99kCOMo5XKeB54znX9kaSSrrS6rtN KIhVoLnl/kmK+VVNGoQhS11Ll+2/UktrxszoqMBgL1PaibqV75+DJ79rb7Ydm2P4SquD qkblXhukP6Vxm0Y+j37TWiBMAyR6059pr6nn+YvKkdi1ogAPuHXkfBg0qID1QqI1r+30 SKEw== 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-language :content-transfer-encoding; bh=drs5m/Z7it3VsVydjSOV5B8rjYYc2WvfDiZhnSn+YGM=; b=qmPCzMH9P18d9Q1a3NaU1C6hOAj92S6LV2iJxkjS4nxh+86KyTzUURkj7HSg2u1HTj t/ZRq6ylPQadb2J7zhWuBeTQijGaTYANtcO+ZxKrcVRTREk7y7oUIcClJiaGXka9zCDb oyTGhCVUcAN6RLU3tcIhGrv/owuieyDHul5RZl3vZDD9DI9s730BvfkWt7oZm+J6W6Ru uD/bE/3HEQwRWerOSUd2dnrmBjoUU+qRYiUNUOxo+cXVuL0NTM7j2B40eFik13W/safz 9foMudD7uF+bzMO5gOz6tzmihD3uXcbKj9k0WoHmoRxk7mqH93mwMLK3AtNhEcVd+gCn o7zg== X-Gm-Message-State: AOUpUlEm/EqIPpwTXU/IVgxEMgJGOFwrK3I+kBwhDOtYt4dx/d9396GS g2Zqstfg9c3ylJ+ptzEWcCY= X-Received: by 2002:a25:b106:: with SMTP id g6-v6mr7793033ybj.42.1534469898733; Thu, 16 Aug 2018 18:38:18 -0700 (PDT) Received: from [192.168.1.10] (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id x19-v6sm1420286ywg.72.2018.08.16.18.38.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 18:38:18 -0700 (PDT) Subject: Re: [RESEND PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid() To: Pasha Tatashin , Jia He , 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@microsoft.com, 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-7-git-send-email-hejianet@gmail.com> From: Pavel Tatashin Message-ID: <831be9a1-6401-3af0-b68b-b3e25db806f9@gmail.com> Date: Thu, 16 Aug 2018 21:38:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/18 9:35 PM, Pasha Tatashin wrote: > > > On 7/6/18 5:01 AM, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") optimized the loop in memmap_init_zone(). But there is >> still some room for improvement. E.g. in early_pfn_valid(), if pfn and >> pfn+1 are in the same memblock region, we can record the last returned >> memblock region index and check whether pfn++ is still in the same >> region. >> >> Currently it only improve the performance on arm/arm64 and will have no >> impact on other arches. >> >> 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). > > This series would be a lot simpler if patches 4, 5, and 6 were dropped. > The extra complexity does not make sense to save 0.0001s/T during not. s/not/boot > > Patches 1-3, look OK, but without patches 4-5 __init_memblock should be > made local static as I suggested earlier. s/__init_memblock/early_region_idx