All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jan Kara <jack@suse.cz>, Ted Tso <tytso@mit.edu>
Cc: kbuild-all@lists.01.org, linux-ext4@vger.kernel.org,
	Jan Kara <jack@suse.cz>, Lukas Czerner <lczerner@redhat.com>
Subject: Re: [PATCH 5/5] ext4: Improve scalability of ext4 orphan file handling
Date: Thu, 12 Aug 2021 02:19:33 +0800	[thread overview]
Message-ID: <202108120223.efg5X7VY-lkp@intel.com> (raw)
In-Reply-To: <20210811101925.6973-5-jack@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 4374 bytes --]

Hi Jan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on ext3/for_next linus/master v5.14-rc5 next-20210811]
[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]

url:    https://github.com/0day-ci/linux/commits/Jan-Kara/ext4-Speedup-orphan-file-handling/20210811-182113
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: parisc-randconfig-s032-20210810 (attached as .config)
compiler: hppa-linux-gcc (GCC) 10.3.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.3-348-gf0e6938b-dirty
        # https://github.com/0day-ci/linux/commit/77029a42c6e037181b218cbf10a93561e664fb9e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jan-Kara/ext4-Speedup-orphan-file-handling/20210811-182113
        git checkout 77029a42c6e037181b218cbf10a93561e664fb9e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc SHELL=/bin/bash fs/ext4/

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


sparse warnings: (new ones prefixed by >>)
>> fs/ext4/orphan.c:76:18: sparse: sparse: cast from restricted __le32
>> fs/ext4/orphan.c:76:18: sparse: sparse: cast from restricted __le32
>> fs/ext4/orphan.c:76:18: sparse: sparse: cast to restricted __le32

vim +76 fs/ext4/orphan.c

    10	
    11	static int ext4_orphan_file_add(handle_t *handle, struct inode *inode)
    12	{
    13		int i, j, start;
    14		struct ext4_orphan_info *oi = &EXT4_SB(inode->i_sb)->s_orphan_info;
    15		int ret = 0;
    16		bool found = false;
    17		__le32 *bdata;
    18		int inodes_per_ob = ext4_inodes_per_orphan_block(inode->i_sb);
    19		int looped = 0;
    20	
    21		/*
    22		 * Find block with free orphan entry. Use CPU number for a naive hash
    23		 * for a search start in the orphan file
    24		 */
    25		start = raw_smp_processor_id()*13 % oi->of_blocks;
    26		i = start;
    27		do {
    28			if (atomic_dec_if_positive(&oi->of_binfo[i].ob_free_entries)
    29			    >= 0) {
    30				found = true;
    31				break;
    32			}
    33			if (++i >= oi->of_blocks)
    34				i = 0;
    35		} while (i != start);
    36	
    37		if (!found) {
    38			/*
    39			 * For now we don't grow or shrink orphan file. We just use
    40			 * whatever was allocated at mke2fs time. The additional
    41			 * credits we would have to reserve for each orphan inode
    42			 * operation just don't seem worth it.
    43			 */
    44			return -ENOSPC;
    45		}
    46	
    47		ret = ext4_journal_get_write_access(handle, inode->i_sb,
    48					oi->of_binfo[i].ob_bh, EXT4_JTR_ORPHAN_FILE);
    49		if (ret)
    50			return ret;
    51	
    52		bdata = (__le32 *)(oi->of_binfo[i].ob_bh->b_data);
    53		/* Find empty slot in a block */
    54		j = 0;
    55		do {
    56			if (looped) {
    57				/*
    58				 * Did we walk through the block several times without
    59				 * finding free entry? It is theoretically possible
    60				 * if entries get constantly allocated and freed or
    61				 * if the block is corrupted. Avoid indefinite looping
    62				 * and bail. We'll use orphan list instead.
    63				 */
    64				if (looped > 3) {
    65					atomic_inc(&oi->of_binfo[i].ob_free_entries);
    66					return -ENOSPC;
    67				}
    68				cond_resched();
    69			}
    70			while (bdata[j]) {
    71				if (++j >= inodes_per_ob) {
    72					j = 0;
    73					looped++;
    74				}
    75			}
  > 76		} while (cmpxchg(&bdata[j], 0, cpu_to_le32(inode->i_ino)) != 0);
    77	
    78		EXT4_I(inode)->i_orphan_idx = i * inodes_per_ob + j;
    79		ext4_set_inode_state(inode, EXT4_STATE_ORPHAN_FILE);
    80	
    81		return ext4_handle_dirty_metadata(handle, NULL, oi->of_binfo[i].ob_bh);
    82	}
    83	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35458 bytes --]

  reply	other threads:[~2021-08-11 18:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 10:19 [PATCH 0/5 v5] ext4: Speedup " Jan Kara
2021-08-11 10:19 ` [PATCH 1/5] ext4: Support for checksumming from journal triggers Jan Kara
2021-08-11 10:19 ` [PATCH 2/5] ext4: Move orphan inode handling into a separate file Jan Kara
2021-08-11 10:19 ` [PATCH 3/5] ext4: Speedup ext4 orphan inode handling Jan Kara
2021-08-12 15:01   ` Theodore Ts'o
2021-08-13 12:34     ` Jan Kara
2021-08-13 15:26       ` Theodore Ts'o
2021-08-16  9:23         ` Jan Kara
2021-08-11 10:19 ` [PATCH 4/5] ext4: Orphan file documentation Jan Kara
2021-08-12 15:02   ` Theodore Ts'o
2021-08-11 10:19 ` [PATCH 5/5] ext4: Improve scalability of ext4 orphan file handling Jan Kara
2021-08-11 18:19   ` kernel test robot [this message]
2021-08-12 12:59     ` Jan Kara
2021-08-12 16:48   ` Theodore Ts'o
  -- strict thread matches above, loose matches on Subject: below --
2021-08-16  9:57 [PATCH 0/5 v7] ext4: Speedup " Jan Kara
2021-08-16  9:57 ` [PATCH 5/5] ext4: Improve scalability of ext4 " Jan Kara
2021-08-16  9:22 [PATCH 0/5 v6] ext4: Speedup " Jan Kara
2021-08-16  9:23 ` [PATCH 5/5] ext4: Improve scalability of ext4 " Jan Kara
2021-07-12 15:40 [PATCH 0/5 v4] ext4: Speedup " Jan Kara
2021-07-12 15:40 ` [PATCH 5/5] ext4: Improve scalability of ext4 " Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202108120223.efg5X7VY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jack@suse.cz \
    --cc=kbuild-all@lists.01.org \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --subject='Re: [PATCH 5/5] ext4: Improve scalability of ext4 orphan file handling' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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.