From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934837AbeB1Uyq (ORCPT ); Wed, 28 Feb 2018 15:54:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:39566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934739AbeB1Uyo (ORCPT ); Wed, 28 Feb 2018 15:54:44 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 191B021771 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=robh+dt@kernel.org X-Google-Smtp-Source: AG47ELu/hygGZQmuc0sEGpn/sdc0ooldDmPkA6lJqSIPmHshLmKKxNMY7BVMbE3f9AFETlB4O/h7zEX9aFc555M5g+M= MIME-Version: 1.0 In-Reply-To: References: <1519844656-16443-1-git-send-email-frowand.list@gmail.com> <1519844656-16443-2-git-send-email-frowand.list@gmail.com> From: Rob Herring Date: Wed, 28 Feb 2018 14:54:22 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle() To: Andy Shevchenko Cc: Frank Rowand , Chintan Pandya , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 28, 2018 at 2:19 PM, 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? Yes, but still one that ignores memory usage. I'll take whatever solution doesn't undo this[1]. Rob [1] https://lwn.net/Articles/735839/