All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
@ 2023-01-29  8:30 ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2023-01-29  8:30 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu

This patch tries to use bitfield in struct f2fs_io_info to improve
memory usage.

struct f2fs_io_info {
...
	int need_lock:8;	/* indicate we need to lock cp_rwsem */
	int version:8;		/* version of the node */
	int submitted:1;	/* indicate IO submission */
	int in_list:1;		/* indicate fio is in io_list */
	int is_por:1;		/* indicate IO is from recovery or not */
	int retry:1;		/* need to reallocate block address */
	int encrypted:1;	/* indicate file is encrypted */
	int post_read:1;	/* require post read */
...
};

After this patch, size of struct f2fs_io_info reduces from 136 to 120.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/f2fs.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index fa41c0dad308..f2f201e2a6a6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1212,19 +1212,19 @@ struct f2fs_io_info {
 	struct page *encrypted_page;	/* encrypted page */
 	struct page *compressed_page;	/* compressed page */
 	struct list_head list;		/* serialize IOs */
-	bool submitted;		/* indicate IO submission */
-	int need_lock;		/* indicate we need to lock cp_rwsem */
-	bool in_list;		/* indicate fio is in io_list */
-	bool is_por;		/* indicate IO is from recovery or not */
-	bool retry;		/* need to reallocate block address */
 	int compr_blocks;	/* # of compressed block addresses */
-	bool encrypted;		/* indicate file is encrypted */
-	bool post_read;		/* require post read */
+	int need_lock:8;	/* indicate we need to lock cp_rwsem */
+	int version:8;		/* version of the node */
+	int submitted:1;	/* indicate IO submission */
+	int in_list:1;		/* indicate fio is in io_list */
+	int is_por:1;		/* indicate IO is from recovery or not */
+	int retry:1;		/* need to reallocate block address */
+	int encrypted:1;	/* indicate file is encrypted */
+	int post_read:1;	/* require post read */
 	enum iostat_type io_type;	/* io type */
 	struct writeback_control *io_wbc; /* writeback control */
 	struct bio **bio;		/* bio for ipu */
 	sector_t *last_block;		/* last block number in bio */
-	unsigned char version;		/* version of the node */
 };
 
 struct bio_entry {
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [f2fs-dev] [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
@ 2023-01-29  8:30 ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2023-01-29  8:30 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

This patch tries to use bitfield in struct f2fs_io_info to improve
memory usage.

struct f2fs_io_info {
...
	int need_lock:8;	/* indicate we need to lock cp_rwsem */
	int version:8;		/* version of the node */
	int submitted:1;	/* indicate IO submission */
	int in_list:1;		/* indicate fio is in io_list */
	int is_por:1;		/* indicate IO is from recovery or not */
	int retry:1;		/* need to reallocate block address */
	int encrypted:1;	/* indicate file is encrypted */
	int post_read:1;	/* require post read */
...
};

After this patch, size of struct f2fs_io_info reduces from 136 to 120.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/f2fs.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index fa41c0dad308..f2f201e2a6a6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1212,19 +1212,19 @@ struct f2fs_io_info {
 	struct page *encrypted_page;	/* encrypted page */
 	struct page *compressed_page;	/* compressed page */
 	struct list_head list;		/* serialize IOs */
-	bool submitted;		/* indicate IO submission */
-	int need_lock;		/* indicate we need to lock cp_rwsem */
-	bool in_list;		/* indicate fio is in io_list */
-	bool is_por;		/* indicate IO is from recovery or not */
-	bool retry;		/* need to reallocate block address */
 	int compr_blocks;	/* # of compressed block addresses */
-	bool encrypted;		/* indicate file is encrypted */
-	bool post_read;		/* require post read */
+	int need_lock:8;	/* indicate we need to lock cp_rwsem */
+	int version:8;		/* version of the node */
+	int submitted:1;	/* indicate IO submission */
+	int in_list:1;		/* indicate fio is in io_list */
+	int is_por:1;		/* indicate IO is from recovery or not */
+	int retry:1;		/* need to reallocate block address */
+	int encrypted:1;	/* indicate file is encrypted */
+	int post_read:1;	/* require post read */
 	enum iostat_type io_type;	/* io type */
 	struct writeback_control *io_wbc; /* writeback control */
 	struct bio **bio;		/* bio for ipu */
 	sector_t *last_block;		/* last block number in bio */
-	unsigned char version;		/* version of the node */
 };
 
 struct bio_entry {
-- 
2.36.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
  2023-01-29  8:30 ` [f2fs-dev] " Chao Yu
  (?)
@ 2023-01-29 16:25 ` kernel test robot
  -1 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-01-29 16:25 UTC (permalink / raw)
  To: Chao Yu, Chao Yu; +Cc: llvm, oe-kbuild-all

Hi Chao,

I love your patch! Perhaps something to improve:

[auto build test WARNING on jaegeuk-f2fs/dev-test]
[also build test WARNING on jaegeuk-f2fs/dev linus/master v6.2-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chao-Yu/f2fs-reduce-stack-memory-cost-by-using-bitfield-in-struct-f2fs_io_info/20230129-220837
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
patch link:    https://lore.kernel.org/r/20230129083045.7754-1-chao%40kernel.org
patch subject: [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
config: mips-randconfig-r006-20230129 (https://download.01.org/0day-ci/archive/20230130/202301300046.Sxi29bMU-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 4196ca3278f78c6e19246e54ab0ecb364e37d66a)
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://github.com/intel-lab-lkp/linux/commit/de0eb98b767c053132c5ffc724041551d315f69a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Chao-Yu/f2fs-reduce-stack-memory-cost-by-using-bitfield-in-struct-f2fs_io_info/20230129-220837
        git checkout de0eb98b767c053132c5ffc724041551d315f69a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash fs/f2fs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/f2fs/data.c:995:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
           fio->submitted = true;
                          ^ ~~~~
   fs/f2fs/data.c:1011:15: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
                           fio->retry = true;
                                      ^ ~~~~
   In file included from fs/f2fs/data.c:8:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:56:
   In file included from include/linux/preempt.h:78:
   In file included from ./arch/mips/include/generated/asm/preempt.h:1:
   In file included from include/asm-generic/preempt.h:5:
   In file included from include/linux/thread_info.h:60:
   In file included from arch/mips/include/asm/thread_info.h:16:
   In file included from arch/mips/include/asm/processor.h:14:
   In file included from include/linux/atomic.h:7:
   In file included from arch/mips/include/asm/atomic.h:17:
   In file included from include/linux/irqflags.h:16:
   arch/mips/include/asm/irqflags.h:127:3: error: instruction requires a CPU feature not currently enabled
           "       mfc0    %[flags], $12                                   \n"
            ^
   <inline asm>:3:2: note: instantiated into assembly here
           mfc0    $2, $12                                 
           ^
   2 warnings and 1 error generated.
--
>> fs/f2fs/segment.c:3350:16: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
                   fio->in_list = true;
                                ^ ~~~~
   In file included from fs/f2fs/segment.c:8:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:56:
   In file included from include/linux/preempt.h:78:
   In file included from ./arch/mips/include/generated/asm/preempt.h:1:
   In file included from include/asm-generic/preempt.h:5:
   In file included from include/linux/thread_info.h:60:
   In file included from arch/mips/include/asm/thread_info.h:16:
   In file included from arch/mips/include/asm/processor.h:14:
   In file included from include/linux/atomic.h:7:
   In file included from arch/mips/include/asm/atomic.h:17:
   In file included from include/linux/irqflags.h:16:
   arch/mips/include/asm/irqflags.h:127:3: error: instruction requires a CPU feature not currently enabled
           "       mfc0    %[flags], $12                                   \n"
            ^
   <inline asm>:3:2: note: instantiated into assembly here
           mfc0    $2, $12                                 
           ^
   In file included from fs/f2fs/segment.c:8:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:56:
   In file included from include/linux/preempt.h:78:
   In file included from ./arch/mips/include/generated/asm/preempt.h:1:
   In file included from include/asm-generic/preempt.h:5:
   In file included from include/linux/thread_info.h:60:
   In file included from arch/mips/include/asm/thread_info.h:16:
   In file included from arch/mips/include/asm/processor.h:14:
   In file included from include/linux/atomic.h:7:
   In file included from arch/mips/include/asm/atomic.h:17:
   In file included from include/linux/irqflags.h:16:
   arch/mips/include/asm/irqflags.h:127:3: error: instruction requires a CPU feature not currently enabled
           "       mfc0    %[flags], $12                                   \n"
            ^
   <inline asm>:3:2: note: instantiated into assembly here
           mfc0    $2, $12                                 
           ^
   In file included from fs/f2fs/segment.c:8:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:56:
   In file included from include/linux/preempt.h:78:
   In file included from ./arch/mips/include/generated/asm/preempt.h:1:
   In file included from include/asm-generic/preempt.h:5:
   In file included from include/linux/thread_info.h:60:
   In file included from arch/mips/include/asm/thread_info.h:16:
   In file included from arch/mips/include/asm/processor.h:14:
   In file included from include/linux/atomic.h:7:
   In file included from arch/mips/include/asm/atomic.h:17:
   In file included from include/linux/irqflags.h:16:
   arch/mips/include/asm/irqflags.h:127:3: error: instruction requires a CPU feature not currently enabled
           "       mfc0    %[flags], $12                                   \n"
            ^
   <inline asm>:3:2: note: instantiated into assembly here
           mfc0    $2, $12                                 
           ^
   In file included from fs/f2fs/segment.c:8:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:56:
   In file included from include/linux/preempt.h:78:
   In file included from ./arch/mips/include/generated/asm/preempt.h:1:
   In file included from include/asm-generic/preempt.h:5:
   In file included from include/linux/thread_info.h:60:
   In file included from arch/mips/include/asm/thread_info.h:16:
   In file included from arch/mips/include/asm/processor.h:14:
   In file included from include/linux/atomic.h:7:
   In file included from arch/mips/include/asm/atomic.h:17:
   In file included from include/linux/irqflags.h:16:
   arch/mips/include/asm/irqflags.h:127:3: error: instruction requires a CPU feature not currently enabled
           "       mfc0    %[flags], $12                                   \n"
            ^
   <inline asm>:3:2: note: instantiated into assembly here
           mfc0    $2, $12                                 
           ^
   1 warning and 4 errors generated.


vim +/int +995 fs/f2fs/data.c

8648de2c581eed Chao Yu           2019-02-19   961  
fe16efe6a7952f Chao Yu           2018-05-28   962  void f2fs_submit_page_write(struct f2fs_io_info *fio)
93dfe2ac516250 Jaegeuk Kim       2013-11-30   963  {
05ca3632e5a73b Jaegeuk Kim       2015-04-23   964  	struct f2fs_sb_info *sbi = fio->sbi;
458e6197c37de5 Jaegeuk Kim       2013-12-11   965  	enum page_type btype = PAGE_TYPE_OF_BIO(fio->type);
a912b54d3aaa01 Jaegeuk Kim       2017-05-10   966  	struct f2fs_bio_info *io = sbi->write_io[btype] + fio->temp;
4375a33664de17 Jaegeuk Kim       2015-04-23   967  	struct page *bio_page;
93dfe2ac516250 Jaegeuk Kim       2013-11-30   968  
b9109b0e49b93b Jaegeuk Kim       2017-05-10   969  	f2fs_bug_on(sbi, is_read_io(fio->op));
93dfe2ac516250 Jaegeuk Kim       2013-11-30   970  
e4544b63a7ee49 Tim Murray        2022-01-07   971  	f2fs_down_write(&io->io_rwsem);
fb830fc5cfc90b Chao Yu           2017-05-19   972  next:
fb830fc5cfc90b Chao Yu           2017-05-19   973  	if (fio->in_list) {
fb830fc5cfc90b Chao Yu           2017-05-19   974  		spin_lock(&io->io_lock);
fb830fc5cfc90b Chao Yu           2017-05-19   975  		if (list_empty(&io->io_list)) {
fb830fc5cfc90b Chao Yu           2017-05-19   976  			spin_unlock(&io->io_lock);
fe16efe6a7952f Chao Yu           2018-05-28   977  			goto out;
fb830fc5cfc90b Chao Yu           2017-05-19   978  		}
fb830fc5cfc90b Chao Yu           2017-05-19   979  		fio = list_first_entry(&io->io_list,
fb830fc5cfc90b Chao Yu           2017-05-19   980  						struct f2fs_io_info, list);
fb830fc5cfc90b Chao Yu           2017-05-19   981  		list_del(&fio->list);
fb830fc5cfc90b Chao Yu           2017-05-19   982  		spin_unlock(&io->io_lock);
fb830fc5cfc90b Chao Yu           2017-05-19   983  	}
93dfe2ac516250 Jaegeuk Kim       2013-11-30   984  
93770ab7a6e963 Chao Yu           2019-04-15   985  	verify_fio_blkaddr(fio);
93dfe2ac516250 Jaegeuk Kim       2013-11-30   986  
4c8ff7095bef64 Chao Yu           2019-11-01   987  	if (fio->encrypted_page)
4c8ff7095bef64 Chao Yu           2019-11-01   988  		bio_page = fio->encrypted_page;
4c8ff7095bef64 Chao Yu           2019-11-01   989  	else if (fio->compressed_page)
4c8ff7095bef64 Chao Yu           2019-11-01   990  		bio_page = fio->compressed_page;
4c8ff7095bef64 Chao Yu           2019-11-01   991  	else
4c8ff7095bef64 Chao Yu           2019-11-01   992  		bio_page = fio->page;
36951b38d13ac7 Chao Yu           2016-11-16   993  
ebf7c522fdc2ec Thomas Meyer      2017-10-07   994  	/* set submitted = true as a return value */
ebf7c522fdc2ec Thomas Meyer      2017-10-07  @995  	fio->submitted = true;
d68f735b3bc934 Jaegeuk Kim       2017-02-03   996  
36951b38d13ac7 Chao Yu           2016-11-16   997  	inc_page_count(sbi, WB_DATA_TYPE(bio_page));
36951b38d13ac7 Chao Yu           2016-11-16   998  
27aacd28ea3b89 Satya Tangirala   2020-07-02   999  	if (io->bio &&
27aacd28ea3b89 Satya Tangirala   2020-07-02  1000  	    (!io_is_mergeable(sbi, io->bio, io, fio, io->last_block_in_bio,
27aacd28ea3b89 Satya Tangirala   2020-07-02  1001  			      fio->new_blkaddr) ||
27aacd28ea3b89 Satya Tangirala   2020-07-02  1002  	     !f2fs_crypt_mergeable_bio(io->bio, fio->page->mapping->host,
27aacd28ea3b89 Satya Tangirala   2020-07-02  1003  				       bio_page->index, fio)))
458e6197c37de5 Jaegeuk Kim       2013-12-11  1004  		__submit_merged_bio(io);
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1005  alloc_new:
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1006  	if (io->bio == NULL) {
8223ecc456d079 Chao Yu           2019-08-28  1007  		if (F2FS_IO_ALIGNED(sbi) &&
8223ecc456d079 Chao Yu           2019-08-28  1008  				(fio->type == DATA || fio->type == NODE) &&
0a595ebaaa6b53 Jaegeuk Kim       2016-12-14  1009  				fio->new_blkaddr & F2FS_IO_SIZE_MASK(sbi)) {
0a595ebaaa6b53 Jaegeuk Kim       2016-12-14  1010  			dec_page_count(sbi, WB_DATA_TYPE(bio_page));
fe16efe6a7952f Chao Yu           2018-05-28  1011  			fio->retry = true;
fe16efe6a7952f Chao Yu           2018-05-28  1012  			goto skip;
0a595ebaaa6b53 Jaegeuk Kim       2016-12-14  1013  		}
a8affc03a9b375 Christoph Hellwig 2021-03-11  1014  		io->bio = __bio_alloc(fio, BIO_MAX_VECS);
27aacd28ea3b89 Satya Tangirala   2020-07-02  1015  		f2fs_set_bio_crypt_ctx(io->bio, fio->page->mapping->host,
27aacd28ea3b89 Satya Tangirala   2020-07-02  1016  				       bio_page->index, fio, GFP_NOIO);
458e6197c37de5 Jaegeuk Kim       2013-12-11  1017  		io->fio = *fio;
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1018  	}
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1019  
a912b54d3aaa01 Jaegeuk Kim       2017-05-10  1020  	if (bio_add_page(io->bio, bio_page, PAGE_SIZE, 0) < PAGE_SIZE) {
458e6197c37de5 Jaegeuk Kim       2013-12-11  1021  		__submit_merged_bio(io);
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1022  		goto alloc_new;
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1023  	}
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1024  
578c647879f74c Yufen Yu          2018-01-09  1025  	if (fio->io_wbc)
34e51a5e1a6e93 Tejun Heo         2019-06-27  1026  		wbc_account_cgroup_owner(fio->io_wbc, bio_page, PAGE_SIZE);
578c647879f74c Yufen Yu          2018-01-09  1027  
7a9d75481b85d5 Chao Yu           2016-02-22  1028  	io->last_block_in_bio = fio->new_blkaddr;
fb830fc5cfc90b Chao Yu           2017-05-19  1029  
fb830fc5cfc90b Chao Yu           2017-05-19  1030  	trace_f2fs_submit_page_write(fio->page, fio);
fe16efe6a7952f Chao Yu           2018-05-28  1031  skip:
fb830fc5cfc90b Chao Yu           2017-05-19  1032  	if (fio->in_list)
fb830fc5cfc90b Chao Yu           2017-05-19  1033  		goto next;
fe16efe6a7952f Chao Yu           2018-05-28  1034  out:
4354994f097d06 Daniel Rosenberg  2018-08-20  1035  	if (is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN) ||
00e09c0bccc718 Chao Yu           2019-08-23  1036  				!f2fs_is_checkpoint_ready(sbi))
5ce805869cbed9 Jaegeuk Kim       2018-09-06  1037  		__submit_merged_bio(io);
e4544b63a7ee49 Tim Murray        2022-01-07  1038  	f2fs_up_write(&io->io_rwsem);
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1039  }
93dfe2ac516250 Jaegeuk Kim       2013-11-30  1040  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
@ 2023-01-29 18:49 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-01-29 18:49 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230129083045.7754-1-chao@kernel.org>
References: <20230129083045.7754-1-chao@kernel.org>
TO: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>

Hi Chao,

I love your patch! Perhaps something to improve:

[auto build test WARNING on jaegeuk-f2fs/dev-test]
[also build test WARNING on jaegeuk-f2fs/dev linus/master v6.2-rc5 next-20230127]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chao-Yu/f2fs-reduce-stack-memory-cost-by-using-bitfield-in-struct-f2fs_io_info/20230129-220837
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
patch link:    https://lore.kernel.org/r/20230129083045.7754-1-chao%40kernel.org
patch subject: [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: csky-randconfig-s051-20230129 (https://download.01.org/0day-ci/archive/20230130/202301300256.4XdrZjzc-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/de0eb98b767c053132c5ffc724041551d315f69a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Chao-Yu/f2fs-reduce-stack-memory-cost-by-using-bitfield-in-struct-f2fs_io_info/20230129-220837
        git checkout de0eb98b767c053132c5ffc724041551d315f69a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash fs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
   fs/f2fs/dir.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/inode.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/namei.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/file.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/hash.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/inline.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/checkpoint.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/gc.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/shrinker.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/sysfs.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/acl.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/recovery.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/debug.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/extent_cache.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/xattr.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/node.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/super.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/compress.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/data.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield
--
   fs/f2fs/segment.c: note: in included file:
>> fs/f2fs/f2fs.h:1217:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1218:22: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1219:21: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1220:20: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1221:24: sparse: sparse: dubious one-bit signed bitfield
   fs/f2fs/f2fs.h:1222:24: sparse: sparse: dubious one-bit signed bitfield

vim +1217 fs/f2fs/f2fs.h

b0af6d491a6b5f Chao Yu         2017-08-02  1200  
458e6197c37de5 Jaegeuk Kim     2013-12-11  1201  struct f2fs_io_info {
05ca3632e5a73b Jaegeuk Kim     2015-04-23  1202  	struct f2fs_sb_info *sbi;	/* f2fs_sb_info pointer */
39d787bec4f792 Chao Yu         2017-09-29  1203  	nid_t ino;		/* inode number */
458e6197c37de5 Jaegeuk Kim     2013-12-11  1204  	enum page_type type;	/* contains DATA/NODE/META/META_FLUSH */
a912b54d3aaa01 Jaegeuk Kim     2017-05-10  1205  	enum temp_type temp;	/* contains HOT/WARM/COLD */
7649c873c16a38 Bart Van Assche 2022-07-14  1206  	enum req_op op;		/* contains REQ_OP_ */
7649c873c16a38 Bart Van Assche 2022-07-14  1207  	blk_opf_t op_flags;	/* req_flag_bits */
7a9d75481b85d5 Chao Yu         2016-02-22  1208  	block_t new_blkaddr;	/* new block address to be written */
28bc106b2346a7 Chao Yu         2016-02-06  1209  	block_t old_blkaddr;	/* old block address before Cow */
05ca3632e5a73b Jaegeuk Kim     2015-04-23  1210  	struct page *page;	/* page to be written */
4375a33664de17 Jaegeuk Kim     2015-04-23  1211  	struct page *encrypted_page;	/* encrypted page */
4c8ff7095bef64 Chao Yu         2019-11-01  1212  	struct page *compressed_page;	/* compressed page */
fb830fc5cfc90b Chao Yu         2017-05-19  1213  	struct list_head list;		/* serialize IOs */
4c8ff7095bef64 Chao Yu         2019-11-01  1214  	int compr_blocks;	/* # of compressed block addresses */
de0eb98b767c05 Chao Yu         2023-01-29  1215  	int need_lock:8;	/* indicate we need to lock cp_rwsem */
de0eb98b767c05 Chao Yu         2023-01-29  1216  	int version:8;		/* version of the node */
de0eb98b767c05 Chao Yu         2023-01-29 @1217  	int submitted:1;	/* indicate IO submission */
de0eb98b767c05 Chao Yu         2023-01-29  1218  	int in_list:1;		/* indicate fio is in io_list */
de0eb98b767c05 Chao Yu         2023-01-29  1219  	int is_por:1;		/* indicate IO is from recovery or not */
de0eb98b767c05 Chao Yu         2023-01-29  1220  	int retry:1;		/* need to reallocate block address */
de0eb98b767c05 Chao Yu         2023-01-29  1221  	int encrypted:1;	/* indicate file is encrypted */
de0eb98b767c05 Chao Yu         2023-01-29  1222  	int post_read:1;	/* require post read */
b0af6d491a6b5f Chao Yu         2017-08-02  1223  	enum iostat_type io_type;	/* io type */
578c647879f74c Yufen Yu        2018-01-09  1224  	struct writeback_control *io_wbc; /* writeback control */
8648de2c581eed Chao Yu         2019-02-19  1225  	struct bio **bio;		/* bio for ipu */
8648de2c581eed Chao Yu         2019-02-19  1226  	sector_t *last_block;		/* last block number in bio */
458e6197c37de5 Jaegeuk Kim     2013-12-11  1227  };
458e6197c37de5 Jaegeuk Kim     2013-12-11  1228  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-29 18:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29  8:30 [PATCH] f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info Chao Yu
2023-01-29  8:30 ` [f2fs-dev] " Chao Yu
2023-01-29 16:25 ` kernel test robot
2023-01-29 18:49 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.