Whamcloud - gitweb
LU-18588 obdclass: keep track of cl_page's bufsize 65/57565/9
authorBobi Jam <bobijam@whamcloud.com>
Fri, 20 Dec 2024 15:01:01 +0000 (23:01 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 22 Feb 2025 23:40:53 +0000 (23:40 +0000)
commitd49d897ff293621673ee8dab9efc8c8fd0a0d0dc
treef82d185bf3cc1dcd2fbe8a0e8cd290deeaa14fc8
parentd6e4f2843b6fe3a6bb3821d732d9bf9354c51cc8
LU-18588 obdclass: keep track of cl_page's bufsize

When a cl_page is allocated, the slab cache size to be used is a
rounding-up value of the cl_object's coh_page_bufsize, while the
object's coh_page_bufsize could change if the layout is changed,
and when the cl_page on the LRU list got shrank, cl_page_free()
would find that its bufsize does not match the current
coh_page_bufsize value.

LustreError: 949:0:(cl_page.c:178:__cl_page_free()) ASSERTION(
cl_page_kmem_size_array[index] == bufsize) failed:
      lbug_with_loc.cold+0x5/0x58 [libcfs]
      __cl_page_free+0x1c2/0x260 [obdclass]
      cl_page_free+0x96/0x4d0 [obdclass]
      cl_batch_put+0x1ac/0x3d0 [obdclass]
      discard_cl_pages+0x99/0x150 [osc]
      osc_lru_shrink+0x34a/0x930 [osc]
      lru_queue_work+0xea/0x220 [osc]
      work_interpreter+0x32/0x170 [ptlrpc]
      ptlrpc_check_set+0x40e/0x1ef0 [ptlrpc]
      ptlrpcd_check+0x3b4/0x5a0 [ptlrpc]
      ptlrpcd+0x1ba/0x4d0 [ptlrpc]

This patch would keep track of the page's bufsize by referring
to cl_page_kmem_size_array if its in the array or reusing
cp_kmem_index to store its bufsize.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I433a5601851da3c3d9ec8578005a262f29e979ea
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57565
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/obdclass/cl_page.c