Whamcloud - gitweb
LU-14187 osd-ldiskfs: fix locking in write commit 91/40991/12
authorWang Shilong <wshilong@ddn.com>
Wed, 16 Dec 2020 07:10:56 +0000 (15:10 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 5 Jan 2021 08:29:08 +0000 (08:29 +0000)
commitf0f92773ee18a9da71cd27e3b5c32e5d318ed0d2
treefa074ef0f88f484dce6b5d2de9090fd7a2e8d742
parent1a2bf911b9793648de3abbc88b9f77eb2237dc50
LU-14187 osd-ldiskfs: fix locking in write commit

Restart transaction in osd layer break rules that
locks are taken afer transaction start.

This patch try to fix by moving transaction restart
to OFD layer.

We will record how many extents we declare with
@oh_declared_ext. And during IO we check if it
run out before we restart whole transaction.

We track an average extent bytes per filesystem and
use it as a hint during declare write commit. This
will avoid us restart transaction ofen if filesystem
is heavily fragmented.

Fixes: 0271b17b ("LU-14134 osd-ldiskfs: reduce credits for new writing")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I289a3a6775befe159b7fef29004eaaaff873e2c6
Reviewed-on: https://review.whamcloud.com/40991
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
libcfs/libcfs/libcfs_mem.c
lustre/include/dt_object.h
lustre/include/lustre_compat.h
lustre/include/obd_support.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/mdt/mdt_io.c
lustre/ofd/ofd_io.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_io.c
lustre/tests/sanity.sh