From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934553AbeB1UTL (ORCPT ); Wed, 28 Feb 2018 15:19:11 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:45996 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934107AbeB1UTJ (ORCPT ); Wed, 28 Feb 2018 15:19:09 -0500 X-Google-Smtp-Source: AG47ELtvjUkT3OaP0Q6qEtODEpj8D1BEi/8DHK0nPHmmbb7RIyek2sXsCVM085DCMlXljnnOsCvB4NFQI0+VTiNEjiY= 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: Andy Shevchenko Date: Wed, 28 Feb 2018 22:19:08 +0200 Message-ID: Subject: Re: [PATCH v4 1/2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle() To: Frank Rowand Cc: Rob Herring , cpandya@codeaurora.org, 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 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? -- With Best Regards, Andy Shevchenko