From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C20F9C76191 for ; Wed, 24 Jul 2019 08:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CD8C229FA for ; Wed, 24 Jul 2019 08:33:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726516AbfGXIdV (ORCPT ); Wed, 24 Jul 2019 04:33:21 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:54244 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725870AbfGXIdU (ORCPT ); Wed, 24 Jul 2019 04:33:20 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D5579585EAE5EF849C02; Wed, 24 Jul 2019 16:33:18 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 24 Jul 2019 16:33:16 +0800 Subject: Re: [PATCH v12 2/2] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn To: Mike Rapoport CC: Ard Biesheuvel , Catalin Marinas , , , Jia He , Andrew Morton , Will Deacon , References: <1563861073-47071-1-git-send-email-guohanjun@huawei.com> <1563861073-47071-3-git-send-email-guohanjun@huawei.com> <20190723083353.GC4896@rapoport-lnx> From: Hanjun Guo Message-ID: <868f90c7-a728-9eb3-7529-f5a8a501a76a@huawei.com> Date: Wed, 24 Jul 2019 16:33:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20190723083353.GC4896@rapoport-lnx> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/23 16:33, Mike Rapoport wrote: > On Tue, Jul 23, 2019 at 01:51:13PM +0800, Hanjun Guo wrote: >> From: Jia He >> >> After skipping some invalid pfns in memmap_init_zone(), there is still >> some room for improvement. >> >> E.g. if pfn and pfn+1 are in the same memblock region, we can simply pfn++ >> instead of doing the binary search in memblock_next_valid_pfn. >> >> Furthermore, if the pfn is in a gap of two memory region, skip to next >> region directly to speedup the binary search. > How much speed up do you see with this improvements relatively to simple > binary search in memblock_next_valid_pfn()? The major speedup on my platform is the previous patch in this patch set, not this one, I think it's related to sparse memory mode for different platforms. Thanks Hanjun > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFB91C7618B for ; Wed, 24 Jul 2019 08:33:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94AFB21951 for ; Wed, 24 Jul 2019 08:33:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZOQWrsfy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94AFB21951 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W1z+NDFxkP/UgEanew/6Ppn465Y73HBrtMkLFQjnbGU=; b=ZOQWrsfy6ngU/e ZoPegED+vEpAHt2vKtTr82WSw3UDdJ6tP4Y6SRwJbZjC0Jczv+cqUIi7ZKw4ou8r+pVVmlinUKq4/ Pu0yoKn5406RWzm2LKswFoO8e8voWteCFTW7SnNUlBd8z/AbgN9SzJ8qyOgcGM6fT1b0B3PoW4x5F G8xeLV0s05GaN+sYqljnzCXpHjxu1PsvMsyebngoqF1wkQPm0C8RG1IBohhhxDyb4PfafHdn/qyKi nGG0sBqxXgRiwjAjMfvWpjSuth9ZT6LCKhHLplnWHs63znEkY3n4pQ2sdthBedCJERsPbvwBPdjYy uTKVYSC+2gt+N+Z+E83w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hqCiQ-0004Bq-1x; Wed, 24 Jul 2019 08:33:38 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hqCiC-00040i-0o for linux-arm-kernel@lists.infradead.org; Wed, 24 Jul 2019 08:33:25 +0000 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D5579585EAE5EF849C02; Wed, 24 Jul 2019 16:33:18 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 24 Jul 2019 16:33:16 +0800 Subject: Re: [PATCH v12 2/2] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn To: Mike Rapoport References: <1563861073-47071-1-git-send-email-guohanjun@huawei.com> <1563861073-47071-3-git-send-email-guohanjun@huawei.com> <20190723083353.GC4896@rapoport-lnx> From: Hanjun Guo Message-ID: <868f90c7-a728-9eb3-7529-f5a8a501a76a@huawei.com> Date: Wed, 24 Jul 2019 16:33:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20190723083353.GC4896@rapoport-lnx> Content-Language: en-US X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190724_013324_307096_5A77597D X-CRM114-Status: GOOD ( 10.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Catalin Marinas , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Jia He , Andrew Morton , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2019/7/23 16:33, Mike Rapoport wrote: > On Tue, Jul 23, 2019 at 01:51:13PM +0800, Hanjun Guo wrote: >> From: Jia He >> >> After skipping some invalid pfns in memmap_init_zone(), there is still >> some room for improvement. >> >> E.g. if pfn and pfn+1 are in the same memblock region, we can simply pfn++ >> instead of doing the binary search in memblock_next_valid_pfn. >> >> Furthermore, if the pfn is in a gap of two memory region, skip to next >> region directly to speedup the binary search. > How much speed up do you see with this improvements relatively to simple > binary search in memblock_next_valid_pfn()? The major speedup on my platform is the previous patch in this patch set, not this one, I think it's related to sparse memory mode for different platforms. Thanks Hanjun > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel