* Re: [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
@ 2021-12-13 14:04 kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-13 14:04 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 19771 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <163936886727.23860.5245364396572576756.stgit@noble.brown>
References: <163936886727.23860.5245364396572576756.stgit@noble.brown>
TO: NeilBrown <neilb@suse.de>
TO: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Mel Gorman <mgorman@suse.de>
TO: Philipp Reisner <philipp.reisner@linbit.com>
TO: Lars Ellenberg <lars.ellenberg@linbit.com>
TO: Jan Kara <jack@suse.com>
TO: Ryusuke Konishi <konishi.ryusuke@gmail.com>
TO: "Darrick J. Wong" <djwong@kernel.org>
CC: linux-xfs(a)vger.kernel.org
CC: linux-ext4(a)vger.kernel.org
Hi NeilBrown,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hnaz-mm/master]
[also build test WARNING on axboe-block/for-next konis-nilfs2/upstream xfs-linux/for-next linus/master v5.16-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]
url: https://github.com/0day-ci/linux/commits/NeilBrown/Remove-some-congested-tests/20211213-121653
base: https://github.com/hnaz/linux-mm master
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: x86_64-randconfig-c007-20211213 (https://download.01.org/0day-ci/archive/20211213/202112132125.TxGmjdjv-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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
# https://github.com/0day-ci/linux/commit/41802b6debbde3d5553a8067ba2deb2035e6da6e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review NeilBrown/Remove-some-congested-tests/20211213-121653
git checkout 41802b6debbde3d5553a8067ba2deb2035e6da6e
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
fs/lockd/mon.c:280:2: note: Taking false branch
if (unlikely(new == NULL))
^
fs/lockd/mon.c:289:6: note: Assuming the condition is false
if (rpc_ntop(nsm_addr(new), new->sm_addrbuf,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/lockd/mon.c:289:2: note: Taking false branch
if (rpc_ntop(nsm_addr(new), new->sm_addrbuf,
^
fs/lockd/mon.c:293:2: note: Null pointer passed as 2nd argument to memory copy function
memcpy(new->sm_name, hostname, hostname_len);
^ ~~~~~~~~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (4 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
drivers/gpio/gpio-pcf857x.c:237:23: warning: Value stored to 'np' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device_node *np = client->dev.of_node;
^~ ~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-pcf857x.c:237:23: note: Value stored to 'np' during its initialization is never read
struct device_node *np = client->dev.of_node;
^~ ~~~~~~~~~~~~~~~~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
drivers/mfd/sm501.c:513:16: warning: Value stored to 'mode' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
^~~~
drivers/mfd/sm501.c:513:16: note: Value stored to 'mode' during its initialization is never read
unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
^~~~
drivers/mfd/sm501.c:514:16: warning: Value stored to 'gate' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
^~~~
drivers/mfd/sm501.c:514:16: note: Value stored to 'gate' during its initialization is never read
unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
^~~~
drivers/mfd/sm501.c:515:16: warning: Value stored to 'clock' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
^~~~~
drivers/mfd/sm501.c:515:16: note: Value stored to 'clock' during its initialization is never read
unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
^~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
fs/ext2/dir.c:477:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = ext2_commit_chunk(page, pos, len);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext2/dir.c:477:2: note: Value stored to 'err' is never read
err = ext2_commit_chunk(page, pos, len);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
>> fs/ext2/ialloc.c:175:2: warning: Value stored to 'bdi' is never read [clang-analyzer-deadcode.DeadStores]
bdi = inode_to_bdi(inode);
^ ~~~~~~~~~~~~~~~~~~~
fs/ext2/ialloc.c:175:2: note: Value stored to 'bdi' is never read
bdi = inode_to_bdi(inode);
^ ~~~~~~~~~~~~~~~~~~~
fs/ext2/ialloc.c:301:4: warning: Value stored to 'desc' is never read [clang-analyzer-deadcode.DeadStores]
desc = best_desc;
^ ~~~~~~~~~
fs/ext2/ialloc.c:301:4: note: Value stored to 'desc' is never read
desc = best_desc;
^ ~~~~~~~~~
Suppressed 5 warnings (4 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (4 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
13 warnings generated.
drivers/regulator/core.c:1109:2: warning: Value stored to 'count' is never read [clang-analyzer-deadcode.DeadStores]
count += scnprintf(buf + count, len - count, ", %s",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/core.c:1109:2: note: Value stored to 'count' is never read
count += scnprintf(buf + count, len - count, ", %s",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/core.c:3792:3: warning: Value stored to 'possible_uV' is never read [clang-analyzer-deadcode.DeadStores]
possible_uV = desired_min_uV;
^ ~~~~~~~~~~~~~~
drivers/regulator/core.c:3792:3: note: Value stored to 'possible_uV' is never read
possible_uV = desired_min_uV;
^ ~~~~~~~~~~~~~~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
fs/xfs/libxfs/xfs_rmap.c:244:2: warning: 4th function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
xfs_warn(mp,
vim +/bdi +175 fs/ext2/ialloc.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 154
^1da177e4c3f41 Linus Torvalds 2005-04-16 155 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 156 * We perform asynchronous prereading of the new inode's inode block when
^1da177e4c3f41 Linus Torvalds 2005-04-16 157 * we create the inode, in the expectation that the inode will be written
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 * back soon. There are two reasons:
^1da177e4c3f41 Linus Torvalds 2005-04-16 159 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 160 * - When creating a large number of files, the async prereads will be
^1da177e4c3f41 Linus Torvalds 2005-04-16 161 * nicely merged into large reads
^1da177e4c3f41 Linus Torvalds 2005-04-16 162 * - When writing out a large number of inodes, we don't need to keep on
^1da177e4c3f41 Linus Torvalds 2005-04-16 163 * stalling the writes while we read the inode block.
^1da177e4c3f41 Linus Torvalds 2005-04-16 164 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 165 * FIXME: ext2_get_group_desc() needs to be simplified.
^1da177e4c3f41 Linus Torvalds 2005-04-16 166 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 static void ext2_preread_inode(struct inode *inode)
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 169 unsigned long block_group;
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 unsigned long offset;
^1da177e4c3f41 Linus Torvalds 2005-04-16 171 unsigned long block;
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 struct ext2_group_desc * gdp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 173 struct backing_dev_info *bdi;
^1da177e4c3f41 Linus Torvalds 2005-04-16 174
de1414a654e66b Christoph Hellwig 2015-01-14 @175 bdi = inode_to_bdi(inode);
^1da177e4c3f41 Linus Torvalds 2005-04-16 176
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
ef2fb67989d30f Eric Sandeen 2007-10-16 178 gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 179 if (gdp == NULL)
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 return;
^1da177e4c3f41 Linus Torvalds 2005-04-16 181
^1da177e4c3f41 Linus Torvalds 2005-04-16 182 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 183 * Figure out the offset within the block group inode table
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 185 offset = ((inode->i_ino - 1) % EXT2_INODES_PER_GROUP(inode->i_sb)) *
^1da177e4c3f41 Linus Torvalds 2005-04-16 186 EXT2_INODE_SIZE(inode->i_sb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 187 block = le32_to_cpu(gdp->bg_inode_table) +
^1da177e4c3f41 Linus Torvalds 2005-04-16 188 (offset >> EXT2_BLOCK_SIZE_BITS(inode->i_sb));
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 sb_breadahead(inode->i_sb, block);
^1da177e4c3f41 Linus Torvalds 2005-04-16 190 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 191
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
2021-12-13 5:07 ` Dave Chinner
@ 2021-12-13 7:04 ` NeilBrown
0 siblings, 0 replies; 8+ messages in thread
From: NeilBrown @ 2021-12-13 7:04 UTC (permalink / raw)
To: Dave Chinner
Cc: Andrew Morton, Mel Gorman, Philipp Reisner, Lars Ellenberg,
Jan Kara, Ryusuke Konishi, Darrick J. Wong, linux-xfs,
linux-ext4, linux-nilfs, linux-mm, linux-fsdevel, linux-kernel
On Mon, 13 Dec 2021, Dave Chinner wrote:
> On Mon, Dec 13, 2021 at 03:14:27PM +1100, NeilBrown wrote:
> > These functions are no longer useful as the only bdis that report
> > congestion are in ceph, fuse, and nfs. None of those bdis can be the
> > target of the calls in drbd, ext2, nilfs2, or xfs.
> >
> > Removing the test on bdi_write_contested() in current_may_throttle()
> > could cause a small change in behaviour, but only when PF_LOCAL_THROTTLE
> > is set.
> >
> > So replace the calls by 'false' and simplify the code - and remove the
> > functions.
> >
> > Signed-off-by: NeilBrown <neilb@suse.de>
> ....
> > diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> > index 631c5a61d89b..22f73b3e888e 100644
> > --- a/fs/xfs/xfs_buf.c
> > +++ b/fs/xfs/xfs_buf.c
> > @@ -843,9 +843,6 @@ xfs_buf_readahead_map(
> > {
> > struct xfs_buf *bp;
> >
> > - if (bdi_read_congested(target->bt_bdev->bd_disk->bdi))
> > - return;
>
> Ok, but this isn't a "throttle writeback" test here - it's trying to
> avoid having speculative readahead blocking on a full request queue
> instead of just skipping the readahead IO. i.e. prevent readahead
> thrashing and/or adding unnecessary read load when we already have a
> full read queue...
>
> So what is the replacement for that? We want to skip the entire
> buffer lookup/setup/read overhead if we're likely to block on IO
> submission - is there anything we can use to do this these days?
I don't think there is a concept of a "full read queue" any more.
There are things that can block an IO submission though.
There is allocation of the bio from a mempool, and there is
rq_qos_throttle, and there are probably other places where submission
can block. I don't think you can tell in advance if a submission is
likely to block.
I think the idea is that the top level of the submission stack should
rate-limit based on the estimated throughput of the stack. I think
write-back does this. I don't know about read-ahead.
NeilBrown
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
@ 2021-12-13 6:27 kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-13 6:27 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4257 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <163936886727.23860.5245364396572576756.stgit@noble.brown>
References: <163936886727.23860.5245364396572576756.stgit@noble.brown>
TO: NeilBrown <neilb@suse.de>
TO: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Mel Gorman <mgorman@suse.de>
TO: Philipp Reisner <philipp.reisner@linbit.com>
TO: Lars Ellenberg <lars.ellenberg@linbit.com>
TO: Jan Kara <jack@suse.com>
TO: Ryusuke Konishi <konishi.ryusuke@gmail.com>
TO: "Darrick J. Wong" <djwong@kernel.org>
CC: linux-xfs(a)vger.kernel.org
CC: linux-ext4(a)vger.kernel.org
Hi NeilBrown,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hnaz-mm/master]
[also build test WARNING on axboe-block/for-next konis-nilfs2/upstream xfs-linux/for-next linus/master v5.16-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]
url: https://github.com/0day-ci/linux/commits/NeilBrown/Remove-some-congested-tests/20211213-121653
base: https://github.com/hnaz/linux-mm master
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago
config: i386-randconfig-s001-20211213 (https://download.01.org/0day-ci/archive/20211213/202112131405.VsMiZ1bE-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/41802b6debbde3d5553a8067ba2deb2035e6da6e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review NeilBrown/Remove-some-congested-tests/20211213-121653
git checkout 41802b6debbde3d5553a8067ba2deb2035e6da6e
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash fs/nilfs2/
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/nilfs2/segbuf.c:358:2: sparse: sparse: unused label 'failed'
vim +/failed +358 fs/nilfs2/segbuf.c
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 338
9284ad2a9016ad Ryusuke Konishi 2009-11-25 339 static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
b2d4586627ad26 Mike Christie 2016-06-05 340 struct nilfs_write_info *wi, int mode,
b2d4586627ad26 Mike Christie 2016-06-05 341 int mode_flags)
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 342 {
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 343 struct bio *bio = wi->bio;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 344 int err;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 345
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 346 bio->bi_end_io = nilfs_end_bio_write;
9284ad2a9016ad Ryusuke Konishi 2009-11-25 347 bio->bi_private = segbuf;
b2d4586627ad26 Mike Christie 2016-06-05 348 bio_set_op_attrs(bio, mode, mode_flags);
4e49ea4a3d2763 Mike Christie 2016-06-05 349 submit_bio(bio);
4bf93b50fd0411 Vyacheslav Dubeyko 2013-08-22 350 segbuf->sb_nbio++;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 351
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 352 wi->bio = NULL;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 353 wi->rest_blocks -= wi->end - wi->start;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 354 wi->nr_vecs = min(wi->max_pages, wi->rest_blocks);
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 355 wi->start = wi->end;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 356 return 0;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 357
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 @358 failed:
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 359 wi->bio = NULL;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 360 return err;
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 361 }
64b5a32e0b3680 Ryusuke Konishi 2009-04-06 362
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
2021-12-13 4:14 ` NeilBrown
@ 2021-12-13 5:56 ` kernel test robot
-1 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-13 5:56 UTC (permalink / raw)
To: NeilBrown, Andrew Morton, Mel Gorman, Philipp Reisner,
Lars Ellenberg, Jan Kara, Ryusuke Konishi, Darrick J. Wong
Cc: kbuild-all, Linux Memory Management List, linux-xfs, linux-ext4
Hi NeilBrown,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hnaz-mm/master]
[also build test WARNING on axboe-block/for-next konis-nilfs2/upstream xfs-linux/for-next linus/master v5.16-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]
url: https://github.com/0day-ci/linux/commits/NeilBrown/Remove-some-congested-tests/20211213-121653
base: https://github.com/hnaz/linux-mm master
config: arc-randconfig-r015-20211213 (https://download.01.org/0day-ci/archive/20211213/202112131323.fj31o6EV-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/41802b6debbde3d5553a8067ba2deb2035e6da6e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review NeilBrown/Remove-some-congested-tests/20211213-121653
git checkout 41802b6debbde3d5553a8067ba2deb2035e6da6e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash fs/ext2/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/ext2/ialloc.c: In function 'ext2_preread_inode':
>> fs/ext2/ialloc.c:173:34: warning: variable 'bdi' set but not used [-Wunused-but-set-variable]
173 | struct backing_dev_info *bdi;
| ^~~
vim +/bdi +173 fs/ext2/ialloc.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 154
^1da177e4c3f41 Linus Torvalds 2005-04-16 155 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 156 * We perform asynchronous prereading of the new inode's inode block when
^1da177e4c3f41 Linus Torvalds 2005-04-16 157 * we create the inode, in the expectation that the inode will be written
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 * back soon. There are two reasons:
^1da177e4c3f41 Linus Torvalds 2005-04-16 159 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 160 * - When creating a large number of files, the async prereads will be
^1da177e4c3f41 Linus Torvalds 2005-04-16 161 * nicely merged into large reads
^1da177e4c3f41 Linus Torvalds 2005-04-16 162 * - When writing out a large number of inodes, we don't need to keep on
^1da177e4c3f41 Linus Torvalds 2005-04-16 163 * stalling the writes while we read the inode block.
^1da177e4c3f41 Linus Torvalds 2005-04-16 164 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 165 * FIXME: ext2_get_group_desc() needs to be simplified.
^1da177e4c3f41 Linus Torvalds 2005-04-16 166 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 static void ext2_preread_inode(struct inode *inode)
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 169 unsigned long block_group;
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 unsigned long offset;
^1da177e4c3f41 Linus Torvalds 2005-04-16 171 unsigned long block;
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 struct ext2_group_desc * gdp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @173 struct backing_dev_info *bdi;
^1da177e4c3f41 Linus Torvalds 2005-04-16 174
de1414a654e66b Christoph Hellwig 2015-01-14 175 bdi = inode_to_bdi(inode);
^1da177e4c3f41 Linus Torvalds 2005-04-16 176
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
ef2fb67989d30f Eric Sandeen 2007-10-16 178 gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 179 if (gdp == NULL)
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 return;
^1da177e4c3f41 Linus Torvalds 2005-04-16 181
^1da177e4c3f41 Linus Torvalds 2005-04-16 182 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 183 * Figure out the offset within the block group inode table
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 185 offset = ((inode->i_ino - 1) % EXT2_INODES_PER_GROUP(inode->i_sb)) *
^1da177e4c3f41 Linus Torvalds 2005-04-16 186 EXT2_INODE_SIZE(inode->i_sb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 187 block = le32_to_cpu(gdp->bg_inode_table) +
^1da177e4c3f41 Linus Torvalds 2005-04-16 188 (offset >> EXT2_BLOCK_SIZE_BITS(inode->i_sb));
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 sb_breadahead(inode->i_sb, block);
^1da177e4c3f41 Linus Torvalds 2005-04-16 190 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 191
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
@ 2021-12-13 5:56 ` kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-13 5:56 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5130 bytes --]
Hi NeilBrown,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hnaz-mm/master]
[also build test WARNING on axboe-block/for-next konis-nilfs2/upstream xfs-linux/for-next linus/master v5.16-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]
url: https://github.com/0day-ci/linux/commits/NeilBrown/Remove-some-congested-tests/20211213-121653
base: https://github.com/hnaz/linux-mm master
config: arc-randconfig-r015-20211213 (https://download.01.org/0day-ci/archive/20211213/202112131323.fj31o6EV-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/41802b6debbde3d5553a8067ba2deb2035e6da6e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review NeilBrown/Remove-some-congested-tests/20211213-121653
git checkout 41802b6debbde3d5553a8067ba2deb2035e6da6e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash fs/ext2/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/ext2/ialloc.c: In function 'ext2_preread_inode':
>> fs/ext2/ialloc.c:173:34: warning: variable 'bdi' set but not used [-Wunused-but-set-variable]
173 | struct backing_dev_info *bdi;
| ^~~
vim +/bdi +173 fs/ext2/ialloc.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 154
^1da177e4c3f41 Linus Torvalds 2005-04-16 155 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 156 * We perform asynchronous prereading of the new inode's inode block when
^1da177e4c3f41 Linus Torvalds 2005-04-16 157 * we create the inode, in the expectation that the inode will be written
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 * back soon. There are two reasons:
^1da177e4c3f41 Linus Torvalds 2005-04-16 159 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 160 * - When creating a large number of files, the async prereads will be
^1da177e4c3f41 Linus Torvalds 2005-04-16 161 * nicely merged into large reads
^1da177e4c3f41 Linus Torvalds 2005-04-16 162 * - When writing out a large number of inodes, we don't need to keep on
^1da177e4c3f41 Linus Torvalds 2005-04-16 163 * stalling the writes while we read the inode block.
^1da177e4c3f41 Linus Torvalds 2005-04-16 164 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 165 * FIXME: ext2_get_group_desc() needs to be simplified.
^1da177e4c3f41 Linus Torvalds 2005-04-16 166 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 static void ext2_preread_inode(struct inode *inode)
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 169 unsigned long block_group;
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 unsigned long offset;
^1da177e4c3f41 Linus Torvalds 2005-04-16 171 unsigned long block;
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 struct ext2_group_desc * gdp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @173 struct backing_dev_info *bdi;
^1da177e4c3f41 Linus Torvalds 2005-04-16 174
de1414a654e66b Christoph Hellwig 2015-01-14 175 bdi = inode_to_bdi(inode);
^1da177e4c3f41 Linus Torvalds 2005-04-16 176
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
ef2fb67989d30f Eric Sandeen 2007-10-16 178 gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 179 if (gdp == NULL)
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 return;
^1da177e4c3f41 Linus Torvalds 2005-04-16 181
^1da177e4c3f41 Linus Torvalds 2005-04-16 182 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 183 * Figure out the offset within the block group inode table
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 185 offset = ((inode->i_ino - 1) % EXT2_INODES_PER_GROUP(inode->i_sb)) *
^1da177e4c3f41 Linus Torvalds 2005-04-16 186 EXT2_INODE_SIZE(inode->i_sb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 187 block = le32_to_cpu(gdp->bg_inode_table) +
^1da177e4c3f41 Linus Torvalds 2005-04-16 188 (offset >> EXT2_BLOCK_SIZE_BITS(inode->i_sb));
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 sb_breadahead(inode->i_sb, block);
^1da177e4c3f41 Linus Torvalds 2005-04-16 190 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 191
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
2021-12-13 4:14 ` NeilBrown
(?)
@ 2021-12-13 5:07 ` Dave Chinner
2021-12-13 7:04 ` NeilBrown
-1 siblings, 1 reply; 8+ messages in thread
From: Dave Chinner @ 2021-12-13 5:07 UTC (permalink / raw)
To: NeilBrown
Cc: Andrew Morton, Mel Gorman, Philipp Reisner, Lars Ellenberg,
Jan Kara, Ryusuke Konishi, Darrick J. Wong, linux-xfs,
linux-ext4, linux-nilfs, linux-mm, linux-fsdevel, linux-kernel
On Mon, Dec 13, 2021 at 03:14:27PM +1100, NeilBrown wrote:
> These functions are no longer useful as the only bdis that report
> congestion are in ceph, fuse, and nfs. None of those bdis can be the
> target of the calls in drbd, ext2, nilfs2, or xfs.
>
> Removing the test on bdi_write_contested() in current_may_throttle()
> could cause a small change in behaviour, but only when PF_LOCAL_THROTTLE
> is set.
>
> So replace the calls by 'false' and simplify the code - and remove the
> functions.
>
> Signed-off-by: NeilBrown <neilb@suse.de>
....
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 631c5a61d89b..22f73b3e888e 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -843,9 +843,6 @@ xfs_buf_readahead_map(
> {
> struct xfs_buf *bp;
>
> - if (bdi_read_congested(target->bt_bdev->bd_disk->bdi))
> - return;
Ok, but this isn't a "throttle writeback" test here - it's trying to
avoid having speculative readahead blocking on a full request queue
instead of just skipping the readahead IO. i.e. prevent readahead
thrashing and/or adding unnecessary read load when we already have a
full read queue...
So what is the replacement for that? We want to skip the entire
buffer lookup/setup/read overhead if we're likely to block on IO
submission - is there anything we can use to do this these days?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
@ 2021-12-13 4:14 ` NeilBrown
0 siblings, 0 replies; 8+ messages in thread
From: NeilBrown @ 2021-12-13 4:14 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, Philipp Reisner, Lars Ellenberg,
Jan Kara, Ryusuke Konishi, Darrick J. Wong
Cc: linux-xfs, linux-ext4, linux-nilfs, linux-mm, linux-fsdevel,
linux-kernel
These functions are no longer useful as the only bdis that report
congestion are in ceph, fuse, and nfs. None of those bdis can be the
target of the calls in drbd, ext2, nilfs2, or xfs.
Removing the test on bdi_write_contested() in current_may_throttle()
could cause a small change in behaviour, but only when PF_LOCAL_THROTTLE
is set.
So replace the calls by 'false' and simplify the code - and remove the
functions.
Signed-off-by: NeilBrown <neilb@suse.de>
---
drivers/block/drbd/drbd_int.h | 3 ---
drivers/block/drbd/drbd_req.c | 3 +--
fs/ext2/ialloc.c | 2 --
fs/nilfs2/segbuf.c | 11 -----------
fs/xfs/xfs_buf.c | 3 ---
include/linux/backing-dev.h | 26 --------------------------
mm/vmscan.c | 4 +---
7 files changed, 2 insertions(+), 50 deletions(-)
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index f27d5b0f9a0b..f804b1bfb3e6 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -638,9 +638,6 @@ enum {
STATE_SENT, /* Do not change state/UUIDs while this is set */
CALLBACK_PENDING, /* Whether we have a call_usermodehelper(, UMH_WAIT_PROC)
* pending, from drbd worker context.
- * If set, bdi_write_congested() returns true,
- * so shrink_page_list() would not recurse into,
- * and potentially deadlock on, this drbd worker.
*/
DISCONNECT_SENT,
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 3235532ae077..2e5fb7e442e3 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -909,8 +909,7 @@ static bool remote_due_to_read_balancing(struct drbd_device *device, sector_t se
switch (rbm) {
case RB_CONGESTED_REMOTE:
- return bdi_read_congested(
- device->ldev->backing_bdev->bd_disk->bdi);
+ return 0;
case RB_LEAST_PENDING:
return atomic_read(&device->local_cnt) >
atomic_read(&device->ap_pending_cnt) + atomic_read(&device->rs_pending_cnt);
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index df14e750e9fe..d632764da240 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -173,8 +173,6 @@ static void ext2_preread_inode(struct inode *inode)
struct backing_dev_info *bdi;
bdi = inode_to_bdi(inode);
- if (bdi_rw_congested(bdi))
- return;
block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 43287b0d3e9b..d1ebc9da7130 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -343,17 +343,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
struct bio *bio = wi->bio;
int err;
- if (segbuf->sb_nbio > 0 &&
- bdi_write_congested(segbuf->sb_super->s_bdi)) {
- wait_for_completion(&segbuf->sb_bio_event);
- segbuf->sb_nbio--;
- if (unlikely(atomic_read(&segbuf->sb_err))) {
- bio_put(bio);
- err = -EIO;
- goto failed;
- }
- }
-
bio->bi_end_io = nilfs_end_bio_write;
bio->bi_private = segbuf;
bio_set_op_attrs(bio, mode, mode_flags);
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 631c5a61d89b..22f73b3e888e 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -843,9 +843,6 @@ xfs_buf_readahead_map(
{
struct xfs_buf *bp;
- if (bdi_read_congested(target->bt_bdev->bd_disk->bdi))
- return;
-
xfs_buf_read_map(target, map, nmaps,
XBF_TRYLOCK | XBF_ASYNC | XBF_READ_AHEAD, &bp, ops,
__this_address);
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 860b675c2929..2d764566280c 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -135,11 +135,6 @@ static inline bool writeback_in_progress(struct bdi_writeback *wb)
struct backing_dev_info *inode_to_bdi(struct inode *inode);
-static inline int wb_congested(struct bdi_writeback *wb, int cong_bits)
-{
- return wb->congested & cong_bits;
-}
-
long congestion_wait(int sync, long timeout);
static inline bool mapping_can_writeback(struct address_space *mapping)
@@ -391,27 +386,6 @@ static inline void wb_blkcg_offline(struct blkcg *blkcg)
#endif /* CONFIG_CGROUP_WRITEBACK */
-static inline int bdi_congested(struct backing_dev_info *bdi, int cong_bits)
-{
- return wb_congested(&bdi->wb, cong_bits);
-}
-
-static inline int bdi_read_congested(struct backing_dev_info *bdi)
-{
- return bdi_congested(bdi, 1 << WB_sync_congested);
-}
-
-static inline int bdi_write_congested(struct backing_dev_info *bdi)
-{
- return bdi_congested(bdi, 1 << WB_async_congested);
-}
-
-static inline int bdi_rw_congested(struct backing_dev_info *bdi)
-{
- return bdi_congested(bdi, (1 << WB_sync_congested) |
- (1 << WB_async_congested));
-}
-
const char *bdi_dev_name(struct backing_dev_info *bdi);
#endif /* _LINUX_BACKING_DEV_H */
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 540aa0ea67ff..f46a7a17dc49 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2321,9 +2321,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec,
*/
static int current_may_throttle(void)
{
- return !(current->flags & PF_LOCAL_THROTTLE) ||
- current->backing_dev_info == NULL ||
- bdi_write_congested(current->backing_dev_info);
+ return !(current->flags & PF_LOCAL_THROTTLE);
}
/*
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions
@ 2021-12-13 4:14 ` NeilBrown
0 siblings, 0 replies; 8+ messages in thread
From: NeilBrown @ 2021-12-13 4:14 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, Philipp Reisner, Lars Ellenberg,
Jan Kara, Ryusuke Konishi, Darrick J. Wong
Cc: linux-xfs-u79uwXL29TY76Z2rM5mHXA,
linux-ext4-u79uwXL29TY76Z2rM5mHXA,
linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
These functions are no longer useful as the only bdis that report
congestion are in ceph, fuse, and nfs. None of those bdis can be the
target of the calls in drbd, ext2, nilfs2, or xfs.
Removing the test on bdi_write_contested() in current_may_throttle()
could cause a small change in behaviour, but only when PF_LOCAL_THROTTLE
is set.
So replace the calls by 'false' and simplify the code - and remove the
functions.
Signed-off-by: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
---
drivers/block/drbd/drbd_int.h | 3 ---
drivers/block/drbd/drbd_req.c | 3 +--
fs/ext2/ialloc.c | 2 --
fs/nilfs2/segbuf.c | 11 -----------
fs/xfs/xfs_buf.c | 3 ---
include/linux/backing-dev.h | 26 --------------------------
mm/vmscan.c | 4 +---
7 files changed, 2 insertions(+), 50 deletions(-)
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index f27d5b0f9a0b..f804b1bfb3e6 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -638,9 +638,6 @@ enum {
STATE_SENT, /* Do not change state/UUIDs while this is set */
CALLBACK_PENDING, /* Whether we have a call_usermodehelper(, UMH_WAIT_PROC)
* pending, from drbd worker context.
- * If set, bdi_write_congested() returns true,
- * so shrink_page_list() would not recurse into,
- * and potentially deadlock on, this drbd worker.
*/
DISCONNECT_SENT,
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 3235532ae077..2e5fb7e442e3 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -909,8 +909,7 @@ static bool remote_due_to_read_balancing(struct drbd_device *device, sector_t se
switch (rbm) {
case RB_CONGESTED_REMOTE:
- return bdi_read_congested(
- device->ldev->backing_bdev->bd_disk->bdi);
+ return 0;
case RB_LEAST_PENDING:
return atomic_read(&device->local_cnt) >
atomic_read(&device->ap_pending_cnt) + atomic_read(&device->rs_pending_cnt);
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index df14e750e9fe..d632764da240 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -173,8 +173,6 @@ static void ext2_preread_inode(struct inode *inode)
struct backing_dev_info *bdi;
bdi = inode_to_bdi(inode);
- if (bdi_rw_congested(bdi))
- return;
block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 43287b0d3e9b..d1ebc9da7130 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -343,17 +343,6 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
struct bio *bio = wi->bio;
int err;
- if (segbuf->sb_nbio > 0 &&
- bdi_write_congested(segbuf->sb_super->s_bdi)) {
- wait_for_completion(&segbuf->sb_bio_event);
- segbuf->sb_nbio--;
- if (unlikely(atomic_read(&segbuf->sb_err))) {
- bio_put(bio);
- err = -EIO;
- goto failed;
- }
- }
-
bio->bi_end_io = nilfs_end_bio_write;
bio->bi_private = segbuf;
bio_set_op_attrs(bio, mode, mode_flags);
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 631c5a61d89b..22f73b3e888e 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -843,9 +843,6 @@ xfs_buf_readahead_map(
{
struct xfs_buf *bp;
- if (bdi_read_congested(target->bt_bdev->bd_disk->bdi))
- return;
-
xfs_buf_read_map(target, map, nmaps,
XBF_TRYLOCK | XBF_ASYNC | XBF_READ_AHEAD, &bp, ops,
__this_address);
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 860b675c2929..2d764566280c 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -135,11 +135,6 @@ static inline bool writeback_in_progress(struct bdi_writeback *wb)
struct backing_dev_info *inode_to_bdi(struct inode *inode);
-static inline int wb_congested(struct bdi_writeback *wb, int cong_bits)
-{
- return wb->congested & cong_bits;
-}
-
long congestion_wait(int sync, long timeout);
static inline bool mapping_can_writeback(struct address_space *mapping)
@@ -391,27 +386,6 @@ static inline void wb_blkcg_offline(struct blkcg *blkcg)
#endif /* CONFIG_CGROUP_WRITEBACK */
-static inline int bdi_congested(struct backing_dev_info *bdi, int cong_bits)
-{
- return wb_congested(&bdi->wb, cong_bits);
-}
-
-static inline int bdi_read_congested(struct backing_dev_info *bdi)
-{
- return bdi_congested(bdi, 1 << WB_sync_congested);
-}
-
-static inline int bdi_write_congested(struct backing_dev_info *bdi)
-{
- return bdi_congested(bdi, 1 << WB_async_congested);
-}
-
-static inline int bdi_rw_congested(struct backing_dev_info *bdi)
-{
- return bdi_congested(bdi, (1 << WB_sync_congested) |
- (1 << WB_async_congested));
-}
-
const char *bdi_dev_name(struct backing_dev_info *bdi);
#endif /* _LINUX_BACKING_DEV_H */
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 540aa0ea67ff..f46a7a17dc49 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2321,9 +2321,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec,
*/
static int current_may_throttle(void)
{
- return !(current->flags & PF_LOCAL_THROTTLE) ||
- current->backing_dev_info == NULL ||
- bdi_write_congested(current->backing_dev_info);
+ return !(current->flags & PF_LOCAL_THROTTLE);
}
/*
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-12-13 14:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 14:04 [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2021-12-13 6:27 kernel test robot
2021-12-13 4:14 [PATCH 0/2] Remove some 'congested' tests NeilBrown
2021-12-13 4:14 ` [PATCH 2/2] Remove bdi_congested() and wb_congested() and related functions NeilBrown
2021-12-13 4:14 ` NeilBrown
2021-12-13 5:07 ` Dave Chinner
2021-12-13 7:04 ` NeilBrown
2021-12-13 5:56 ` kernel test robot
2021-12-13 5:56 ` 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.