Yes, you are correct. It should only be necessary to set fileHeatPeriodMinutes, since the loss percent does have a default value.
But IIRC (I implemented part of this!) you must restart the daemon to get those fileheat parameter(s) "loaded"and initialized into the daemon processes.
Not fully trusting my memory... I will now "prove" this works today as follows:
To test, create and re-read a large file with dd...
[root@/main/gpfs-git]$mmchconfig fileHeatPeriodMinutes=60
mmchconfig: Command successfully completed
...
[root@/main/gpfs-git]$mmlsconfig | grep -i heat
fileHeatPeriodMinutes 60
[root@/main/gpfs-git]$mmshutdown
...
[root@/main/gpfs-git]$mmstartup
...
[root@/main/gpfs-git]$mmmount c23
...
[root@/main/gpfs-git]$ls -l /c23/10g
-rw-r--r--. 1 root root 10737418240 May 16 15:09 /c23/10g
[root@/main/gpfs-git]$mmlsattr -d -X /c23/10g
file name: /c23/10g
security.selinux
(NO fileheat attribute yet...)
[root@/main/gpfs-git]$dd if=/c23/10g bs=1M of=/dev/null
...
After the command finishes, you may need to wait a while for the metadata to flush to the inode on disk ... or you can force that with an unmount or a mmfsctl...
Then the fileheat attribute will appear (I just waited by answering another email... No need to do any explicit operations on the file system..)
[root@/main/gpfs-git]$mmlsattr -d -X /c23/10g
file name: /c23/10g
security.selinux
gpfs.FileHeat
To see its hex string value:
[root@/main/gpfs-git]$mmlsattr -d -X -L /c23/10g
file name: /c23/10g
...
security.selinux: 0x756E636F6E66696E65645F753A6F626A6563745F723A756E6C6162656C65645F743A733000
gpfs.FileHeat: 0x000000EE42A40400
Which will be interpreted by mmapplypolicy...
YES, the interpretation is relative to last access time and current time, and done by a policy/sql function "computeFileHeat"
(You could find this using m4 directives in your policy file...)
define([FILE_HEAT],[computeFileHeat(CURRENT_TIMESTAMP-ACCESS_TIME,xattr('gpfs.FileHeat'),KB_ALLOCATED)])
Well gone that far, might as well try mmapplypolicy too....
[root@/main/gpfs-git]$cat /gh/policies/fileheat.policy
define(DISPLAY_NULL,[CASE WHEN ($1) IS NULL THEN '_NULL_' ELSE varchar($1) END])
rule fh1 external list 'fh' exec ''
rule fh2 list 'fh' weight(FILE_HEAT) show(DISPLAY_NULL(xattr_integer('gpfs.FileHeat',1,4,'B')) || ' ' ||
DISPLAY_NULL(xattr_integer('gpfs.FileHeat',5,2,'B')) || ' ' ||
DISPLAY_NULL(xattr_integer('gpfs.FileHeat',7,2,'B')) || ' ' ||
DISPLAY_NULL(FILE_HEAT) || ' ' ||
DISPLAY_NULL(hex(xattr('gpfs.FileHeat'))) || ' ' ||
getmmconfig('fileHeatPeriodMinutes') || ' ' ||
getmmconfig('fileHeatLossPercent') || ' ' ||
getmmconfig('clusterName') )
[root@/main/gpfs-git]$mmapplypolicy /c23 --maxdepth 1 -P /gh/policies/fileheat.policy -I test -L 3
...
<1> /c23/10g RULE 'fh2' LIST 'fh' WEIGHT(0.022363) SHOW( 238 17060 1024 +2.23632812500000E-002 000000EE42A40400 60 10 makaplan.sl.cloud9.ibm.com)
...
WEIGHT(0.022363) LIST 'fh' /c23/10g SHOW(238 17060 1024 +2.23632812500000E-002 000000EE42A40400 60 10 makaplan.sl.cloud9.ibm.com)Jan-Frode Myklebust ---08/13/2019 06:22:46 AM---What about filesystem atime updates. We recently changed the default to «relatime». Could that maybe
From: Jan-Frode Myklebust <janfrode@tanso.net>
To: gpfsug main discussion list <gpfsug-discuss@spectrumscale.org>
Date: 08/13/2019 06:22 AM
Subject: [EXTERNAL] Re: [gpfsug-discuss] Fileheat
Sent by: gpfsug-discuss-bounces@spectrumscale.org