Received: by 10.223.176.46 with SMTP id f43csp1195790wra; Fri, 26 Jan 2018 13:36:43 -0800 (PST) X-Google-Smtp-Source: AH8x227+dnLd7bBDL/IN1bB1aMR8YBQYbIn7mxxqKrYaeHZ/kGjqvh6g0DzuXWXQg9jP34w3vbbd X-Received: by 2002:a17:902:523:: with SMTP id 32-v6mr7843971plf.283.1517002603776; Fri, 26 Jan 2018 13:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517002603; cv=none; d=google.com; s=arc-20160816; b=uyprfHY/LS5W7Pa0AS3w8f4m7MNDR0l7b6o1h9d2AyAztwgWObYTX5M74Z1Wc2BB2q 2zvWW91m2dKI8LyIaqzAEsZpzqgQ1p+VGIvDfH+ClElZTuxG8HK+ZA9Ab/7p9kMo3xg3 J/R6qieiSWsFOycKjQBR8xjWVG6mWYa2lFIOOSxIX/6ABHkd6A/NWQqO5yc66GkUREZP wQy1EiHNPbv9OhQ9P02VTPLiK5hoP7JiTE73IJ6NxNc+iYO1RUw4VY4lu8MsOBgZANJs Yr6mD8aOwULaicYP2b7RQAmkTPpCidj1cGD8seZ+Tgh7Dtr+NESp8n4pqpc/u5XCfk+n LJAg== 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:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=NwIMkyxBnsJA0h5uRhVG9BY1x3laNhwjwsYHLPeL2kY=; b=IW60pYYdjmUEFW9GGc0F9iap8dV7SKkpv1tTkaW3zw59ufm/Gka9o+ujOVhQg/AKjf srZE7RaOOjLCMPgB7Rj8meiAV8GCBpd21++17lwjfd57Sw0+hBa/wyHm7jIpEmzPExeC rPuZ0/H5zp/GBPY8R+/iXaZN2MrtDrqlF/FSFOiGDuraE8OSUtzZYZpwTCeAG/htBO0G blBWhMavkPCuE95nXRRJrVXwHC0PkOVR3XUK2ApmMgycLjFzTqJ7Ow+I85ugoTxGSDoy CcG1f4jpfFX3zuu+Uu9ZJMsY+XY6ssSXVNzEqXnL3N/lfkDCRG5a7eOE8pdw517XLZq7 lSgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q7aqEgA9; 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=NONE 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 x18si3472935pgv.124.2018.01.26.13.36.29; Fri, 26 Jan 2018 13:36:43 -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=@gmail.com header.s=20161025 header.b=q7aqEgA9; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbeAZVey (ORCPT + 99 others); Fri, 26 Jan 2018 16:34:54 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:41680 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbeAZVew (ORCPT ); Fri, 26 Jan 2018 16:34:52 -0500 Received: by mail-pg0-f65.google.com with SMTP id 136so1041706pgd.8; Fri, 26 Jan 2018 13:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NwIMkyxBnsJA0h5uRhVG9BY1x3laNhwjwsYHLPeL2kY=; b=q7aqEgA9ZJz/kpVE8IK5yYI3CVBcD2dd9YuygBCFHtZpFi6MA14Ef3mBThoNLMy8ph VaKjgCRAYpooOCmrIDG6O/n4R3yB4BLZ63z8ELuAfotPW/hn+JEPOYguAf2BR9k5Opt7 GnTD9if3UpMNH6hrIpazvpy2BoE0pTa3pZL5+rzyd1BALpNTzs2fJ8oDNsGuTALu7GDW yqSfChG+RBe1RC5RmY0jH/vUlVuK25PBrhTYGj6j3s+wZwZxzjiHtD4laIchcwfKRa9+ KIytHbT21FpCpR64fRQDbCNE7RyZtf59wcyV4o5KJThVY7aWmoRFx1Z7U6FuCWwZrbyT cnvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NwIMkyxBnsJA0h5uRhVG9BY1x3laNhwjwsYHLPeL2kY=; b=GObmHbOXWM8LV5ZJUFoanUX/Pgc6vDl8POIXq0xlnbIs3C4KHhTaXVijAJoxKi3xCK PnZwG1UzbUhu22olF1uMzEo6cqtUA553TQkatGeztB9xIkAVSQKx3GwmlF5sQN6q0FS1 e5MTh9930qjgQzOHXgCoVqwNs6IQLotz2dqW0+JEa+79ng2V/b0dKNvOHmsJG+0/3jVY l+i9D3A8jtW4TmDrTtksQp/g7yt7gIQ8A3xKQDLHUGbE7unTxk4goAt6izNsCpBywEi6 kFQI0sUs/bM89E6AyHIgbjamIZquDPpveLqpktw/k1WcCe5eAjFpMiYSilSmBDa2g78B yADA== X-Gm-Message-State: AKwxytdnBtacq25qscTgMTA9l8g28WMCk0Xv1dMFhUK82NS2PJTpljwS i2BVfkkZcN1Dbvpw6XHCrPs= X-Received: by 2002:a17:902:4:: with SMTP id 4-v6mr15158647pla.187.1517002491955; Fri, 26 Jan 2018 13:34:51 -0800 (PST) Received: from [192.168.1.70] (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id 204sm2845328pfu.44.2018.01.26.13.34.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 13:34:51 -0800 (PST) Subject: Re: [PATCH] of: use hash based search in of_find_node_by_phandle From: Frank Rowand To: Chintan Pandya , robh+dt@kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <1516875247-19599-1-git-send-email-cpandya@codeaurora.org> <5a7793df-725e-608d-778b-cb81fde0cc64@gmail.com> <13846fcb-3aa2-a4fb-1bd8-e624855f105d@codeaurora.org> <2ac0d70d-074d-5eff-77e9-29d1a246a3ef@gmail.com> Message-ID: <42ea456e-6728-cdf6-4cfe-f3de352216f4@gmail.com> Date: Fri, 26 Jan 2018 13:34:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/18 13:29, Frank Rowand wrote: > On 01/26/18 13:27, Frank Rowand wrote: >> On 01/26/18 00:22, Chintan Pandya wrote: >>> >>> >>> On 1/26/2018 1:24 AM, Frank Rowand wrote: >>>> On 01/25/18 02:14, Chintan Pandya wrote: >>>>> of_find_node_by_phandle() takes a lot of time finding >>>>> right node when your intended device is too right-side >>>>> in the fdt. Reason is, we search each device serially >>>>> from the fdt, starting from left-most to right-most. >>>> Please give me a pointer to the code that is doing >>>> this search. >>>> >>>> -Frank >>> You can refer include/linux/of.h >>> >>> #define for_each_of_allnodes_from(from, dn) \ >>>         for (dn = __of_find_all_nodes(from); dn; dn = __of_find_all_nodes(dn)) >>> #define for_each_of_allnodes(dn) for_each_of_allnodes_from(NULL, dn) >>> >>> where __of_find_all_nodes() does >>> >>> struct device_node *__of_find_all_nodes(struct device_node *prev) >>> { >>>         struct device_node *np; >>>         if (!prev) { >>>                 np = of_root; >>>         } else if (prev->child) { >>>                 np = prev->child; >>>         } else { >>>                 /* Walk back up looking for a sibling, or the end of the structure */ >>>                 np = prev; >>>                 while (np->parent && !np->sibling) >>>                         np = np->parent; >>>                 np = np->sibling; /* Might be null at the end of the tree */ >>>         } >>>         return np; >>> } >>> >> >> Let me restate my question. >> >> Can you point me to the driver code that is invoking >> the search? >> >> -Frank >> > > And also the .dts devicetree source file that you are seeing > large overhead with. > Sorry about dribbling out questions instead of all at once.... What is the hardware you are testing this on? Processor? Cache size? Memory size? Processor frequency? Any other attribute of the system that will help me understand the boot performance you are seeing? Thanks, Frank