vfs: add temperature calculation function

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add map info update function

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add aging function

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add one work queue

  Add a per-superblock workqueue and a delayed_work
to run periodic work to update map info on each superblock.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add FS hot type support

  Introduce one way to enable that specific FS
can inject its own hot tracking type.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: register one shrinker

  Register a shrinker to control the amount of
memory that is used in tracking hot regions - if we are throwing
inodes out of memory due to memory pressure, we most definitely are
going to need to reduce the amount of memory the tracking code is
using, even if it means losing useful information (i.e. the shrinker
accelerates the aging process).

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add one ioctl interface

  FS_IOC_GET_HEAT_INFO: return a struct containing the various
metrics collected in hot_freq_data structs, and also return a
calculated data temperature based on those metrics. Optionally, retrieve
the temperature from the hot data hash list instead of recalculating it.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add debugfs support

  Add a /sys/kernel/debug/hot_track/<device_name>/ directory for each
volume that contains two files. The first, `inode_stats', contains the
heat information for inodes that have been brought into the hot data map
structures. The second, `range_stats', contains similar information for
subfile ranges.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
proc: add two hot_track proc files

  Add two proc files hot-kick-time and hot-update-delay
under the dir /proc/sys/fs/ in order to turn
TIME_TO_KICK and HEAT_UPDATE_DELAY into be tunable.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
btrfs: add hot tracking support

  Introduce one new mount option '-o hot_track',
and add its parsing support.
  Its usage looks like:
   mount -o hot_track
   mount -o nouser,hot_track
   mount -o nouser,hot_track,loop
   mount -o hot_track,nouser

Reviewed-by:   David Sterba <dsterba@suse.cz>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
vfs: add documentation

  Add one doc for VFS hot tracking feature

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
btrfs: add hot relocation support

  Add hot relocation support on top of VFS hot tracking,
and introduces one new mount option '-o hot_track',
and will enable hot tracking function automatically.
  Its syntax looks like:
    mount -o hot_move
    mount -o nouser,hot_move
    mount -o nouser,hot_move,loop
    mount -o hot_move,nouse

Signed-off-by: Ben Chociej <bchociej@gmail.com>
Signed-off-by: Matt Lupfer <mlupfer@gmail.com>
Signed-off-by: Conor Scott <conscott@vt.edu>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>