Re: [PATCH 1/2] pinctrl: pinctrl-single: remove unused parameter
by kernel test robot
Hi Hanna,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on pinctrl/devel]
[also build test WARNING on v5.12-rc3 next-20210315]
[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/Hanna-Hawa/Fix-pinctrl-single-pc...
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
config: ia64-randconfig-r011-20210315 (attached as .config)
compiler: ia64-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
# https://github.com/0day-ci/linux/commit/518757b3bf7378b1c46be74640d0754e4...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hanna-Hawa/Fix-pinctrl-single-pcs_pin_dbg_show/20210315-230418
git checkout 518757b3bf7378b1c46be74640d0754e47e83624
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/pgtable.h:6,
from arch/ia64/include/asm/uaccess.h:40,
from include/linux/uaccess.h:11,
from arch/ia64/include/asm/sections.h:11,
from include/linux/interrupt.h:20,
from drivers/pinctrl/pinctrl-single.c:18:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
127 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
drivers/pinctrl/pinctrl-single.c: In function 'pcs_allocate_pin_table':
>> drivers/pinctrl/pinctrl-single.c:704:6: warning: variable 'num_pins_in_register' set but not used [-Wunused-but-set-variable]
704 | int num_pins_in_register = 0;
| ^~~~~~~~~~~~~~~~~~~~
vim +/num_pins_in_register +704 drivers/pinctrl/pinctrl-single.c
8b8b091bf07fa7 Tony Lindgren 2012-07-10 691
8b8b091bf07fa7 Tony Lindgren 2012-07-10 692 /**
8b8b091bf07fa7 Tony Lindgren 2012-07-10 693 * pcs_allocate_pin_table() - adds all the pins for the pinctrl driver
8b8b091bf07fa7 Tony Lindgren 2012-07-10 694 * @pcs: pcs driver instance
8b8b091bf07fa7 Tony Lindgren 2012-07-10 695 *
8b8b091bf07fa7 Tony Lindgren 2012-07-10 696 * In case of errors, resources are freed in pcs_free_resources.
8b8b091bf07fa7 Tony Lindgren 2012-07-10 697 *
8b8b091bf07fa7 Tony Lindgren 2012-07-10 698 * If your hardware needs holes in the address space, then just set
8b8b091bf07fa7 Tony Lindgren 2012-07-10 699 * up multiple driver instances.
8b8b091bf07fa7 Tony Lindgren 2012-07-10 700 */
150632b09aadf1 Greg Kroah-Hartman 2012-12-21 701 static int pcs_allocate_pin_table(struct pcs_device *pcs)
8b8b091bf07fa7 Tony Lindgren 2012-07-10 702 {
8b8b091bf07fa7 Tony Lindgren 2012-07-10 703 int mux_bytes, nr_pins, i;
6f924b0b7cbe2a Manjunathappa, Prakash 2013-05-21 @704 int num_pins_in_register = 0;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 705
8b8b091bf07fa7 Tony Lindgren 2012-07-10 706 mux_bytes = pcs->width / BITS_PER_BYTE;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 707
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 708 if (pcs->bits_per_mux) {
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 709 pcs->bits_per_pin = fls(pcs->fmask);
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 710 nr_pins = (pcs->size * BITS_PER_BYTE) / pcs->bits_per_pin;
6f924b0b7cbe2a Manjunathappa, Prakash 2013-05-21 711 num_pins_in_register = pcs->width / pcs->bits_per_pin;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 712 } else {
8b8b091bf07fa7 Tony Lindgren 2012-07-10 713 nr_pins = pcs->size / mux_bytes;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 714 }
8b8b091bf07fa7 Tony Lindgren 2012-07-10 715
8b8b091bf07fa7 Tony Lindgren 2012-07-10 716 dev_dbg(pcs->dev, "allocating %i pins\n", nr_pins);
a86854d0c599b3 Kees Cook 2018-06-12 717 pcs->pins.pa = devm_kcalloc(pcs->dev,
a86854d0c599b3 Kees Cook 2018-06-12 718 nr_pins, sizeof(*pcs->pins.pa),
8b8b091bf07fa7 Tony Lindgren 2012-07-10 719 GFP_KERNEL);
8b8b091bf07fa7 Tony Lindgren 2012-07-10 720 if (!pcs->pins.pa)
8b8b091bf07fa7 Tony Lindgren 2012-07-10 721 return -ENOMEM;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 722
8b8b091bf07fa7 Tony Lindgren 2012-07-10 723 pcs->desc.pins = pcs->pins.pa;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 724 pcs->desc.npins = nr_pins;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 725
8b8b091bf07fa7 Tony Lindgren 2012-07-10 726 for (i = 0; i < pcs->desc.npins; i++) {
8b8b091bf07fa7 Tony Lindgren 2012-07-10 727 unsigned offset;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 728 int res;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 729 int byte_num;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 730
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 731 if (pcs->bits_per_mux) {
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 732 byte_num = (pcs->bits_per_pin * i) / BITS_PER_BYTE;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 733 offset = (byte_num / mux_bytes) * mux_bytes;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 734 } else {
8b8b091bf07fa7 Tony Lindgren 2012-07-10 735 offset = i * mux_bytes;
4e7e8017a80e18 Manjunathappa, Prakash 2013-05-21 736 }
518757b3bf7378 Hanna Hawa 2021-03-15 737 res = pcs_add_pin(pcs, offset);
8b8b091bf07fa7 Tony Lindgren 2012-07-10 738 if (res < 0) {
8b8b091bf07fa7 Tony Lindgren 2012-07-10 739 dev_err(pcs->dev, "error adding pins: %i\n", res);
8b8b091bf07fa7 Tony Lindgren 2012-07-10 740 return res;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 741 }
8b8b091bf07fa7 Tony Lindgren 2012-07-10 742 }
8b8b091bf07fa7 Tony Lindgren 2012-07-10 743
8b8b091bf07fa7 Tony Lindgren 2012-07-10 744 return 0;
8b8b091bf07fa7 Tony Lindgren 2012-07-10 745 }
8b8b091bf07fa7 Tony Lindgren 2012-07-10 746
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
drivers/scsi/ufs/ufs-exynos.c:1268:34: warning: unused variable 'exynos_ufs_of_match'
by kernel test robot
Hi Alim,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
commit: d31503fe395d1d7e17b85eb7b291cc1a4bff2671 scsi: ufs: Allow exynos ufs driver to build as module
date: 9 months ago
config: x86_64-randconfig-a002-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d31503fe395d1d7e17b85eb7b291cc1a4bff2671
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/scsi/ufs/ufs-exynos.c:1268:34: warning: unused variable 'exynos_ufs_of_match' [-Wunused-const-variable]
static const struct of_device_id exynos_ufs_of_match[] = {
^
1 warning generated.
vim +/exynos_ufs_of_match +1268 drivers/scsi/ufs/ufs-exynos.c
55f4b1f73631a0 Alim Akhtar 2020-05-28 1267
55f4b1f73631a0 Alim Akhtar 2020-05-28 @1268 static const struct of_device_id exynos_ufs_of_match[] = {
55f4b1f73631a0 Alim Akhtar 2020-05-28 1269 { .compatible = "samsung,exynos7-ufs",
55f4b1f73631a0 Alim Akhtar 2020-05-28 1270 .data = &exynos_ufs_drvs },
55f4b1f73631a0 Alim Akhtar 2020-05-28 1271 {},
55f4b1f73631a0 Alim Akhtar 2020-05-28 1272 };
55f4b1f73631a0 Alim Akhtar 2020-05-28 1273
:::::: The code at line 1268 was first introduced by commit
:::::: 55f4b1f73631a0817717fe6e98517de51b4c3527 scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCs
:::::: TO: Alim Akhtar <alim.akhtar(a)samsung.com>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH 3/3] drm/ttm: switch to per device LRU lock
by kernel test robot
Hi "Christian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.12-rc3 next-20210315]
[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/Christian-K-nig/drm-ttm-move-swa...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-randconfig-m001-20210315 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
drivers/gpu/drm/ttm/ttm_device.c:158 ttm_device_swapout() warn: inconsistent returns '&bdev->lru_lock'.
drivers/gpu/drm/ttm/ttm_bo.c:665 ttm_mem_evict_first() error: we previously assumed 'bo' could be null (see line 662)
vim +158 drivers/gpu/drm/ttm/ttm_device.c
70ae63f3a85b97 Christian König 2021-03-15 123
70ae63f3a85b97 Christian König 2021-03-15 124 long ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
70ae63f3a85b97 Christian König 2021-03-15 125 gfp_t gfp_flags)
70ae63f3a85b97 Christian König 2021-03-15 126 {
70ae63f3a85b97 Christian König 2021-03-15 127 struct ttm_resource_manager *man;
824dca26fe3958 Christian König 2021-03-15 128 struct ttm_buffer_object *bo;
70ae63f3a85b97 Christian König 2021-03-15 129 unsigned i, j;
824dca26fe3958 Christian König 2021-03-15 130 int ret;
824dca26fe3958 Christian König 2021-03-15 131
1ed8d8fc515b90 Christian König 2021-03-15 132 spin_lock(&bdev->lru_lock);
70ae63f3a85b97 Christian König 2021-03-15 133 for (i = TTM_PL_SYSTEM; i < TTM_NUM_MEM_TYPES; ++i) {
70ae63f3a85b97 Christian König 2021-03-15 134 man = ttm_manager_type(bdev, i);
70ae63f3a85b97 Christian König 2021-03-15 135 if (!man || !man->use_tt)
70ae63f3a85b97 Christian König 2021-03-15 136 continue;
70ae63f3a85b97 Christian König 2021-03-15 137
70ae63f3a85b97 Christian König 2021-03-15 138 for (j = 0; j < TTM_MAX_BO_PRIORITY; ++j) {
70ae63f3a85b97 Christian König 2021-03-15 139 list_for_each_entry(bo, &man->lru[j], lru) {
70ae63f3a85b97 Christian König 2021-03-15 140 long num_pages;
824dca26fe3958 Christian König 2021-03-15 141
70ae63f3a85b97 Christian König 2021-03-15 142 if (!bo->ttm ||
70ae63f3a85b97 Christian König 2021-03-15 143 bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
70ae63f3a85b97 Christian König 2021-03-15 144 bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)
70ae63f3a85b97 Christian König 2021-03-15 145 continue;
70ae63f3a85b97 Christian König 2021-03-15 146
70ae63f3a85b97 Christian König 2021-03-15 147 num_pages = bo->ttm->num_pages;
824dca26fe3958 Christian König 2021-03-15 148 ret = ttm_bo_swapout(bo, ctx, gfp_flags);
824dca26fe3958 Christian König 2021-03-15 149 /* ttm_bo_swapout has dropped the lru_lock */
824dca26fe3958 Christian König 2021-03-15 150 if (!ret)
824dca26fe3958 Christian König 2021-03-15 151 return num_pages;
824dca26fe3958 Christian König 2021-03-15 152 if (ret != -EBUSY)
824dca26fe3958 Christian König 2021-03-15 153 return ret;
824dca26fe3958 Christian König 2021-03-15 154 }
824dca26fe3958 Christian König 2021-03-15 155 }
70ae63f3a85b97 Christian König 2021-03-15 156 }
1ed8d8fc515b90 Christian König 2021-03-15 157 spin_unlock(&bdev->lru_lock);
824dca26fe3958 Christian König 2021-03-15 @158 return 0;
824dca26fe3958 Christian König 2021-03-15 159 }
70ae63f3a85b97 Christian König 2021-03-15 160 EXPORT_SYMBOL(ttm_device_swapout);
824dca26fe3958 Christian König 2021-03-15 161
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH] mm/page_alloc: try oom if reclaim is unable to make forward progress
by kernel test robot
Hi Aaron,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-linux-mm/master]
url: https://github.com/0day-ci/linux/commits/Aaron-Tomlin/mm-page_alloc-try-o...
base: https://github.com/hnaz/linux-mm master
config: powerpc64-randconfig-r012-20210315 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/77338aaff2606a7715c832545e79370e8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Aaron-Tomlin/mm-page_alloc-try-oom-if-reclaim-is-unable-to-make-forward-progress/20210316-010203
git checkout 77338aaff2606a7715c832545e79370e849e3b4e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
mm/page_alloc.c:2538:5: warning: no previous prototype for function 'find_suitable_fallback' [-Wmissing-prototypes]
int find_suitable_fallback(struct free_area *area, unsigned int order,
^
mm/page_alloc.c:2538:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int find_suitable_fallback(struct free_area *area, unsigned int order,
^
static
>> mm/page_alloc.c:4444:3: error: use of undeclared identifier 'result'
result false;
^
>> mm/page_alloc.c:4447:50: error: expected ';' after return statement
return unreserve_highatomic_pageblock(ac, true)
^
;
>> mm/page_alloc.c:4507:2: error: expected expression
else
^
>> mm/page_alloc.c:4719:6: error: implicit declaration of function 'should_try_oom' [-Werror,-Wimplicit-function-declaration]
if (should_try_oom(no_progress_loops, compact_result))
^
>> mm/page_alloc.c:4720:11: error: expected ';' after goto statement
goto oom:
^
;
mm/page_alloc.c:6136:23: warning: no previous prototype for function 'memmap_init' [-Wmissing-prototypes]
void __meminit __weak memmap_init(unsigned long size, int nid,
^
mm/page_alloc.c:6136:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __meminit __weak memmap_init(unsigned long size, int nid,
^
static
2 warnings and 5 errors generated.
vim +/result +4444 mm/page_alloc.c
4409
4410 /*
4411 * Checks whether it makes sense to retry the reclaim to make a forward progress
4412 * for the given allocation request.
4413 *
4414 * We give up when we either have tried MAX_RECLAIM_RETRIES in a row
4415 * without success, or when we couldn't even meet the watermark if we
4416 * reclaimed all remaining pages on the LRU lists.
4417 *
4418 * Returns true if a retry is viable or false to enter the oom path.
4419 */
4420 static inline bool
4421 should_reclaim_retry(gfp_t gfp_mask, unsigned order,
4422 struct alloc_context *ac, int alloc_flags,
4423 bool did_some_progress, int *no_progress_loops)
4424 {
4425 struct zone *zone;
4426 struct zoneref *z;
4427 bool ret = false;
4428
4429 /*
4430 * Costly allocations might have made a progress but this doesn't mean
4431 * their order will become available due to high fragmentation so
4432 * always increment the no progress counter for them
4433 */
4434 if (did_some_progress && order <= PAGE_ALLOC_COSTLY_ORDER)
4435 *no_progress_loops = 0;
4436 else
4437 (*no_progress_loops)++;
4438
4439 /*
4440 * Make sure we converge to OOM if we cannot make any progress
4441 * several times in the row.
4442 */
4443 if (*no_progress_loops > MAX_RECLAIM_RETRIES)
> 4444 result false;
4445 /* Last chance before OOM, try draining highatomic_reserve once */
4446 else if (*no_progress_loops == MAX_RECLAIM_RETRIES)
> 4447 return unreserve_highatomic_pageblock(ac, true)
4448
4449 /*
4450 * Keep reclaiming pages while there is a chance this will lead
4451 * somewhere. If none of the target zones can satisfy our allocation
4452 * request even if all reclaimable pages are considered then we are
4453 * screwed and have to go OOM.
4454 */
4455 for_each_zone_zonelist_nodemask(zone, z, ac->zonelist,
4456 ac->highest_zoneidx, ac->nodemask) {
4457 unsigned long available;
4458 unsigned long reclaimable;
4459 unsigned long min_wmark = min_wmark_pages(zone);
4460 bool wmark;
4461
4462 available = reclaimable = zone_reclaimable_pages(zone);
4463 available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
4464
4465 /*
4466 * Would the allocation succeed if we reclaimed all
4467 * reclaimable pages?
4468 */
4469 wmark = __zone_watermark_ok(zone, order, min_wmark,
4470 ac->highest_zoneidx, alloc_flags, available);
4471 trace_reclaim_retry_zone(z, order, reclaimable,
4472 available, min_wmark, *no_progress_loops, wmark);
4473 if (wmark) {
4474 /*
4475 * If we didn't make any progress and have a lot of
4476 * dirty + writeback pages then we should wait for
4477 * an IO to complete to slow down the reclaim and
4478 * prevent from pre mature OOM
4479 */
4480 if (!did_some_progress) {
4481 unsigned long write_pending;
4482
4483 write_pending = zone_page_state_snapshot(zone,
4484 NR_ZONE_WRITE_PENDING);
4485
4486 if (2 * write_pending > reclaimable) {
4487 congestion_wait(BLK_RW_ASYNC, HZ/10);
4488 return true;
4489 }
4490 }
4491
4492 ret = true;
4493 goto out;
4494 }
4495 }
4496
4497 out:
4498 /*
4499 * Memory allocation/reclaim might be called from a WQ context and the
4500 * current implementation of the WQ concurrency control doesn't
4501 * recognize that a particular WQ is congested if the worker thread is
4502 * looping without ever sleeping. Therefore we have to do a short sleep
4503 * here rather than calling cond_resched().
4504 */
4505 if (current->flags & PF_WQ_WORKER)
4506 schedule_timeout_uninterruptible(1);
> 4507 else
4508 cond_resched();
4509 return ret;
4510 }
4511
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH] mm/page_alloc: try oom if reclaim is unable to make forward progress
by kernel test robot
Hi Aaron,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-linux-mm/master]
url: https://github.com/0day-ci/linux/commits/Aaron-Tomlin/mm-page_alloc-try-o...
base: https://github.com/hnaz/linux-mm master
config: riscv-randconfig-r026-20210315 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/77338aaff2606a7715c832545e79370e8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Aaron-Tomlin/mm-page_alloc-try-oom-if-reclaim-is-unable-to-make-forward-progress/20210316-010203
git checkout 77338aaff2606a7715c832545e79370e849e3b4e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:58:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:1017:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
mm/page_alloc.c:2538:5: warning: no previous prototype for function 'find_suitable_fallback' [-Wmissing-prototypes]
int find_suitable_fallback(struct free_area *area, unsigned int order,
^
mm/page_alloc.c:2538:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int find_suitable_fallback(struct free_area *area, unsigned int order,
^
static
mm/page_alloc.c:4444:3: error: use of undeclared identifier 'result'
result false;
^
mm/page_alloc.c:4447:50: error: expected ';' after return statement
return unreserve_highatomic_pageblock(ac, true)
^
;
mm/page_alloc.c:4507:2: error: expected expression
else
^
>> mm/page_alloc.c:4719:6: error: implicit declaration of function 'should_try_oom' [-Werror,-Wimplicit-function-declaration]
if (should_try_oom(no_progress_loops, compact_result))
^
mm/page_alloc.c:4720:11: error: expected ';' after goto statement
goto oom:
^
;
mm/page_alloc.c:6136:23: warning: no previous prototype for function 'memmap_init' [-Wmissing-prototypes]
void __meminit __weak memmap_init(unsigned long size, int nid,
^
mm/page_alloc.c:6136:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __meminit __weak memmap_init(unsigned long size, int nid,
^
static
9 warnings and 5 errors generated.
vim +/should_try_oom +4719 mm/page_alloc.c
4544
4545 static inline struct page *
4546 __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
4547 struct alloc_context *ac)
4548 {
4549 bool can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
4550 const bool costly_order = order > PAGE_ALLOC_COSTLY_ORDER;
4551 struct page *page = NULL;
4552 unsigned int alloc_flags;
4553 unsigned long did_some_progress;
4554 enum compact_priority compact_priority;
4555 enum compact_result compact_result;
4556 int compaction_retries;
4557 int no_progress_loops;
4558 unsigned int cpuset_mems_cookie;
4559 int reserve_flags;
4560
4561 /*
4562 * We also sanity check to catch abuse of atomic reserves being used by
4563 * callers that are not in atomic context.
4564 */
4565 if (WARN_ON_ONCE((gfp_mask & (__GFP_ATOMIC|__GFP_DIRECT_RECLAIM)) ==
4566 (__GFP_ATOMIC|__GFP_DIRECT_RECLAIM)))
4567 gfp_mask &= ~__GFP_ATOMIC;
4568
4569 retry_cpuset:
4570 compaction_retries = 0;
4571 no_progress_loops = 0;
4572 compact_priority = DEF_COMPACT_PRIORITY;
4573 cpuset_mems_cookie = read_mems_allowed_begin();
4574
4575 /*
4576 * The fast path uses conservative alloc_flags to succeed only until
4577 * kswapd needs to be woken up, and to avoid the cost of setting up
4578 * alloc_flags precisely. So we do that now.
4579 */
4580 alloc_flags = gfp_to_alloc_flags(gfp_mask);
4581
4582 /*
4583 * We need to recalculate the starting point for the zonelist iterator
4584 * because we might have used different nodemask in the fast path, or
4585 * there was a cpuset modification and we are retrying - otherwise we
4586 * could end up iterating over non-eligible zones endlessly.
4587 */
4588 ac->preferred_zoneref = first_zones_zonelist(ac->zonelist,
4589 ac->highest_zoneidx, ac->nodemask);
4590 if (!ac->preferred_zoneref->zone)
4591 goto nopage;
4592
4593 if (alloc_flags & ALLOC_KSWAPD)
4594 wake_all_kswapds(order, gfp_mask, ac);
4595
4596 /*
4597 * The adjusted alloc_flags might result in immediate success, so try
4598 * that first
4599 */
4600 page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
4601 if (page)
4602 goto got_pg;
4603
4604 /*
4605 * For costly allocations, try direct compaction first, as it's likely
4606 * that we have enough base pages and don't need to reclaim. For non-
4607 * movable high-order allocations, do that as well, as compaction will
4608 * try prevent permanent fragmentation by migrating from blocks of the
4609 * same migratetype.
4610 * Don't try this for allocations that are allowed to ignore
4611 * watermarks, as the ALLOC_NO_WATERMARKS attempt didn't yet happen.
4612 */
4613 if (can_direct_reclaim &&
4614 (costly_order ||
4615 (order > 0 && ac->migratetype != MIGRATE_MOVABLE))
4616 && !gfp_pfmemalloc_allowed(gfp_mask)) {
4617 page = __alloc_pages_direct_compact(gfp_mask, order,
4618 alloc_flags, ac,
4619 INIT_COMPACT_PRIORITY,
4620 &compact_result);
4621 if (page)
4622 goto got_pg;
4623
4624 /*
4625 * Checks for costly allocations with __GFP_NORETRY, which
4626 * includes some THP page fault allocations
4627 */
4628 if (costly_order && (gfp_mask & __GFP_NORETRY)) {
4629 /*
4630 * If allocating entire pageblock(s) and compaction
4631 * failed because all zones are below low watermarks
4632 * or is prohibited because it recently failed at this
4633 * order, fail immediately unless the allocator has
4634 * requested compaction and reclaim retry.
4635 *
4636 * Reclaim is
4637 * - potentially very expensive because zones are far
4638 * below their low watermarks or this is part of very
4639 * bursty high order allocations,
4640 * - not guaranteed to help because isolate_freepages()
4641 * may not iterate over freed pages as part of its
4642 * linear scan, and
4643 * - unlikely to make entire pageblocks free on its
4644 * own.
4645 */
4646 if (compact_result == COMPACT_SKIPPED ||
4647 compact_result == COMPACT_DEFERRED)
4648 goto nopage;
4649
4650 /*
4651 * Looks like reclaim/compaction is worth trying, but
4652 * sync compaction could be very expensive, so keep
4653 * using async compaction.
4654 */
4655 compact_priority = INIT_COMPACT_PRIORITY;
4656 }
4657 }
4658
4659 retry:
4660 /* Ensure kswapd doesn't accidentally go to sleep as long as we loop */
4661 if (alloc_flags & ALLOC_KSWAPD)
4662 wake_all_kswapds(order, gfp_mask, ac);
4663
4664 reserve_flags = __gfp_pfmemalloc_flags(gfp_mask);
4665 if (reserve_flags)
4666 alloc_flags = current_alloc_flags(gfp_mask, reserve_flags);
4667
4668 /*
4669 * Reset the nodemask and zonelist iterators if memory policies can be
4670 * ignored. These allocations are high priority and system rather than
4671 * user oriented.
4672 */
4673 if (!(alloc_flags & ALLOC_CPUSET) || reserve_flags) {
4674 ac->nodemask = NULL;
4675 ac->preferred_zoneref = first_zones_zonelist(ac->zonelist,
4676 ac->highest_zoneidx, ac->nodemask);
4677 }
4678
4679 /* Attempt with potentially adjusted zonelist and alloc_flags */
4680 page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
4681 if (page)
4682 goto got_pg;
4683
4684 /* Caller is not willing to reclaim, we can't balance anything */
4685 if (!can_direct_reclaim)
4686 goto nopage;
4687
4688 /* Avoid recursion of direct reclaim */
4689 if (current->flags & PF_MEMALLOC)
4690 goto nopage;
4691
4692 /* Try direct reclaim and then allocating */
4693 page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac,
4694 &did_some_progress);
4695 if (page)
4696 goto got_pg;
4697
4698 /* Try direct compaction and then allocating */
4699 page = __alloc_pages_direct_compact(gfp_mask, order, alloc_flags, ac,
4700 compact_priority, &compact_result);
4701 if (page)
4702 goto got_pg;
4703
4704 /* Do not loop if specifically requested */
4705 if (gfp_mask & __GFP_NORETRY)
4706 goto nopage;
4707
4708 /*
4709 * Do not retry costly high order allocations unless they are
4710 * __GFP_RETRY_MAYFAIL
4711 */
4712 if (costly_order && !(gfp_mask & __GFP_RETRY_MAYFAIL))
4713 goto nopage;
4714
4715 if (should_reclaim_retry(gfp_mask, order, ac, alloc_flags,
4716 did_some_progress > 0, &no_progress_loops))
4717 goto retry;
4718
> 4719 if (should_try_oom(no_progress_loops, compact_result))
4720 goto oom:
4721 /*
4722 * It doesn't make any sense to retry for the compaction if the order-0
4723 * reclaim is not able to make any progress because the current
4724 * implementation of the compaction depends on the sufficient amount
4725 * of free memory (see __compaction_suitable)
4726 */
4727 if (did_some_progress > 0 &&
4728 should_compact_retry(ac, order, alloc_flags,
4729 compact_result, &compact_priority,
4730 &compaction_retries))
4731 goto retry;
4732
4733
4734 /* Deal with possible cpuset update races before we start OOM killing */
4735 if (check_retry_cpuset(cpuset_mems_cookie, ac))
4736 goto retry_cpuset;
4737
4738 oom:
4739 /* Reclaim has failed us, start killing things */
4740 page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress);
4741 if (page)
4742 goto got_pg;
4743
4744 /* Avoid allocations with no watermarks from looping endlessly */
4745 if (tsk_is_oom_victim(current) &&
4746 (alloc_flags & ALLOC_OOM ||
4747 (gfp_mask & __GFP_NOMEMALLOC)))
4748 goto nopage;
4749
4750 /* Retry as long as the OOM killer is making progress */
4751 if (did_some_progress) {
4752 no_progress_loops = 0;
4753 goto retry;
4754 }
4755
4756 nopage:
4757 /* Deal with possible cpuset update races before we fail */
4758 if (check_retry_cpuset(cpuset_mems_cookie, ac))
4759 goto retry_cpuset;
4760
4761 /*
4762 * Make sure that __GFP_NOFAIL request doesn't leak out and make sure
4763 * we always retry
4764 */
4765 if (gfp_mask & __GFP_NOFAIL) {
4766 /*
4767 * All existing users of the __GFP_NOFAIL are blockable, so warn
4768 * of any new users that actually require GFP_NOWAIT
4769 */
4770 if (WARN_ON_ONCE(!can_direct_reclaim))
4771 goto fail;
4772
4773 /*
4774 * PF_MEMALLOC request from this context is rather bizarre
4775 * because we cannot reclaim anything and only can loop waiting
4776 * for somebody to do a work for us
4777 */
4778 WARN_ON_ONCE(current->flags & PF_MEMALLOC);
4779
4780 /*
4781 * non failing costly orders are a hard requirement which we
4782 * are not prepared for much so let's warn about these users
4783 * so that we can identify them and convert them to something
4784 * else.
4785 */
4786 WARN_ON_ONCE(order > PAGE_ALLOC_COSTLY_ORDER);
4787
4788 /*
4789 * Help non-failing allocations by giving them access to memory
4790 * reserves but do not use ALLOC_NO_WATERMARKS because this
4791 * could deplete whole memory reserves which would just make
4792 * the situation worse
4793 */
4794 page = __alloc_pages_cpuset_fallback(gfp_mask, order, ALLOC_HARDER, ac);
4795 if (page)
4796 goto got_pg;
4797
4798 cond_resched();
4799 goto retry;
4800 }
4801 fail:
4802 warn_alloc(gfp_mask, ac->nodemask,
4803 "page allocation failure: order:%u", order);
4804 got_pg:
4805 return page;
4806 }
4807
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH] mm/page_alloc: try oom if reclaim is unable to make forward progress
by kernel test robot
Hi Aaron,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-linux-mm/master]
url: https://github.com/0day-ci/linux/commits/Aaron-Tomlin/mm-page_alloc-try-o...
base: https://github.com/hnaz/linux-mm master
config: arc-randconfig-r024-20210315 (attached as .config)
compiler: arceb-elf-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
# https://github.com/0day-ci/linux/commit/77338aaff2606a7715c832545e79370e8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Aaron-Tomlin/mm-page_alloc-try-oom-if-reclaim-is-unable-to-make-forward-progress/20210316-010203
git checkout 77338aaff2606a7715c832545e79370e849e3b4e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
mm/page_alloc.c: In function 'should_reclaim_retry':
>> mm/page_alloc.c:4444:3: error: 'result' undeclared (first use in this function)
4444 | result false;
| ^~~~~~
mm/page_alloc.c:4444:3: note: each undeclared identifier is reported only once for each function it appears in
>> mm/page_alloc.c:4444:9: error: expected ';' before 'false'
4444 | result false;
| ^~~~~~
| ;
>> mm/page_alloc.c:4447:50: error: expected ';' before 'for'
4447 | return unreserve_highatomic_pageblock(ac, true)
| ^
| ;
mm/page_alloc.c:4426:18: warning: unused variable 'z' [-Wunused-variable]
4426 | struct zoneref *z;
| ^
mm/page_alloc.c:4425:15: warning: unused variable 'zone' [-Wunused-variable]
4425 | struct zone *zone;
| ^~~~
mm/page_alloc.c: In function '__alloc_pages_slowpath':
>> mm/page_alloc.c:4720:11: error: expected ';' before ':' token
4720 | goto oom:
| ^
| ;
>> mm/page_alloc.c:4556:6: warning: variable 'compaction_retries' set but not used [-Wunused-but-set-variable]
4556 | int compaction_retries;
| ^~~~~~~~~~~~~~~~~~
mm/page_alloc.c: At top level:
mm/page_alloc.c:6136:23: warning: no previous prototype for 'memmap_init' [-Wmissing-prototypes]
6136 | void __meminit __weak memmap_init(unsigned long size, int nid,
| ^~~~~~~~~~~
vim +/result +4444 mm/page_alloc.c
4409
4410 /*
4411 * Checks whether it makes sense to retry the reclaim to make a forward progress
4412 * for the given allocation request.
4413 *
4414 * We give up when we either have tried MAX_RECLAIM_RETRIES in a row
4415 * without success, or when we couldn't even meet the watermark if we
4416 * reclaimed all remaining pages on the LRU lists.
4417 *
4418 * Returns true if a retry is viable or false to enter the oom path.
4419 */
4420 static inline bool
4421 should_reclaim_retry(gfp_t gfp_mask, unsigned order,
4422 struct alloc_context *ac, int alloc_flags,
4423 bool did_some_progress, int *no_progress_loops)
4424 {
4425 struct zone *zone;
4426 struct zoneref *z;
4427 bool ret = false;
4428
4429 /*
4430 * Costly allocations might have made a progress but this doesn't mean
4431 * their order will become available due to high fragmentation so
4432 * always increment the no progress counter for them
4433 */
4434 if (did_some_progress && order <= PAGE_ALLOC_COSTLY_ORDER)
4435 *no_progress_loops = 0;
4436 else
4437 (*no_progress_loops)++;
4438
4439 /*
4440 * Make sure we converge to OOM if we cannot make any progress
4441 * several times in the row.
4442 */
4443 if (*no_progress_loops > MAX_RECLAIM_RETRIES)
> 4444 result false;
4445 /* Last chance before OOM, try draining highatomic_reserve once */
4446 else if (*no_progress_loops == MAX_RECLAIM_RETRIES)
> 4447 return unreserve_highatomic_pageblock(ac, true)
4448
4449 /*
4450 * Keep reclaiming pages while there is a chance this will lead
4451 * somewhere. If none of the target zones can satisfy our allocation
4452 * request even if all reclaimable pages are considered then we are
4453 * screwed and have to go OOM.
4454 */
4455 for_each_zone_zonelist_nodemask(zone, z, ac->zonelist,
4456 ac->highest_zoneidx, ac->nodemask) {
4457 unsigned long available;
4458 unsigned long reclaimable;
4459 unsigned long min_wmark = min_wmark_pages(zone);
4460 bool wmark;
4461
4462 available = reclaimable = zone_reclaimable_pages(zone);
4463 available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
4464
4465 /*
4466 * Would the allocation succeed if we reclaimed all
4467 * reclaimable pages?
4468 */
4469 wmark = __zone_watermark_ok(zone, order, min_wmark,
4470 ac->highest_zoneidx, alloc_flags, available);
4471 trace_reclaim_retry_zone(z, order, reclaimable,
4472 available, min_wmark, *no_progress_loops, wmark);
4473 if (wmark) {
4474 /*
4475 * If we didn't make any progress and have a lot of
4476 * dirty + writeback pages then we should wait for
4477 * an IO to complete to slow down the reclaim and
4478 * prevent from pre mature OOM
4479 */
4480 if (!did_some_progress) {
4481 unsigned long write_pending;
4482
4483 write_pending = zone_page_state_snapshot(zone,
4484 NR_ZONE_WRITE_PENDING);
4485
4486 if (2 * write_pending > reclaimable) {
4487 congestion_wait(BLK_RW_ASYNC, HZ/10);
4488 return true;
4489 }
4490 }
4491
4492 ret = true;
4493 goto out;
4494 }
4495 }
4496
4497 out:
4498 /*
4499 * Memory allocation/reclaim might be called from a WQ context and the
4500 * current implementation of the WQ concurrency control doesn't
4501 * recognize that a particular WQ is congested if the worker thread is
4502 * looping without ever sleeping. Therefore we have to do a short sleep
4503 * here rather than calling cond_resched().
4504 */
4505 if (current->flags & PF_WQ_WORKER)
4506 schedule_timeout_uninterruptible(1);
4507 else
4508 cond_resched();
4509 return ret;
4510 }
4511
4512 static inline bool
4513 check_retry_cpuset(int cpuset_mems_cookie, struct alloc_context *ac)
4514 {
4515 /*
4516 * It's possible that cpuset's mems_allowed and the nodemask from
4517 * mempolicy don't intersect. This should be normally dealt with by
4518 * policy_nodemask(), but it's possible to race with cpuset update in
4519 * such a way the check therein was true, and then it became false
4520 * before we got our cpuset_mems_cookie here.
4521 * This assumes that for all allocations, ac->nodemask can come only
4522 * from MPOL_BIND mempolicy (whose documented semantics is to be ignored
4523 * when it does not intersect with the cpuset restrictions) or the
4524 * caller can deal with a violated nodemask.
4525 */
4526 if (cpusets_enabled() && ac->nodemask &&
4527 !cpuset_nodemask_valid_mems_allowed(ac->nodemask)) {
4528 ac->nodemask = NULL;
4529 return true;
4530 }
4531
4532 /*
4533 * When updating a task's mems_allowed or mempolicy nodemask, it is
4534 * possible to race with parallel threads in such a way that our
4535 * allocation can fail while the mask is being updated. If we are about
4536 * to fail, check if the cpuset changed during allocation and if so,
4537 * retry.
4538 */
4539 if (read_mems_allowed_retry(cpuset_mems_cookie))
4540 return true;
4541
4542 return false;
4543 }
4544
4545 static inline struct page *
4546 __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
4547 struct alloc_context *ac)
4548 {
4549 bool can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
4550 const bool costly_order = order > PAGE_ALLOC_COSTLY_ORDER;
4551 struct page *page = NULL;
4552 unsigned int alloc_flags;
4553 unsigned long did_some_progress;
4554 enum compact_priority compact_priority;
4555 enum compact_result compact_result;
> 4556 int compaction_retries;
4557 int no_progress_loops;
4558 unsigned int cpuset_mems_cookie;
4559 int reserve_flags;
4560
4561 /*
4562 * We also sanity check to catch abuse of atomic reserves being used by
4563 * callers that are not in atomic context.
4564 */
4565 if (WARN_ON_ONCE((gfp_mask & (__GFP_ATOMIC|__GFP_DIRECT_RECLAIM)) ==
4566 (__GFP_ATOMIC|__GFP_DIRECT_RECLAIM)))
4567 gfp_mask &= ~__GFP_ATOMIC;
4568
4569 retry_cpuset:
4570 compaction_retries = 0;
4571 no_progress_loops = 0;
4572 compact_priority = DEF_COMPACT_PRIORITY;
4573 cpuset_mems_cookie = read_mems_allowed_begin();
4574
4575 /*
4576 * The fast path uses conservative alloc_flags to succeed only until
4577 * kswapd needs to be woken up, and to avoid the cost of setting up
4578 * alloc_flags precisely. So we do that now.
4579 */
4580 alloc_flags = gfp_to_alloc_flags(gfp_mask);
4581
4582 /*
4583 * We need to recalculate the starting point for the zonelist iterator
4584 * because we might have used different nodemask in the fast path, or
4585 * there was a cpuset modification and we are retrying - otherwise we
4586 * could end up iterating over non-eligible zones endlessly.
4587 */
4588 ac->preferred_zoneref = first_zones_zonelist(ac->zonelist,
4589 ac->highest_zoneidx, ac->nodemask);
4590 if (!ac->preferred_zoneref->zone)
4591 goto nopage;
4592
4593 if (alloc_flags & ALLOC_KSWAPD)
4594 wake_all_kswapds(order, gfp_mask, ac);
4595
4596 /*
4597 * The adjusted alloc_flags might result in immediate success, so try
4598 * that first
4599 */
4600 page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
4601 if (page)
4602 goto got_pg;
4603
4604 /*
4605 * For costly allocations, try direct compaction first, as it's likely
4606 * that we have enough base pages and don't need to reclaim. For non-
4607 * movable high-order allocations, do that as well, as compaction will
4608 * try prevent permanent fragmentation by migrating from blocks of the
4609 * same migratetype.
4610 * Don't try this for allocations that are allowed to ignore
4611 * watermarks, as the ALLOC_NO_WATERMARKS attempt didn't yet happen.
4612 */
4613 if (can_direct_reclaim &&
4614 (costly_order ||
4615 (order > 0 && ac->migratetype != MIGRATE_MOVABLE))
4616 && !gfp_pfmemalloc_allowed(gfp_mask)) {
4617 page = __alloc_pages_direct_compact(gfp_mask, order,
4618 alloc_flags, ac,
4619 INIT_COMPACT_PRIORITY,
4620 &compact_result);
4621 if (page)
4622 goto got_pg;
4623
4624 /*
4625 * Checks for costly allocations with __GFP_NORETRY, which
4626 * includes some THP page fault allocations
4627 */
4628 if (costly_order && (gfp_mask & __GFP_NORETRY)) {
4629 /*
4630 * If allocating entire pageblock(s) and compaction
4631 * failed because all zones are below low watermarks
4632 * or is prohibited because it recently failed at this
4633 * order, fail immediately unless the allocator has
4634 * requested compaction and reclaim retry.
4635 *
4636 * Reclaim is
4637 * - potentially very expensive because zones are far
4638 * below their low watermarks or this is part of very
4639 * bursty high order allocations,
4640 * - not guaranteed to help because isolate_freepages()
4641 * may not iterate over freed pages as part of its
4642 * linear scan, and
4643 * - unlikely to make entire pageblocks free on its
4644 * own.
4645 */
4646 if (compact_result == COMPACT_SKIPPED ||
4647 compact_result == COMPACT_DEFERRED)
4648 goto nopage;
4649
4650 /*
4651 * Looks like reclaim/compaction is worth trying, but
4652 * sync compaction could be very expensive, so keep
4653 * using async compaction.
4654 */
4655 compact_priority = INIT_COMPACT_PRIORITY;
4656 }
4657 }
4658
4659 retry:
4660 /* Ensure kswapd doesn't accidentally go to sleep as long as we loop */
4661 if (alloc_flags & ALLOC_KSWAPD)
4662 wake_all_kswapds(order, gfp_mask, ac);
4663
4664 reserve_flags = __gfp_pfmemalloc_flags(gfp_mask);
4665 if (reserve_flags)
4666 alloc_flags = current_alloc_flags(gfp_mask, reserve_flags);
4667
4668 /*
4669 * Reset the nodemask and zonelist iterators if memory policies can be
4670 * ignored. These allocations are high priority and system rather than
4671 * user oriented.
4672 */
4673 if (!(alloc_flags & ALLOC_CPUSET) || reserve_flags) {
4674 ac->nodemask = NULL;
4675 ac->preferred_zoneref = first_zones_zonelist(ac->zonelist,
4676 ac->highest_zoneidx, ac->nodemask);
4677 }
4678
4679 /* Attempt with potentially adjusted zonelist and alloc_flags */
4680 page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
4681 if (page)
4682 goto got_pg;
4683
4684 /* Caller is not willing to reclaim, we can't balance anything */
4685 if (!can_direct_reclaim)
4686 goto nopage;
4687
4688 /* Avoid recursion of direct reclaim */
4689 if (current->flags & PF_MEMALLOC)
4690 goto nopage;
4691
4692 /* Try direct reclaim and then allocating */
4693 page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac,
4694 &did_some_progress);
4695 if (page)
4696 goto got_pg;
4697
4698 /* Try direct compaction and then allocating */
4699 page = __alloc_pages_direct_compact(gfp_mask, order, alloc_flags, ac,
4700 compact_priority, &compact_result);
4701 if (page)
4702 goto got_pg;
4703
4704 /* Do not loop if specifically requested */
4705 if (gfp_mask & __GFP_NORETRY)
4706 goto nopage;
4707
4708 /*
4709 * Do not retry costly high order allocations unless they are
4710 * __GFP_RETRY_MAYFAIL
4711 */
4712 if (costly_order && !(gfp_mask & __GFP_RETRY_MAYFAIL))
4713 goto nopage;
4714
4715 if (should_reclaim_retry(gfp_mask, order, ac, alloc_flags,
4716 did_some_progress > 0, &no_progress_loops))
4717 goto retry;
4718
4719 if (should_try_oom(no_progress_loops, compact_result))
4720 goto oom:
4721 /*
4722 * It doesn't make any sense to retry for the compaction if the order-0
4723 * reclaim is not able to make any progress because the current
4724 * implementation of the compaction depends on the sufficient amount
4725 * of free memory (see __compaction_suitable)
4726 */
4727 if (did_some_progress > 0 &&
4728 should_compact_retry(ac, order, alloc_flags,
4729 compact_result, &compact_priority,
4730 &compaction_retries))
4731 goto retry;
4732
4733
4734 /* Deal with possible cpuset update races before we start OOM killing */
4735 if (check_retry_cpuset(cpuset_mems_cookie, ac))
4736 goto retry_cpuset;
4737
4738 oom:
4739 /* Reclaim has failed us, start killing things */
4740 page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress);
4741 if (page)
4742 goto got_pg;
4743
4744 /* Avoid allocations with no watermarks from looping endlessly */
4745 if (tsk_is_oom_victim(current) &&
4746 (alloc_flags & ALLOC_OOM ||
4747 (gfp_mask & __GFP_NOMEMALLOC)))
4748 goto nopage;
4749
4750 /* Retry as long as the OOM killer is making progress */
4751 if (did_some_progress) {
4752 no_progress_loops = 0;
4753 goto retry;
4754 }
4755
4756 nopage:
4757 /* Deal with possible cpuset update races before we fail */
4758 if (check_retry_cpuset(cpuset_mems_cookie, ac))
4759 goto retry_cpuset;
4760
4761 /*
4762 * Make sure that __GFP_NOFAIL request doesn't leak out and make sure
4763 * we always retry
4764 */
4765 if (gfp_mask & __GFP_NOFAIL) {
4766 /*
4767 * All existing users of the __GFP_NOFAIL are blockable, so warn
4768 * of any new users that actually require GFP_NOWAIT
4769 */
4770 if (WARN_ON_ONCE(!can_direct_reclaim))
4771 goto fail;
4772
4773 /*
4774 * PF_MEMALLOC request from this context is rather bizarre
4775 * because we cannot reclaim anything and only can loop waiting
4776 * for somebody to do a work for us
4777 */
4778 WARN_ON_ONCE(current->flags & PF_MEMALLOC);
4779
4780 /*
4781 * non failing costly orders are a hard requirement which we
4782 * are not prepared for much so let's warn about these users
4783 * so that we can identify them and convert them to something
4784 * else.
4785 */
4786 WARN_ON_ONCE(order > PAGE_ALLOC_COSTLY_ORDER);
4787
4788 /*
4789 * Help non-failing allocations by giving them access to memory
4790 * reserves but do not use ALLOC_NO_WATERMARKS because this
4791 * could deplete whole memory reserves which would just make
4792 * the situation worse
4793 */
4794 page = __alloc_pages_cpuset_fallback(gfp_mask, order, ALLOC_HARDER, ac);
4795 if (page)
4796 goto got_pg;
4797
4798 cond_resched();
4799 goto retry;
4800 }
4801 fail:
4802 warn_alloc(gfp_mask, ac->nodemask,
4803 "page allocation failure: order:%u", order);
4804 got_pg:
4805 return page;
4806 }
4807
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[drm-intel:topic/core-for-CI 20/30] include/linux/kconfig.h:7:10: fatal error: generated/autoconf.h: No such file or directory
by kernel test robot
tree: git://anongit.freedesktop.org/drm-intel topic/core-for-CI
head: 785b066b32b630e4735ca6e51acbb067703e2d3a
commit: 98a674f9cd22c2cf6f507ccc1f26fae3c91d1271 [20/30] Revert "drm/i915: Don't select BROKEN"
config: alpha-randconfig-r033-20210315 (attached as .config)
compiler: alpha-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
git remote add drm-intel git://anongit.freedesktop.org/drm-intel
git fetch --no-tags drm-intel topic/core-for-CI
git checkout 98a674f9cd22c2cf6f507ccc1f26fae3c91d1271
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from scripts/selinux/mdp/mdp.c:22:
>> include/linux/kconfig.h:7:10: fatal error: generated/autoconf.h: No such file or directory
7 | #include <generated/autoconf.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
--
Makefile arch include kernel scripts source usr [scripts/kconfig/Makefile:63: syncconfig] Error 1
Makefile arch include kernel scripts source usr [Makefile:600: syncconfig] Error 2
Makefile arch include kernel scripts source usr [Makefile:709: include/config/auto.conf.cmd] Error 2
Failed to remake makefile 'include/config/auto.conf.cmd'.
Failed to remake makefile 'include/config/auto.conf'.
In file included from scripts/selinux/mdp/mdp.c:22:
>> include/linux/kconfig.h:7:10: fatal error: generated/autoconf.h: No such file or directory
7 | #include <generated/autoconf.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile arch include kernel scripts source usr [scripts/Makefile.host:95: scripts/selinux/mdp/mdp] Error 1
Target '__build' not remade because of errors.
Makefile arch include kernel scripts source usr [scripts/Makefile.build:514: scripts/selinux/mdp] Error 2
Target '__build' not remade because of errors.
Makefile arch include kernel scripts source usr [scripts/Makefile.build:514: scripts/selinux] Error 2
Target '__build' not remade because of errors.
Makefile arch include kernel scripts source usr [Makefile:1217: scripts] Error 2
Target 'modules_prepare' not remade because of errors.
make: Makefile arch include kernel scripts source usr [Makefile:215: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
Makefile arch include kernel scripts source usr [scripts/kconfig/Makefile:63: syncconfig] Error 1
Makefile arch include kernel scripts source usr [Makefile:600: syncconfig] Error 2
Makefile arch include kernel scripts source usr [Makefile:709: include/config/auto.conf.cmd] Error 2
Failed to remake makefile 'include/config/auto.conf.cmd'.
Failed to remake makefile 'include/config/auto.conf'.
In file included from scripts/selinux/mdp/mdp.c:22:
>> include/linux/kconfig.h:7:10: fatal error: generated/autoconf.h: No such file or directory
7 | #include <generated/autoconf.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile arch include kernel scripts source usr [scripts/Makefile.host:95: scripts/selinux/mdp/mdp] Error 1
Target '__build' not remade because of errors.
Makefile arch include kernel scripts source usr [scripts/Makefile.build:514: scripts/selinux/mdp] Error 2
Target '__build' not remade because of errors.
Makefile arch include kernel scripts source usr [scripts/Makefile.build:514: scripts/selinux] Error 2
Target '__build' not remade because of errors.
Makefile arch include kernel scripts source usr [Makefile:1217: scripts] Error 2
Target 'prepare' not remade because of errors.
make: Makefile arch include kernel scripts source usr [Makefile:215: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +7 include/linux/kconfig.h
8b59cd81dc5e72 Masahiro Yamada 2020-04-23 6
2a11c8ea20bf85 Michal Marek 2011-07-20 @7 #include <generated/autoconf.h>
2a11c8ea20bf85 Michal Marek 2011-07-20 8
:::::: The code at line 7 was first introduced by commit
:::::: 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99 kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE()
:::::: TO: Michal Marek <mmarek(a)suse.cz>
:::::: CC: Michal Marek <mmarek(a)suse.cz>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH 2/3] drm/ttm: remove swap LRU v2
by kernel test robot
Hi "Christian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.12-rc3 next-20210315]
[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/Christian-K-nig/drm-ttm-move-swa...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-s002-20210315 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://github.com/0day-ci/linux/commit/70ae63f3a85b9791dfcf38034c304aedd...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christian-K-nig/drm-ttm-move-swapout-logic-around/20210316-000551
git checkout 70ae63f3a85b9791dfcf38034c304aedda122e7b
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/gpu/drm/ttm/ttm_device.c:42:1: sparse: sparse: symbol 'ttm_global_mutex' was not declared. Should it be static?
drivers/gpu/drm/ttm/ttm_device.c:43:10: sparse: sparse: symbol 'ttm_glob_use_count' was not declared. Should it be static?
>> drivers/gpu/drm/ttm/ttm_device.c:125:6: sparse: sparse: context imbalance in 'ttm_device_swapout' - wrong count at exit
vim +/ttm_device_swapout +125 drivers/gpu/drm/ttm/ttm_device.c
124
> 125 long ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
126 gfp_t gfp_flags)
127 {
128 struct ttm_global *glob = &ttm_glob;
129 struct ttm_resource_manager *man;
130 struct ttm_buffer_object *bo;
131 unsigned i, j;
132 int ret;
133
134 spin_lock(&glob->lru_lock);
135 for (i = TTM_PL_SYSTEM; i < TTM_NUM_MEM_TYPES; ++i) {
136 man = ttm_manager_type(bdev, i);
137 if (!man || !man->use_tt)
138 continue;
139
140 for (j = 0; j < TTM_MAX_BO_PRIORITY; ++j) {
141 list_for_each_entry(bo, &man->lru[j], lru) {
142 long num_pages;
143
144 if (!bo->ttm ||
145 bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
146 bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)
147 continue;
148
149 num_pages = bo->ttm->num_pages;
150 ret = ttm_bo_swapout(bo, ctx, gfp_flags);
151 /* ttm_bo_swapout has dropped the lru_lock */
152 if (!ret)
153 return num_pages;
154 if (ret != -EBUSY)
155 return ret;
156 }
157 }
158 }
159 spin_unlock(&glob->lru_lock);
160 return 0;
161 }
162 EXPORT_SYMBOL(ttm_device_swapout);
163
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH 1/3] drm/ttm: move swapout logic around
by kernel test robot
Hi "Christian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.12-rc3 next-20210315]
[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/Christian-K-nig/drm-ttm-move-swa...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/824dca26fe395899b41d9790944ddea34...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christian-K-nig/drm-ttm-move-swapout-logic-around/20210316-000551
git checkout 824dca26fe395899b41d9790944ddea345f7a6fd
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/gpu/drm/ttm/ttm_device.c:42: warning: Function parameter or member 'ttm_global_mutex' not described in 'DEFINE_MUTEX'
drivers/gpu/drm/ttm/ttm_device.c:42: warning: expecting prototype for ttm_global_mutex(). Prototype was for DEFINE_MUTEX() instead
drivers/gpu/drm/ttm/ttm_device.c:110: warning: Function parameter or member 'ctx' not described in 'ttm_global_swapout'
drivers/gpu/drm/ttm/ttm_device.c:110: warning: Function parameter or member 'gfp_flags' not described in 'ttm_global_swapout'
>> drivers/gpu/drm/ttm/ttm_device.c:110: warning: expecting prototype for A buffer object shrink method that tries to swap out the first(). Prototype was for ttm_global_swapout() instead
vim +110 drivers/gpu/drm/ttm/ttm_device.c
104
105 /**
106 * A buffer object shrink method that tries to swap out the first
107 * buffer object on the global::swap_lru list.
108 */
109 long ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags)
> 110 {
111 struct ttm_global *glob = &ttm_glob;
112 struct ttm_buffer_object *bo;
113 unsigned i;
114 int ret;
115
116 spin_lock(&glob->lru_lock);
117 for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
118 list_for_each_entry(bo, &glob->swap_lru[i], swap) {
119 uint32_t num_pages = bo->ttm->num_pages;
120
121 ret = ttm_bo_swapout(bo, ctx, gfp_flags);
122 /* ttm_bo_swapout has dropped the lru_lock */
123 if (!ret)
124 return num_pages;
125 if (ret != -EBUSY)
126 return ret;
127 }
128 }
129 spin_unlock(&glob->lru_lock);
130 return 0;
131 }
132 EXPORT_SYMBOL(ttm_global_swapout);
133
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months