Whamcloud - gitweb
LU-10680 mdd: create gc thread when no current transaction 76/31376/40
authorBruno Faccini <bruno.faccini@intel.com>
Thu, 22 Feb 2018 15:23:18 +0000 (16:23 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 14 Jun 2018 03:53:49 +0000 (03:53 +0000)
commit31fef6845e8be39ae8dfd242714a84001925b7ad
treefb72af778f1141e9b9a381eb44315797b391a6c4
parentf8df907e8aaeaee559f913a68a345011a7aa1f23
LU-10680 mdd: create gc thread when no current transaction

Creating a kthread can't occur during a journal transaction is being
filled because otherwise a deadlock can happen if memory reclaim is
triggered by kthreadd when forking the new thread, and thus I/Os
could be attempted to the same device from shrinkers requiring a new
journal transaction to be started when current could never complete.

Thus this patch moves kthread_run() of gc_task in mdd_trans_stop().

Comment in mdd_changelog_max_idle_time_seq_write() as been updated
to reflect the need to limit the value to about 68 years, to allow
to keep with 32 bits operands for comparison,

As it will go away with recent kernels, get_seconds() usage has
been replaced by calling ktime_get_real_seconds() for user idle
time initialization and comparison.

Also, enable Changelog GC, as it is no longer the default, in
sanity/test_160f sub-test and remove it from ALWAYS_EXCEPT to
reenable it, leaving 160g for LU-10734 reason now. And in
addition, changes in sanity/test_160f have been added to make
it fully DNE-compatible.

With this patch, GC-thread can be stopped upon MDT umount, and
remaining orphan ChangeLog records clean-up will occur upon next
restart. New sanity/test_160h sub-test checks this scenario.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I7ec076bc04594b230c57348d7ac92acc58c258e1
Reviewed-on: https://review.whamcloud.com/31376
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_support.h
lustre/mdd/mdd_device.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_lproc.c
lustre/mdd/mdd_trans.c
lustre/tests/sanity.sh