Whamcloud - gitweb
LU-12225 obdclass: improve jobid memory reclaim policy 08/35008/2
authorWang Shilong <wshilong@ddn.com>
Mon, 29 Apr 2019 13:13:59 +0000 (21:13 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Jun 2019 02:39:01 +0000 (02:39 +0000)
commitcffbcfd60b4a55387e968c92c8f6cfeb0d17a35f
tree91f84ab5739ce8877e8c9664882fc439450fb88f
parentf94aecf16859e2e0dcd999eb8862227e50671ee8
LU-12225 obdclass: improve jobid memory reclaim policy

jobid_should_free_item() will be called in following three
cases to decide whether @pidmap should be deleted from hash list:

1) expire normal timeout and memory reclaimer called to
try free some items.

2) admin echo sys interface to free some jobid.

3) Umount client to free all memory.

For case 2 && 3, it makes sense we always return 1,
add a warn_on in case3 to make sure there isn't any
bug in the codes.

For the case1, we could change policy a bit to not
return 1 if reference count of @pidmap is larger than 1,
a common case is a newly added @pidmap is easily freed
from hash list with current policy.

Actually, even we delete @pidmap from hash list, memory
will be eventually freed with its references count reached
1, and it is very likely we deleted and inserted @pidmap
again since this could be a hot and long runtime job.

Lustre-change: https://review.whamcloud.com/34775
Lustre-commit: 3e9fedfa7ea52a03a1975572ab37cc1ae9344a8a

Change-Id: I61b894a900319953d5a3369bee69bda050102129
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35008
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/jobid.c