[Intel-gfx] [PATCH 5/6] drm/i915: Split batch pool into size buckets
Chris Wilson
chris at chris-wilson.co.uk
Thu Mar 19 14:09:37 PDT 2015
On Thu, Mar 19, 2015 at 05:35:35PM +0000, Tvrtko Ursulin wrote:
> >- list_for_each_entry_safe(tmp, next,
> >- &pool->cache_list, batch_pool_list) {
> >+ n = fls(size >> PAGE_SHIFT) - 1;
>
> Is this better in some way that size / PAGE_SIZE - 1? Or I went from
> trusting compiler smartness to little to too much? :)
The month has 31 days in it, we use >> PAGE_SHIFT, otherwise /
PAGE_SIZE. Note the fls() puts these into power-of-two buckets not pure
page-count buckets.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list