xen-blkback: implement LRU mechanism for persistent grants
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 17 Apr 2013 18:18:57 +0000 (20:18 +0200)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 18 Apr 2013 13:29:23 +0000 (09:29 -0400)
commit3f3aad5e6686ed49242bbf86de378b39f119ec9d
treebe9ab4bdda11d09a33722b0a276b141069e946c8
parentc6cc142dac52e62e1e8a2aff5de1300202b96c66
xen-blkback: implement LRU mechanism for persistent grants

This mechanism allows blkback to change the number of grants
persistently mapped at run time.

The algorithm uses a simple LRU mechanism that removes (if needed) the
persistent grants that have not been used since the last LRU run, or
if all grants have been used it removes the first grants in the list
(that are not in use).

The algorithm allows the user to change the maximum number of
persistent grants, by changing max_persistent_grants in sysfs.

Since we are storing the persistent grants used inside the request
struct (to be able to mark them as "unused" when unmapping), we no
longer need the bitmap (unmap_seg).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xen.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Documentation/ABI/stable/sysfs-bus-xen-backend
drivers/block/xen-blkback/blkback.c
drivers/block/xen-blkback/common.h
drivers/block/xen-blkback/xenbus.c