linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: yangge1116@126.com, akpm@linux-foundation.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	21cnbao@gmail.com, david@redhat.com,
	baolin.wang@linux.alibaba.com, hannes@cmpxchg.org,
	liuzixing@hygon.cn, yangge <yangge1116@126.com>
Subject: Re: [PATCH] mm: compaction: skip memory compaction when there are not enough migratable pages
Date: Sat, 4 Jan 2025 19:28:46 +0800	[thread overview]
Message-ID: <202501041908.jDpLhAgL-lkp@intel.com> (raw)
In-Reply-To: <1735981122-2085-1-git-send-email-yangge1116@126.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/yangge1116-126-com/mm-compaction-skip-memory-compaction-when-there-are-not-enough-migratable-pages/20250104-170112
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/1735981122-2085-1-git-send-email-yangge1116%40126.com
patch subject: [PATCH] mm: compaction: skip memory compaction when there are not enough migratable pages
config: i386-buildonly-randconfig-001-20250104 (https://download.01.org/0day-ci/archive/20250104/202501041908.jDpLhAgL-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250104/202501041908.jDpLhAgL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501041908.jDpLhAgL-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from mm/compaction.c:15:
   include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      47 |         __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
         |                                    ~~~~~~~~~~~ ^ ~~~
   include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      49 |                                 NR_ZONE_LRU_BASE + lru, nr_pages);
         |                                 ~~~~~~~~~~~~~~~~ ^ ~~~
>> mm/compaction.c:2386:13: warning: unused variable 'pgdat' [-Wunused-variable]
    2386 |         pg_data_t *pgdat = zone->zone_pgdat;
         |                    ^~~~~
   3 warnings generated.


vim +/pgdat +2386 mm/compaction.c

  2381	
  2382	static bool __compaction_suitable(struct zone *zone, int order,
  2383					  int highest_zoneidx,
  2384					  unsigned long wmark_target)
  2385	{
> 2386		pg_data_t *pgdat = zone->zone_pgdat;
  2387		unsigned long sum, nr_pinned;
  2388		unsigned long watermark;
  2389	
  2390		sum = node_page_state(pgdat, NR_INACTIVE_FILE) +
  2391			node_page_state(pgdat, NR_INACTIVE_ANON) +
  2392			node_page_state(pgdat, NR_ACTIVE_FILE) +
  2393			node_page_state(pgdat, NR_ACTIVE_ANON);
  2394	
  2395		nr_pinned = node_page_state(pgdat, NR_FOLL_PIN_ACQUIRED) -
  2396			node_page_state(pgdat, NR_FOLL_PIN_RELEASED);
  2397	
  2398		/*
  2399		 * Gup-pinned pages are non-migratable. After subtracting these pages,
  2400		 * we need to check if the remaining pages are sufficient for memory
  2401		 * compaction.
  2402		 */
  2403		if ((sum - nr_pinned) < (1 << order))
  2404			return false;
  2405	
  2406		/*
  2407		 * Watermarks for order-0 must be met for compaction to be able to
  2408		 * isolate free pages for migration targets. This means that the
  2409		 * watermark and alloc_flags have to match, or be more pessimistic than
  2410		 * the check in __isolate_free_page(). We don't use the direct
  2411		 * compactor's alloc_flags, as they are not relevant for freepage
  2412		 * isolation. We however do use the direct compactor's highest_zoneidx
  2413		 * to skip over zones where lowmem reserves would prevent allocation
  2414		 * even if compaction succeeds.
  2415		 * For costly orders, we require low watermark instead of min for
  2416		 * compaction to proceed to increase its chances.
  2417		 * ALLOC_CMA is used, as pages in CMA pageblocks are considered
  2418		 * suitable migration targets
  2419		 */
  2420		watermark = (order > PAGE_ALLOC_COSTLY_ORDER) ?
  2421					low_wmark_pages(zone) : min_wmark_pages(zone);
  2422		watermark += compact_gap(order);
  2423		return __zone_watermark_ok(zone, 0, watermark, highest_zoneidx,
  2424					   ALLOC_CMA, wmark_target);
  2425	}
  2426	

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


  reply	other threads:[~2025-01-04 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-04  8:58 yangge1116
2025-01-04 11:28 ` kernel test robot [this message]
2025-01-06  8:12 ` Baolin Wang
2025-01-06  8:49   ` Ge Yang
2025-01-08  2:50     ` Baolin Wang
2025-01-08  8:35       ` Ge Yang

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=202501041908.jDpLhAgL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuzixing@hygon.cn \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yangge1116@126.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox