From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757079AbbJVJCg (ORCPT ); Thu, 22 Oct 2015 05:02:36 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:57432 "EHLO mx0a-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756481AbbJVJCd (ORCPT ); Thu, 22 Oct 2015 05:02:33 -0400 Date: Thu, 22 Oct 2015 09:44:42 +0100 From: Charles Keepax To: Nikesh Oswal CC: , , , , , Nikesh Oswal Subject: Re: [PATCH] regmap: rbtree: When adding a reg do a bsearch for target node Message-ID: <20151022084442.GE10520@ck-lbox> References: <1445433374-2603-1-git-send-email-nikesh@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1445433374-2603-1-git-send-email-nikesh@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-10-22_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1510220148 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2015 at 02:16:14PM +0100, Nikesh Oswal wrote: > From: Nikesh Oswal If you are going to use your non-opensource email, might as well use the cirrus one here. > > A binary search is much more efficient rather than iterating > over the rbtree in ascending order which the current code is > doing. > > During initialisation the reg defaults are written to the > cache in a large chunk and these are always sorted in the > ascending order so for this situation ideally we should have > iterated the rbtree in descending order. > > But at runtime the drivers may write into the cache in any > random order so this patch selects to use a bsearch to give > an optimal runtime performance and also at initialisation > time when reg defaults are written the performance of binary > search would be much better than iterating in ascending order > which the current code was doing. > > Signed-off-by: Nikesh Oswal > --- Patch looks fine to me though: Reviewed-by: Charles Keepax Thanks, Charles