Re: [PATCH 6/6] mm: Add memalloc_nowait

From: kernel test robot
Date: Thu Jun 25 2020 - 15:22:34 EST


Hi "Matthew,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on dm/for-next linus/master v5.8-rc2]
[cannot apply to xfs-linux/for-next next-20200625]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Matthew-Wilcox-Oracle/Overhaul-memalloc_no/20200625-193357
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 87e867b4269f29dac8190bca13912d08163a277f
config: nds32-randconfig-r011-20200624 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32

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

All errors (new ones prefixed by >>):

drivers/md/dm-bufio.c: In function '__alloc_buffer_wait_no_callback':
>> drivers/md/dm-bufio.c:860:27: error: implicit declaration of function 'memalloc_nowait_save'; did you mean 'memalloc_noio_save'? [-Werror=implicit-function-declaration]
860 | unsigned nowait_flag = memalloc_nowait_save();
| ^~~~~~~~~~~~~~~~~~~~
| memalloc_noio_save
>> drivers/md/dm-bufio.c:862:4: error: implicit declaration of function 'memalloc_nowait_restore'; did you mean 'memalloc_noio_restore'? [-Werror=implicit-function-declaration]
862 | memalloc_nowait_restore(nowait_flag);
| ^~~~~~~~~~~~~~~~~~~~~~~
| memalloc_noio_restore
cc1: some warnings being treated as errors

vim +860 drivers/md/dm-bufio.c

836
837 /*
838 * Allocate a new buffer. If the allocation is not possible, wait until
839 * some other thread frees a buffer.
840 *
841 * May drop the lock and regain it.
842 */
843 static struct dm_buffer *__alloc_buffer_wait_no_callback(struct dm_bufio_client *c, enum new_flag nf)
844 {
845 struct dm_buffer *b;
846 bool tried_noio_alloc = false;
847
848 /*
849 * dm-bufio is resistant to allocation failures (it just keeps
850 * one buffer reserved in cases all the allocations fail).
851 * So set flags to not try too hard:
852 * __GFP_NOMEMALLOC: don't use emergency reserves
853 * __GFP_NOWARN: don't print a warning in case of failure
854 *
855 * For debugging, if we set the cache size to 1, no new buffers will
856 * be allocated.
857 */
858 while (1) {
859 if (dm_bufio_cache_size_latch != 1) {
> 860 unsigned nowait_flag = memalloc_nowait_save();
861 b = alloc_buffer(c, GFP_KERNEL | __GFP_NOMEMALLOC | __GFP_NOWARN);
> 862 memalloc_nowait_restore(nowait_flag);
863 if (b)
864 return b;
865 }
866
867 if (nf == NF_PREFETCH)
868 return NULL;
869
870 if (dm_bufio_cache_size_latch != 1 && !tried_noio_alloc) {
871 unsigned noio_flag;
872
873 dm_bufio_unlock(c);
874 noio_flag = memalloc_noio_save();
875 b = alloc_buffer(c, GFP_KERNEL | __GFP_NOMEMALLOC | __GFP_NOWARN);
876 memalloc_noio_restore(noio_flag);
877 dm_bufio_lock(c);
878 if (b)
879 return b;
880 tried_noio_alloc = true;
881 }
882
883 if (!list_empty(&c->reserved_buffers)) {
884 b = list_entry(c->reserved_buffers.next,
885 struct dm_buffer, lru_list);
886 list_del(&b->lru_list);
887 c->need_reserved_buffers++;
888
889 return b;
890 }
891
892 b = __get_unclaimed_buffer(c);
893 if (b)
894 return b;
895
896 __wait_for_free_buffer(c);
897 }
898 }
899

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

Attachment: .config.gz
Description: application/gzip