Received: by 10.223.176.5 with SMTP id f5csp345953wra; Thu, 1 Feb 2018 21:54:37 -0800 (PST) X-Google-Smtp-Source: AH8x2248w7SEVLybN3D05mVyWIq9a5vHGJtSXSgJQmWVrhwqJ45wuEc5W85fKKB/I2J2z2AOt07f X-Received: by 2002:a17:902:e65:: with SMTP id 92-v6mr31668634plw.148.1517550877012; Thu, 01 Feb 2018 21:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517550876; cv=none; d=google.com; s=arc-20160816; b=JxLFZERos06tFUstYRytWOysk1L5uVRRvs5CSBraTwyAaXmZjEhdkE85UtifFNpYze SOb44Ry3UPwu1V3wY0azJVUqcDiPlrxN7NLgYbWOMn/NpV03QmDNnUOvTVQBdK+ZOqi2 GyW2ZhZKX+eqtuwVu6FfHTuiGeKDQO98MvPwBx3xSITHf9rZLCuw03eNT8r/DJuAT3uH plis//UTFkqGhdDmwag2PvUmt0lKFzDcd8A63BxGC6iWRfMNpjr55oKXtTBS/GRNBQOP Vq568VKHNvXpGr2ll77sAC7M2SWEUJFLAAyjhEDzgubkq6uvDGmD689J0pHk+DTucAny KAqw== 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:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=+WL2UO9mnnvNDJnO9sl1HZDrGJoWkeM4eAezJhyfAMY=; b=wqAY8CO62MxCmext3aMTeBYCK0+ZeGjc+LME/KFqljmZsN6vDfghuEUbAJMQAimduq wofWT3AamKh1xdwsVjdeNczliQPRxlpZshs4/KYC0vtU7mFayY2hSEBjvvpY7vMaTDkC JwJQF2tVNCMVcMJAUtyPPmkL70tUuMwXxgDGfnXWEgUHtp3WkChXsKprU2cX3eYkY1Lv LFGwBv5gPMuLIJ2FNjz/9WNAg0emvhw3KVWv8U+S+6TSXBT0dkfIrWUFbZ0093Cgxbz0 WGsVAa5aRBYvUHzLpA5Ds8nPx0uLoWXkInmWuElFCypVAn0Z09InLSWWqyIQgCgjgvx2 PF3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=oKq9hbhD; dkim=pass header.i=@codeaurora.org header.s=default header.b=oKq9hbhD; 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 l6si935670pgp.5.2018.02.01.21.54.21; Thu, 01 Feb 2018 21:54:36 -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=oKq9hbhD; dkim=pass header.i=@codeaurora.org header.s=default header.b=oKq9hbhD; 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 S1750871AbeBBFxh (ORCPT + 99 others); Fri, 2 Feb 2018 00:53:37 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:34822 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbeBBFxb (ORCPT ); Fri, 2 Feb 2018 00:53:31 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id F0AFC6085F; Fri, 2 Feb 2018 05:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517550810; bh=xBCQEH5J6J6wFLlDgZG+f9ig5SQS604LP2oh6iqFmZ4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oKq9hbhDJfOLPPrBhaE8Y9vJpOQ4sjyZKlOP9MxG2ju3qyjt+l5mb6+Jmn8NFB7Ke d4hL6fNAggFqUcyf2OrM+Ssw1pZspO/zEr682Oxofs+R8neAoB0e/rEQZZMHe3f1RA bykQWnNgx4pVH1I7uCirg+qDkG/d+HTYZAQ8jtGQ= 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 [10.204.100.248] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (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 237FC6050D; Fri, 2 Feb 2018 05:53:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517550810; bh=xBCQEH5J6J6wFLlDgZG+f9ig5SQS604LP2oh6iqFmZ4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oKq9hbhDJfOLPPrBhaE8Y9vJpOQ4sjyZKlOP9MxG2ju3qyjt+l5mb6+Jmn8NFB7Ke d4hL6fNAggFqUcyf2OrM+Ssw1pZspO/zEr682Oxofs+R8neAoB0e/rEQZZMHe3f1RA bykQWnNgx4pVH1I7uCirg+qDkG/d+HTYZAQ8jtGQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 237FC6050D 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] of: cache phandle nodes to decrease cost of of_find_node_by_phandle() To: Frank Rowand , Rob Herring Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" References: <1517429142-25727-1-git-send-email-frowand.list@gmail.com> <5dd35d8f-c430-237e-9863-2e73556f92ec@gmail.com> <4f2b3755-9ef1-4817-7436-9f5aafb38b60@gmail.com> From: Chintan Pandya Message-ID: Date: Fri, 2 Feb 2018 11:23:26 +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: <4f2b3755-9ef1-4817-7436-9f5aafb38b60@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 2/2/2018 2:39 AM, Frank Rowand wrote: > On 02/01/18 06:24, Rob Herring wrote: >> And so >> far, no one has explained why a bigger cache got slower. > > Yes, I still find that surprising. I thought a bit about this. And realized that increasing the cache size should help improve the performance only if there are too many misses with the smaller cache. So, from my experiments some time back, I looked up the logs and saw the access pattern. Seems like, there is *not_too_much* juggling during look up by phandles. See the access pattern here: https://drive.google.com/file/d/1qfAD8OsswNJABgAwjJf6Gr_JZMeK7rLV/view?usp=sharing Sample log is pasted below where number in the last is phandle value. Line 8853: [ 37.425405] OF: want to search this 262 Line 8854: [ 37.425453] OF: want to search this 262 Line 8855: [ 37.425499] OF: want to search this 262 Line 8856: [ 37.425549] OF: want to search this 15 Line 8857: [ 37.425599] OF: want to search this 5 Line 8858: [ 37.429989] OF: want to search this 253 Line 8859: [ 37.430058] OF: want to search this 253 Line 8860: [ 37.430217] OF: want to search this 253 Line 8861: [ 37.430278] OF: want to search this 253 Line 8862: [ 37.430337] OF: want to search this 253 Line 8863: [ 37.430399] OF: want to search this 254 Line 8864: [ 37.430597] OF: want to search this 254 Line 8865: [ 37.430656] OF: want to search this 254 Above explains why results with cache size 64 and 128 have almost similar results. Now, for cache size 256 we have degrading performance. I don't have a good theory here but I'm assuming that by making large SW cache, we miss the benefits of real HW cache which is typically smaller than our array size. Also, in my set up, I've set max_cpu=1 to reduce the variance. That again, should affect the cache holding pattern in HW and affect the perf numbers. Chintan -- Qualcom India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project