Re: [PATCH 5/6] drm/i915: Split batch pool into size buckets

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

 




On 03/19/2015 09:09 PM, Chris Wilson wrote:
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.

Yeah silly me.. was thinking about 1-2 page buckets form the commit message only. Perhaps add a comment about bucket sizes above n = fls line if you feel like it. Shouldn't harm.

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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