• Vivek Goyal's avatar
    dax: Create a range version of dax_layout_busy_page() · 6bbdd563
    Vivek Goyal authored
    virtiofs device has a range of memory which is mapped into file inodes
    using dax. This memory is mapped in qemu on host and maps different
    sections of real file on host. Size of this memory is limited
    (determined by administrator) and depending on filesystem size, we will
    soon reach a situation where all the memory is in use and we need to
    reclaim some.
    
    As part of reclaim process, we will need to make sure that there are
    no active references to pages (taken by get_user_pages()) on the memory
    range we are trying to reclaim. I am planning to use
    dax_layout_busy_page() for this. But in current form this is per inode
    and scans through all the pages of the inode.
    
    We want to reclaim only a portion of memory (say 2MB page). So we want
    to make sure that only that 2MB range of pages do not have any
    references  (and don't want to unmap all the pages of inode).
    
    Hence, create a range version of this function named
    dax_layout_busy_page_range() which can be used to pass a range which
    needs to be unmapped.
    
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: linux-nvdimm@lists.01.org
    Cc: Jan Kara <jack@suse.cz>
    Cc: Vishal L Verma <vishal.l.verma@intel.com>
    Cc: "Weiny, Ira" <ira.weiny@intel.com>
    Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
    Reviewed-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    6bbdd563
dax.c 46.4 KB