Whamcloud - gitweb
LU-12142 clio: fix hang on urgent cached pages 37/40237/12
authorWang Shilong <wshilong@ddn.com>
Wed, 14 Oct 2020 02:49:49 +0000 (10:49 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 6 Apr 2021 03:01:51 +0000 (03:01 +0000)
commit2a34dc95bd100c181573e231047ff8976e296a36
tree338370dd507ccefc9328af8348a6d3aefa5288ec
parent1058867c004bf19774218945631a691e8210b502
LU-12142 clio: fix hang on urgent cached pages

Few problems addressed by this patch:

1) We try to reserve cl_pages in batch, but we don't do
that for append IO, there is no reason to skip that.

2) IO might be not page aligned, calculate reserved pages
correctly for this case.

3) If we issue one large IO block size which is larger
than max_cached_mb, IO will never be finished, because
we don't have enough cl pages to finish it, split IO
in this case.

4) Readahead should fail if we are short of LRU page
slots to avoid deadlock.

After above adjustment, LRU slots are guranteed for normal
buffer write before IO starts, if block size is too large
for max LRU slots, IO will be split.

For extra readahead, don't try hard and quit if we
are short of LRU pages, since readahead could tolerate
errors, applications won't be aware of it.

besides newly added tests, following command with 64M
max_cached_mb setting and don't see client hang any more.

/usr/lib64/openmpi/bin/mpirun --allow-run-as-root -np 12
-wd /mnt/lustre ior -g -e -w -r -b 1g -T 10 -F -C -t 64m

Todo:
Performance benchmark for readahead

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I5c85454a40daeefb4fb97609d6aa28df2eafb99c
Reviewed-on: https://review.whamcloud.com/40237
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/include/lustre_osc.h
lustre/llite/file.c
lustre/llite/rw.c
lustre/llite/vvp_io.c
lustre/lov/lov_io.c
lustre/mdc/mdc_dev.c
lustre/obdclass/cl_io.c
lustre/osc/osc_io.c
lustre/osc/osc_page.c
lustre/tests/sanity.sh