Re: [PATCH] drm: Use idr_init_base(1) when using id==0 for invalid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 19, 2018 at 02:35:38PM +0000, Chris Wilson wrote:
> Quoting Christian König (2018-02-13 13:48:24)
> > Am 12.02.2018 um 18:14 schrieb Ville Syrjälä:
> > > On Mon, Feb 12, 2018 at 02:55:33PM +0000, Chris Wilson wrote:
> > >> Use the new idr_init_base() function to create an IDR that knows id==0
> > >> is never allocated as it maps to an invalid identifier. By knowing that
> > >> id==0 is invalid, the IDR can start from id=1 instead avoiding the issue
> > >> of having to start each lookup from the zeroth leaf as id==0 is always
> > >> unused (and thus the tree-of-bitmaps indicate that is the first
> > >> available).
> > >>
> > >> References: 6ce711f27500 ("idr: Make 1-based IDRs more efficient")
> > >> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > >> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> > >> Cc: Christian Konig <christian.koenig@xxxxxxx>
> > >> Cc: Dave Airlie <airlied@xxxxxxxxxx>
> > > Yep, looks like all of these pass start==1 to idr_alloc().
> > > Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> > 
> > Acked-by: Christian König <christian.koenig@xxxxxxx> as well.
> > 
> > Probably going to do this for the command submission context handles in 
> > amdgpu as well.
> 
> Thanks for the review, pushed to drm-misc-next.
> 
> As noted, there are probably quite a few more idr's that we can move
> over to idr_init_base(1), e.g. the KMS objects. If someone feels like a
> small task?

I'll type a todo.rst patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux