Skip to content

Commit

Permalink
xen-blkback: implement LRU mechanism for persistent grants
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roger Pau Monne authored and Konrad Rzeszutek Wilk committed Apr 18, 2013
1 parent c6cc142 commit 3f3aad5
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 57 deletions.
10 changes: 10 additions & 0 deletions Documentation/ABI/stable/sysfs-bus-xen-backend
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,13 @@ Contact: Roger Pau Monné <roger.pau@citrix.com>
Description:
Maximum number of free pages to keep in each block
backend buffer.

What: /sys/module/xen_blkback/parameters/max_persistent_grants
Date: March 2013
KernelVersion: 3.10
Contact: Roger Pau Monné <roger.pau@citrix.com>
Description:
Maximum number of grants to map persistently in
blkback. If the frontend tries to use more than
max_persistent_grants, the LRU kicks in and starts
removing 5% of max_persistent_grants every 100ms.
Loading

0 comments on commit 3f3aad5

Please sign in to comment.