Received: by 10.223.176.5 with SMTP id f5csp3215959wra; Mon, 29 Jan 2018 10:19:17 -0800 (PST) X-Google-Smtp-Source: AH8x224HMlWoItD1dJIOfuR0eENhTcV+N39K0R/L5+550zAdI+iXAvCp80Q2wqlT8jxcZ/43JLJN X-Received: by 10.98.192.10 with SMTP id x10mr28001866pff.27.1517249957534; Mon, 29 Jan 2018 10:19:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517249957; cv=none; d=google.com; s=arc-20160816; b=WOzhJIvD9H4uRAlgQmjXXntNFbQp6D+ktJ+aLKltq9LD1rJ/aRhSh2Zs4HJlq6fjGf LK8fSvVf4+fR9pKr5TRSKQNpFmjlQBJhiHx+kXZnMwrLQDtwpO6u1xgl7fUl6N/fe6OU y1WGH1t0D8y2iBaWxIMpLqXZysAo0Jb92BH12gF2vlGCxHiwerCOGFvuHBNSGAdsqgqc I2bnhc5Lmvh4v4VCNa1w/2U5IHaD19AcqCzIpFrrc2oeGvN0x4KZ6mc887CU4hbTVofQ rFKrkaSjpNkDgqQEqh9Kxx7LbUzA0zqtpxOY/U4lOf0dGHYyJgVtbziu/XcNzZmU7+yn dyuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=aHNveIK3d31r0jgRr9gA47OwYI1XwTXyg5cMREH3uYI=; b=xOFgKJtLGlIuXL1Cq87c679bD4vLTNlHV0BgEXSf1fEbvRBWNDnxvqENKIyKNn8mLp 3yYK9D0I/tSIp5+LQFM/3OgszG1Sc/5CjNB+eZi6tZ4Obd0/AreKuYzArXQqraObexCK 61Q6bF5FApUvKFEwUGp1Wb9pW2b5CHRQmWpHVkeOf3Oba1Vy1TOGuUqs86i0aCXyBMdz Qb+TDj0ZwtqS7T0SW3sHKJE3fyfzJ5hd1SK5+rKy5GwflnbKXIDdvt7p7LUd7Il6jef/ UmWWkgeZoHV3qcrIUYYJIobeWSmSGJBB21q47+KZIzjhMzvRt6Cihig7/fVatLguCTZB vtzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=W7AJIwla; dkim=pass header.i=@codeaurora.org header.s=default header.b=W7AJIwla; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j61-v6si9780849plb.108.2018.01.29.10.19.02; Mon, 29 Jan 2018 10:19:17 -0800 (PST) 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=@codeaurora.org header.s=default header.b=W7AJIwla; dkim=pass header.i=@codeaurora.org header.s=default header.b=W7AJIwla; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751541AbeA2SSn (ORCPT + 99 others); Mon, 29 Jan 2018 13:18:43 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43846 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbeA2SSl (ORCPT ); Mon, 29 Jan 2018 13:18:41 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 46F396079C; Mon, 29 Jan 2018 18:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517249921; bh=yJ3cqd7dE+7rV8ABVulb6LJKRd26RIUbBMHBZ3mkO80=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=W7AJIwlaOWqnim8jZ6bysd0egfpztwofsBxEyyA/Sd9pXtJsEAn32kEsNoFVaTM9j Hg6t7cg6Cec7ALaGJmPvgpxDGV+BFdy7xtrOEZeQyyFAKldLazk+mU88rvWYNZaVq7 NWQHllwevbx6mgrPb6WDnojrjxXsGof51u6xmY/A= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.2.11] (unknown [183.83.202.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cpandya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0505A601D9; Mon, 29 Jan 2018 18:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517249921; bh=yJ3cqd7dE+7rV8ABVulb6LJKRd26RIUbBMHBZ3mkO80=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=W7AJIwlaOWqnim8jZ6bysd0egfpztwofsBxEyyA/Sd9pXtJsEAn32kEsNoFVaTM9j Hg6t7cg6Cec7ALaGJmPvgpxDGV+BFdy7xtrOEZeQyyFAKldLazk+mU88rvWYNZaVq7 NWQHllwevbx6mgrPb6WDnojrjxXsGof51u6xmY/A= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0505A601D9 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=cpandya@codeaurora.org Subject: Re: [PATCH v2] of: use hash based search in of_find_node_by_phandle To: Rob Herring Cc: Rasmus Villemoes , Frank Rowand , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , linux-arm-msm References: <1516955496-17236-1-git-send-email-cpandya@codeaurora.org> <20180126213943.7zwijanlbrq3y666@rob-hp-laptop> From: Chintan Pandya Message-ID: <85e2f338-0475-dff0-f8e9-6ab06db23a3b@codeaurora.org> Date: Mon, 29 Jan 2018 23:48:35 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> Scenarios: >> [1] Cache size 1024 + early cache build up [Small change in your cache >> patch, >> see the patch below] >> [2] Hash 64 approach[my original v2 patch] >> [3] Cache size 64 >> [4] Cache size 128 >> [5] Cache size 256 >> [6] Base build >> >> Result (boot to shell in sec): >> [1] 14.292498 14.370994 14.313537 --> 850ms avg gain >> [2] 14.340981 14.395900 14.398149 --> 800ms avg gain >> [3] 14.546429 14.488783 14.468694 --> 680ms avg gain >> [4] 14.506007 14.497487 14.523062 --> 670ms avg gain >> [5] 14.671100 14.643344 14.731853 --> 500ms avg gain > It's strange that bigger sizes are slower. Based on this data, I'd pick [3]. > > How many phandles do you have? I thought it was hundreds, so 1024 > entries would be more than enough and you should see some curve to a > max gain as cache size approaches # of phandles. > 1063 phandles for my device. In one of the previous mails, I estimated it to be few hundreds but I wastoo short of actual number. However, 1063 still doesn't justify why [4] and [5] are notbetter than [3]. I would still be interested to find out a way to dynamically allocate array with size near to total # of phandles with pre-stored mapping. And free this array once done with it. But at present, no idea how will I achieve this. If you can share any pointers around this, that would help ! Thanks, Chintan Pandya -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project