Received: by 10.223.185.116 with SMTP id b49csp6645615wrg; Wed, 28 Feb 2018 12:59:50 -0800 (PST) X-Google-Smtp-Source: AG47ELvDz1Dj5UXkEZ5yKf/ry1LCy9UKhgSIi+AgsyozsSE/DyDeEiQyI8ItGubccDnKcGrRiikN X-Received: by 2002:a17:902:7044:: with SMTP id h4-v6mr7369477plt.378.1519851590724; Wed, 28 Feb 2018 12:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519851590; cv=none; d=google.com; s=arc-20160816; b=vsROSYRKRDXMqOBsZYMNkHLBBxGtgyeK5TZEjZlXEKW2lSGxb3eHV8b2GaKiok7HgF VPTPgirZ9X6b+zKlqr0kIxbR9S/KLsyUAf/EIaVmX37EGqqfjGbexZGxPjh3KF2AsJN2 zTANN8yEHcjJZGKz2QYv4WCC71QL/6G3LPyVrXyOM76yodvwcKDZcsrohVXKawG+Gl2w 3+ioUuUktEe2/ZA01TSO6i4UWkpyu+TkdRqjd0B3coEC/CDxASL6bhbkG20C9zFL9pw9 y/6WmQMC3JYVuhd9AvL8hW+mUE0tEYvlfO+YLQyBWDA2keitDW/BNWOe1QBhsNSJfMci OdtQ== 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=Wq1HlQOgleFaQBwgnuJvfb86Ym7pDWOMV9hibXBeyis=; b=DdpmAjRF4IWPId8uY1JtR4Dk7mWI76dUR2lzUxCrmCwCr0APYcy1RqHlbSLJfoDRbN aVS9UA59BlzkQ1Dij40u0fdTDqXjye/VrTtfxydycxLNFFpti5YW5VLDvEKQ1h7+8Dub As7RdCmCS31BgiZ482nthbn54xG8i72Y3e+S4C5w8/CdIcDIj+g7JNC9jLZ5oU13eUY5 fiCznz86CQwnd/t9afRIv+mktlAcOnEzl9FWsl6Kek0NZkDAwfaxPVHQhppHVwrzdhb+ nqg0WIR9lemFFyzeRh9Q3bVdaGwnEc/PnQlN49obOO+4kpGQomXUmNJ4+yP8suDWAd/A uMYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XcG2AyZl; 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 g1si1423840pge.831.2018.02.28.12.59.29; Wed, 28 Feb 2018 12:59:50 -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=XcG2AyZl; 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 S934866AbeB1U6g (ORCPT + 99 others); Wed, 28 Feb 2018 15:58:36 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46474 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934825AbeB1U6Y (ORCPT ); Wed, 28 Feb 2018 15:58:24 -0500 Received: by mail-pl0-f66.google.com with SMTP id y8-v6so2247070pll.13; Wed, 28 Feb 2018 12:58:24 -0800 (PST) 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=Wq1HlQOgleFaQBwgnuJvfb86Ym7pDWOMV9hibXBeyis=; b=XcG2AyZlmGVgWUdnm3S13u1URiHt50Yz7bK5FXRNugq7efaXJbGbONBl5bISwxCXKQ 73OfquG/izrpOZPm1c8CZSmMNDYadVYBstX9nhA3BiQGw3uhVoj+LrpjQ3jTfiY6No5K U7A38WE7zHAGKcJk724KIZBA8LTqFhwFgaLQIMXA0F0hvRNrHgq8jpEICxuO6un6fyZn XzamTP4NERWEs3gXZB+hKcsrhmcMpNOMTxr/c7vMBa9HDJlpIUGucLsm4qVt+E9dOZAp beM4xAPvIyLhpNmQaYXvquZJFQCvFDt63lZgEF7D6ekT3Suo8OVCudkEyyNLsGd/Ls5a 74Ug== 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=Wq1HlQOgleFaQBwgnuJvfb86Ym7pDWOMV9hibXBeyis=; b=Q86JkQIyWqD7H9jD//hmfjawubcAe00dpakHGOF5Bn9SgsR39Ov1hQVdGR4Lfu+ad2 O2+Lo7myxjmQ8/u+QrFrQpqut8M68LDSFi2xdJfFMcpZouUQUCrX1t8FiK7sUXWSnHU6 13MyT7zDfX3HEnazZKQspzrmog2VbjJMWj1H1fYgpOg3WOfEoR6aoy4gsscFfaWaFL10 QEDqcVviy6sOBmoQb8O4IIpdRCC8jsjcN/AEyLgiE9EH97fp1Zy3wIKmDwiZ8XMlvPpn gWJULQE+qOL/YjXEYcUkKFnZtlH0EpJprWO/yv157iN4d7kIp6lNr5lpN0VF3SLqKN4x A9Jg== X-Gm-Message-State: APf1xPAEpHLqo1CQ/kCkemi+qMYhO6KZYEQcd0/ugzOh4kLDOlfEM4mh JNX5YkG54qTMEVSQgN1pwL+dDEwD X-Received: by 2002:a17:902:7c84:: with SMTP id y4-v6mr19117758pll.305.1519851504129; Wed, 28 Feb 2018 12:58:24 -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 14sm5772499pfi.132.2018.02.28.12.58.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 12:58:23 -0800 (PST) Subject: Re: [PATCH v4 1/2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle() To: Andy Shevchenko Cc: Rob Herring , cpandya@codeaurora.org, devicetree , Linux Kernel Mailing List References: <1519844656-16443-1-git-send-email-frowand.list@gmail.com> <1519844656-16443-2-git-send-email-frowand.list@gmail.com> From: Frank Rowand Message-ID: <9a078531-74ba-55f8-0dd1-961504b306b4@gmail.com> Date: Wed, 28 Feb 2018 12:58:22 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.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 02/28/18 12:19, Andy Shevchenko wrote: > On Wed, Feb 28, 2018 at 9:44 PM, Frank Rowand wrote: >> On 02/28/18 11:31, Andy Shevchenko wrote: >>> On Wed, Feb 28, 2018 at 9:04 PM, wrote: > >>> The question is why O(1) is so important? O(log(n)) wouldn't work? >> >> O(1) is not critical. It was just a nice side result. >> >> >>> Using radix_tree() I suppose allows to dynamically extend or shrink >>> the cache which would work with DT overlays. >> >> The memory usage of the phandle cache in this patch is fairly small. >> The memory overhead of a radix_tree() would not be justified. > > OTOH the advantage I mentioned isn't a good argument? No. Deleting and re-creating the cache to resize it (when applying an overlay) would be a rare event that would happen as desired by the overlay application code. There is no real gain by having extension or shrinkage occur automatically and if the overlay application code desires the resizing it is trivial to implement (a single function call).