Re: [PATCH RFC 06/12] xen-blkback: implement LRU mechanism for persistentgrants

From: Roger Pau Monné
Date: Mon Mar 18 2013 - 13:00:50 EST

On 05/03/13 22:49, Konrad Rzeszutek Wilk wrote:
>>> This could be written a bit differently to also run outside the xen_blkif_schedule
>>> (so a new thread). This would require using the lock mechanism and converting
>>> this big loop to two smaller loops:
>>> 1) - one quick that holds the lock - to take the items of the list,
>>> 2) second one to do the grant_set_unmap_op operations and all the heavy
>>> free_xenballooned_pages call.
>> Yes, I could add a list_head to persistent_gnt, so we can take them out
>> of the red-black tree and queue them in a list to be processed (unmap +
>> free) after we have looped thought the list, without holding the lock.

I've been trying to implement the "purge" on a different kthread, but
I'm not able to get the same performance. Since moving this a different
thread requires additional contention (spinlocks) around the red-black
tree of persistent grants, I think we should leave it as-is right now,
and consider moving it to a different thread if we can get a performance
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at