Skip to content

Commit

Permalink
virtiofs: add logic to free up a memory range
Browse files Browse the repository at this point in the history
Add logic to free up a busy memory range. Freed memory range will be
returned to free pool. Add a worker which can be started to select
and free some busy memory ranges.

Process can also steal one of its busy dax ranges if free range is not
available. I will refer it to as direct reclaim.

If free range is not available and nothing can't be stolen from same
inode, caller waits on a waitq for free range to become available.

For reclaiming a range, as of now we need to hold following locks in
specified order.

	down_write(&fi->i_mmap_sem);
	down_write(&fi->dax->sem);

We look for a free range in following order.

A. Try to get a free range.
B. If not, try direct reclaim.
C. If not, wait for a memory range to become free

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
rhvgoyal authored and Miklos Szeredi committed Sep 4, 2020
1 parent d7217b7 commit ddca99b
Show file tree
Hide file tree
Showing 3 changed files with 524 additions and 6 deletions.

0 comments on commit ddca99b

Please sign in to comment.