Whamcloud - gitweb
LU-13419 osc: Move shrink update to per-write 14/38214/6
authorPatrick Farrell <farr0186@gmail.com>
Mon, 13 Apr 2020 16:23:42 +0000 (11:23 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 14 Jun 2021 16:43:33 +0000 (16:43 +0000)
Updating the grant shrink interval is currently done for
each page submitted, rather than once per write.  Since
the grant shrink interval is in seconds, this is
unnecessary.

This came up because this function showed up in the perf
traces for https://review.whamcloud.com/#/c/38151/, and
it is called with the cl_loi_list_lock held.

Note that this change makes this access to the grant shrink
interval a 'dirty' access, without locking, but the grant
shrink interval is:
A) Already accessed like this in various places, and
B) can safely be out of date or suffer a lost update
without affecting correctness or performance.

IOR performance testing with this test:
mpirun -np 36 $IOR -o $LUSTRE -w -t 1M -b 2G -i 1 -F

No patches:
5942 MiB/s
With 38151:
14950 MiB/s
With 38151+this:
15320 MiB/s

Signed-off-by: Patrick Farrell <farr0186@gmail.com>
Change-Id: I8110b3c2570c183d58be2bccdbf76813ea3e373a
Reviewed-on: https://review.whamcloud.com/38214
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_cache.c
lustre/osc/osc_io.c

index 21bc5f1..9d3d22b 100644 (file)
@@ -1370,7 +1370,6 @@ static void osc_consume_write_grant(struct client_obd *cli,
        pga->flag |= OBD_BRW_FROM_GRANT;
        CDEBUG(D_CACHE, "using %lu grant credits for brw %p page %p\n",
               PAGE_SIZE, pga, pga->pg);
-       osc_update_next_shrink(cli);
 }
 
 /* the companion to osc_consume_write_grant, called when a brw has completed.
index 0038286..07f45bf 100644 (file)
@@ -357,6 +357,11 @@ int osc_io_commit_async(const struct lu_env *env,
                        pagevec_reinit(pvec);
                }
        }
+       /* The shrink interval is in seconds, so we can update it once per
+        * write, rather than once per page.
+        */
+       osc_update_next_shrink(osc_cli(osc));
+
 
        /* Clean up any partially full pagevecs */
        if (pagevec_count(pvec) != 0)