Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-20 Thread Liu Bo
On Thu, Sep 20, 2018 at 06:49:59PM +0200, David Sterba wrote: > On Thu, Aug 23, 2018 at 03:51:48AM +0800, Liu Bo wrote: > > Several structs in btrfs are using rb_first() in a while loop, it'd be > > more efficient to do this with rb_first_cached() which has the O(1) > > complexity. > > > > This

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-20 Thread David Sterba
On Thu, Aug 23, 2018 at 03:51:48AM +0800, Liu Bo wrote: > Several structs in btrfs are using rb_first() in a while loop, it'd be > more efficient to do this with rb_first_cached() which has the O(1) > complexity. > > This patch set updates five structs which may have a large rb tree in > practice

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-20 Thread David Sterba
On Fri, Sep 14, 2018 at 12:14:57PM -0700, Liu Bo wrote: > On Fri, Sep 14, 2018 at 05:11:02PM +0200, David Sterba wrote: > > On Tue, Sep 11, 2018 at 11:31:49AM -0700, Liu Bo wrote: > > > On Tue, Sep 11, 2018 at 05:34:03PM +0200, David Sterba wrote: > > > > On Thu, Aug 23, 2018 at 03:51:48AM +0800,

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-14 Thread Liu Bo
On Fri, Sep 14, 2018 at 05:11:02PM +0200, David Sterba wrote: > On Tue, Sep 11, 2018 at 11:31:49AM -0700, Liu Bo wrote: > > On Tue, Sep 11, 2018 at 05:34:03PM +0200, David Sterba wrote: > > > On Thu, Aug 23, 2018 at 03:51:48AM +0800, Liu Bo wrote: > > > > Several structs in btrfs are using

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-14 Thread David Sterba
On Tue, Sep 11, 2018 at 11:31:49AM -0700, Liu Bo wrote: > On Tue, Sep 11, 2018 at 05:34:03PM +0200, David Sterba wrote: > > On Thu, Aug 23, 2018 at 03:51:48AM +0800, Liu Bo wrote: > > > Several structs in btrfs are using rb_first() in a while loop, it'd be > > > more efficient to do this with

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-11 Thread Liu Bo
On Tue, Sep 11, 2018 at 05:34:03PM +0200, David Sterba wrote: > On Thu, Aug 23, 2018 at 03:51:48AM +0800, Liu Bo wrote: > > Several structs in btrfs are using rb_first() in a while loop, it'd be > > more efficient to do this with rb_first_cached() which has the O(1) > > complexity. > > We'd like

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-09-11 Thread David Sterba
On Thu, Aug 23, 2018 at 03:51:48AM +0800, Liu Bo wrote: > Several structs in btrfs are using rb_first() in a while loop, it'd be > more efficient to do this with rb_first_cached() which has the O(1) > complexity. We'd like to see some numbers, though just by reading the code I think there's going

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-08-23 Thread Nikolay Borisov
On 22.08.2018 22:51, Liu Bo wrote: > Several structs in btrfs are using rb_first() in a while loop, it'd be > more efficient to do this with rb_first_cached() which has the O(1) > complexity. > > This patch set updates five structs which may have a large rb tree in > practice > > Liu Bo (5):

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-08-23 Thread Holger Hoffstätte
On 08/22/18 21:51, Liu Bo wrote: Several structs in btrfs are using rb_first() in a while loop, it'd be more efficient to do this with rb_first_cached() which has the O(1) complexity. This patch set updates five structs which may have a large rb tree in practice Great idea, works for me with

Re: [PATCH 0/5] rb_first to rb_first_cached conversion

2018-08-22 Thread Qu Wenruo
On 2018/8/23 上午3:51, Liu Bo wrote: > Several structs in btrfs are using rb_first() in a while loop, it'd be > more efficient to do this with rb_first_cached() which has the O(1) > complexity. I'm a little curious about such rb_first() inside loop usage. What I can find is mostly deletion +

[PATCH 0/5] rb_first to rb_first_cached conversion

2018-08-22 Thread Liu Bo
Several structs in btrfs are using rb_first() in a while loop, it'd be more efficient to do this with rb_first_cached() which has the O(1) complexity. This patch set updates five structs which may have a large rb tree in practice Liu Bo (5): Btrfs: href_root: use rb_first_cached Btrfs: