Skip to content
Snippets Groups Projects
  • Bruno Faccini's avatar
    31fef684
    LU-10680 mdd: create gc thread when no current transaction · 31fef684
    Bruno Faccini authored
    
    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: default avatarBruno Faccini <bruno.faccini@intel.com>
    Change-Id: I7ec076bc04594b230c57348d7ac92acc58c258e1
    Reviewed-on: https://review.whamcloud.com/31376
    
    
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
    Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
    31fef684
    History
    LU-10680 mdd: create gc thread when no current transaction
    Bruno Faccini authored
    
    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: default avatarBruno Faccini <bruno.faccini@intel.com>
    Change-Id: I7ec076bc04594b230c57348d7ac92acc58c258e1
    Reviewed-on: https://review.whamcloud.com/31376
    
    
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
    Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
mdd_device.c 53.27 KiB