lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 3 Feb 2021 04:26:05 +0800
From:   kernel test robot <lkp@...el.com>
To:     "Darrick J. Wong" <darrick.wong@...cle.com>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
        Jan Kara <jack@...e.cz>
Subject: fs/f2fs/gc.c:29:12: warning: stack frame size of 1048 bytes in
 function 'gc_thread_func'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   88bb507a74ea7d75fa49edd421eaa710a7d80598
commit: 9b8523423b23ee3dfd88e32f5b7207be56a4e782 vfs: move __sb_{start,end}_write* to fs.h
date:   3 months ago
config: mips-randconfig-r026-20210202 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 275c6af7d7f1ed63a03d05b4484413e447133269)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9b8523423b23ee3dfd88e32f5b7207be56a4e782
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9b8523423b23ee3dfd88e32f5b7207be56a4e782
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> fs/f2fs/gc.c:29:12: warning: stack frame size of 1048 bytes in function 'gc_thread_func'
   static int gc_thread_func(void
   ^
   fatal error: error in backend: Nested variants found in inline asm string: ' .set push
   .set mips64r2
   .if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/atomic.h", .line = 153, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
   1: ll $0, $1 # atomic_add
   addu $0, $2
   sc $0, $1
   beqz $0, 1b
   .set pop
   '
   clang-13: error: clang frontend command failed with exit code 70 (use -v to see invocation)
   clang version 13.0.0 (git://gitmirror/llvm_project 275c6af7d7f1ed63a03d05b4484413e447133269)
   Target: mips-unknown-linux-gnu
   Thread model: posix
   InstalledDir: /opt/cross/clang-275c6af7d7/bin
   clang-13: note: diagnostic msg:
   Makefile arch drivers fs include kernel scripts source usr


vim +/gc_thread_func +29 fs/f2fs/gc.c

093749e296e29a Chao Yu          2020-08-04   25  
da52f8ade40b03 Jack Qiu         2020-06-18   26  static unsigned int count_bits(const unsigned long *addr,
da52f8ade40b03 Jack Qiu         2020-06-18   27  				unsigned int offset, unsigned int len);
da52f8ade40b03 Jack Qiu         2020-06-18   28  
7bc0900347e069 Jaegeuk Kim      2012-11-02  @29  static int gc_thread_func(void *data)
7bc0900347e069 Jaegeuk Kim      2012-11-02   30  {
7bc0900347e069 Jaegeuk Kim      2012-11-02   31  	struct f2fs_sb_info *sbi = data;
b59d0bae6ca30c Namjae Jeon      2013-08-04   32  	struct f2fs_gc_kthread *gc_th = sbi->gc_thread;
7bc0900347e069 Jaegeuk Kim      2012-11-02   33  	wait_queue_head_t *wq = &sbi->gc_thread->gc_wait_queue_head;
b8c502b81e3f89 Chao Yu          2017-08-07   34  	unsigned int wait_ms;
7bc0900347e069 Jaegeuk Kim      2012-11-02   35  
b59d0bae6ca30c Namjae Jeon      2013-08-04   36  	wait_ms = gc_th->min_sleep_time;
7bc0900347e069 Jaegeuk Kim      2012-11-02   37  
1d7be2708277ed Jaegeuk Kim      2017-05-17   38  	set_freezable();
7bc0900347e069 Jaegeuk Kim      2012-11-02   39  	do {
bbbc34fd666254 Chao Yu          2020-02-14   40  		bool sync_mode;
bbbc34fd666254 Chao Yu          2020-02-14   41  
7bc0900347e069 Jaegeuk Kim      2012-11-02   42  		wait_event_interruptible_timeout(*wq,
d9872a698c393e Jaegeuk Kim      2017-08-06   43  				kthread_should_stop() || freezing(current) ||
d9872a698c393e Jaegeuk Kim      2017-08-06   44  				gc_th->gc_wake,
7bc0900347e069 Jaegeuk Kim      2012-11-02   45  				msecs_to_jiffies(wait_ms));
1d7be2708277ed Jaegeuk Kim      2017-05-17   46  
d9872a698c393e Jaegeuk Kim      2017-08-06   47  		/* give it a try one time */
d9872a698c393e Jaegeuk Kim      2017-08-06   48  		if (gc_th->gc_wake)
d9872a698c393e Jaegeuk Kim      2017-08-06   49  			gc_th->gc_wake = 0;
d9872a698c393e Jaegeuk Kim      2017-08-06   50  
274bd9ba394256 Chao Yu          2018-09-29   51  		if (try_to_freeze()) {
274bd9ba394256 Chao Yu          2018-09-29   52  			stat_other_skip_bggc_count(sbi);
1d7be2708277ed Jaegeuk Kim      2017-05-17   53  			continue;
274bd9ba394256 Chao Yu          2018-09-29   54  		}
7bc0900347e069 Jaegeuk Kim      2012-11-02   55  		if (kthread_should_stop())
7bc0900347e069 Jaegeuk Kim      2012-11-02   56  			break;
7bc0900347e069 Jaegeuk Kim      2012-11-02   57  
d6212a5f18c8f9 Changman Lee     2013-01-29   58  		if (sbi->sb->s_writers.frozen >= SB_FREEZE_WRITE) {
88dd8934194f6d Chao Yu          2015-01-26   59  			increase_sleep_time(gc_th, &wait_ms);
274bd9ba394256 Chao Yu          2018-09-29   60  			stat_other_skip_bggc_count(sbi);
d6212a5f18c8f9 Changman Lee     2013-01-29   61  			continue;
d6212a5f18c8f9 Changman Lee     2013-01-29   62  		}
d6212a5f18c8f9 Changman Lee     2013-01-29   63  
55523519bc7227 Chao Yu          2017-02-25   64  		if (time_to_inject(sbi, FAULT_CHECKPOINT)) {
c45d6002ff7a32 Chao Yu          2019-11-01   65  			f2fs_show_injection_info(sbi, FAULT_CHECKPOINT);
0f34802858e74e Chao Yu          2016-09-26   66  			f2fs_stop_checkpoint(sbi, false);
55523519bc7227 Chao Yu          2017-02-25   67  		}
0f34802858e74e Chao Yu          2016-09-26   68  
274bd9ba394256 Chao Yu          2018-09-29   69  		if (!sb_start_write_trylock(sbi->sb)) {
274bd9ba394256 Chao Yu          2018-09-29   70  			stat_other_skip_bggc_count(sbi);
dc6febb6bcec7f Chao Yu          2017-07-22   71  			continue;
274bd9ba394256 Chao Yu          2018-09-29   72  		}
dc6febb6bcec7f Chao Yu          2017-07-22   73  
7bc0900347e069 Jaegeuk Kim      2012-11-02   74  		/*
7bc0900347e069 Jaegeuk Kim      2012-11-02   75  		 * [GC triggering condition]
7bc0900347e069 Jaegeuk Kim      2012-11-02   76  		 * 0. GC is not conducted currently.
7bc0900347e069 Jaegeuk Kim      2012-11-02   77  		 * 1. There are enough dirty segments.
7bc0900347e069 Jaegeuk Kim      2012-11-02   78  		 * 2. IO subsystem is idle by checking the # of writeback pages.
7bc0900347e069 Jaegeuk Kim      2012-11-02   79  		 * 3. IO subsystem is idle by checking the # of requests in
7bc0900347e069 Jaegeuk Kim      2012-11-02   80  		 *    bdev's request list.
7bc0900347e069 Jaegeuk Kim      2012-11-02   81  		 *
e1c42045203071 arter97          2014-08-06   82  		 * Note) We have to avoid triggering GCs frequently.
7bc0900347e069 Jaegeuk Kim      2012-11-02   83  		 * Because it is possible that some segments can be
7bc0900347e069 Jaegeuk Kim      2012-11-02   84  		 * invalidated soon after by user update or deletion.
7bc0900347e069 Jaegeuk Kim      2012-11-02   85  		 * So, I'd like to wait some time to collect dirty segments.
7bc0900347e069 Jaegeuk Kim      2012-11-02   86  		 */
0e5e81114de1c4 Daeho Jeong      2020-07-02   87  		if (sbi->gc_mode == GC_URGENT_HIGH) {
d9872a698c393e Jaegeuk Kim      2017-08-06   88  			wait_ms = gc_th->urgent_sleep_time;
fb24fea75ca5ce Chao Yu          2020-01-14   89  			down_write(&sbi->gc_lock);
d9872a698c393e Jaegeuk Kim      2017-08-06   90  			goto do_gc;
d9872a698c393e Jaegeuk Kim      2017-08-06   91  		}
d9872a698c393e Jaegeuk Kim      2017-08-06   92  
fb24fea75ca5ce Chao Yu          2020-01-14   93  		if (!down_write_trylock(&sbi->gc_lock)) {
274bd9ba394256 Chao Yu          2018-09-29   94  			stat_other_skip_bggc_count(sbi);
69babac019337b Jaegeuk Kim      2018-02-26   95  			goto next;
274bd9ba394256 Chao Yu          2018-09-29   96  		}
69babac019337b Jaegeuk Kim      2018-02-26   97  
a7d10cf3e4e3e3 Sahitya Tummala  2018-09-19   98  		if (!is_idle(sbi, GC_TIME)) {
88dd8934194f6d Chao Yu          2015-01-26   99  			increase_sleep_time(gc_th, &wait_ms);
fb24fea75ca5ce Chao Yu          2020-01-14  100  			up_write(&sbi->gc_lock);
274bd9ba394256 Chao Yu          2018-09-29  101  			stat_io_skip_bggc_count(sbi);
dc6febb6bcec7f Chao Yu          2017-07-22  102  			goto next;
7bc0900347e069 Jaegeuk Kim      2012-11-02  103  		}
7bc0900347e069 Jaegeuk Kim      2012-11-02  104  
7bc0900347e069 Jaegeuk Kim      2012-11-02  105  		if (has_enough_invalid_blocks(sbi))
88dd8934194f6d Chao Yu          2015-01-26  106  			decrease_sleep_time(gc_th, &wait_ms);
7bc0900347e069 Jaegeuk Kim      2012-11-02  107  		else
88dd8934194f6d Chao Yu          2015-01-26  108  			increase_sleep_time(gc_th, &wait_ms);
d9872a698c393e Jaegeuk Kim      2017-08-06  109  do_gc:
fc7100ea2a52fc Hridya Valsaraju 2020-01-22  110  		stat_inc_bggc_count(sbi->stat_info);
7bc0900347e069 Jaegeuk Kim      2012-11-02  111  
bbbc34fd666254 Chao Yu          2020-02-14  112  		sync_mode = F2FS_OPTION(sbi).bggc_mode == BGGC_MODE_SYNC;
bbbc34fd666254 Chao Yu          2020-02-14  113  
437275272f9e63 Jaegeuk Kim      2013-02-04  114  		/* if return value is not zero, no victim was selected */
bbbc34fd666254 Chao Yu          2020-02-14  115  		if (f2fs_gc(sbi, sync_mode, true, NULL_SEGNO))
b59d0bae6ca30c Namjae Jeon      2013-08-04  116  			wait_ms = gc_th->no_gc_sleep_time;
81eb8d6e2869b1 Jaegeuk Kim      2013-10-24  117  
84e4214f0868ae Jaegeuk Kim      2015-10-13  118  		trace_f2fs_background_gc(sbi->sb, wait_ms,
84e4214f0868ae Jaegeuk Kim      2015-10-13  119  				prefree_segments(sbi), free_segments(sbi));
84e4214f0868ae Jaegeuk Kim      2015-10-13  120  
4660f9c0fe4843 Jaegeuk Kim      2013-10-24  121  		/* balancing f2fs's metadata periodically */
7bcd0cfa735d72 Chao Yu          2020-03-19  122  		f2fs_balance_fs_bg(sbi, true);
dc6febb6bcec7f Chao Yu          2017-07-22  123  next:
dc6febb6bcec7f Chao Yu          2017-07-22  124  		sb_end_write(sbi->sb);
81eb8d6e2869b1 Jaegeuk Kim      2013-10-24  125  
7bc0900347e069 Jaegeuk Kim      2012-11-02  126  	} while (!kthread_should_stop());
7bc0900347e069 Jaegeuk Kim      2012-11-02  127  	return 0;
7bc0900347e069 Jaegeuk Kim      2012-11-02  128  }
7bc0900347e069 Jaegeuk Kim      2012-11-02  129  

:::::: The code at line 29 was first introduced by commit
:::::: 7bc0900347e069a1676d28ad6f98cafaf8cfd6e9 f2fs: add garbage collection functions

:::::: TO: Jaegeuk Kim <jaegeuk.kim@...sung.com>
:::::: CC: Jaegeuk Kim <jaegeuk.kim@...sung.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (19684 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ