From: kernel test robot <lkp@intel.com>
To: Chen Ridong <chenridong@huaweicloud.com>,
hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev,
shakeel.butt@linux.dev, muchun.song@linux.dev,
akpm@linux-foundation.org, axelrasmussen@google.com,
yuanchu@google.com, weixugc@google.com, david@kernel.org,
zhengqi.arch@bytedance.com, lorenzo.stoakes@oracle.com
Cc: oe-kbuild-all@lists.linux.dev, cgroups@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
lujialin4@huawei.com, chenridong@huaweicloud.com
Subject: Re: [PATCH -next 2/2] memcg: remove mem_cgroup_size()
Date: Wed, 10 Dec 2025 09:35:54 +0800 [thread overview]
Message-ID: <202512100924.LqJqXM7P-lkp@intel.com> (raw)
In-Reply-To: <20251209130251.1988615-3-chenridong@huaweicloud.com>
Hi Chen,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20251209]
url: https://github.com/intel-lab-lkp/linux/commits/Chen-Ridong/memcg-move-mem_cgroup_usage-memcontrol-v1-c/20251209-211854
base: next-20251209
patch link: https://lore.kernel.org/r/20251209130251.1988615-3-chenridong%40huaweicloud.com
patch subject: [PATCH -next 2/2] memcg: remove mem_cgroup_size()
config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20251210/202512100924.LqJqXM7P-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251210/202512100924.LqJqXM7P-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/202512100924.LqJqXM7P-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/vmscan.c: In function 'apply_proportional_protection':
>> mm/vmscan.c:2488:63: error: invalid use of undefined type 'struct mem_cgroup'
2488 | unsigned long usage = page_counter_read(&memcg->memory);
| ^~
vim +2488 mm/vmscan.c
2450
2451 static unsigned long apply_proportional_protection(struct mem_cgroup *memcg,
2452 struct scan_control *sc, unsigned long scan)
2453 {
2454 unsigned long min, low;
2455
2456 mem_cgroup_protection(sc->target_mem_cgroup, memcg, &min, &low);
2457
2458 if (min || low) {
2459 /*
2460 * Scale a cgroup's reclaim pressure by proportioning
2461 * its current usage to its memory.low or memory.min
2462 * setting.
2463 *
2464 * This is important, as otherwise scanning aggression
2465 * becomes extremely binary -- from nothing as we
2466 * approach the memory protection threshold, to totally
2467 * nominal as we exceed it. This results in requiring
2468 * setting extremely liberal protection thresholds. It
2469 * also means we simply get no protection at all if we
2470 * set it too low, which is not ideal.
2471 *
2472 * If there is any protection in place, we reduce scan
2473 * pressure by how much of the total memory used is
2474 * within protection thresholds.
2475 *
2476 * There is one special case: in the first reclaim pass,
2477 * we skip over all groups that are within their low
2478 * protection. If that fails to reclaim enough pages to
2479 * satisfy the reclaim goal, we come back and override
2480 * the best-effort low protection. However, we still
2481 * ideally want to honor how well-behaved groups are in
2482 * that case instead of simply punishing them all
2483 * equally. As such, we reclaim them based on how much
2484 * memory they are using, reducing the scan pressure
2485 * again by how much of the total memory used is under
2486 * hard protection.
2487 */
> 2488 unsigned long usage = page_counter_read(&memcg->memory);
2489 unsigned long protection;
2490
2491 /* memory.low scaling, make sure we retry before OOM */
2492 if (!sc->memcg_low_reclaim && low > min) {
2493 protection = low;
2494 sc->memcg_low_skipped = 1;
2495 } else {
2496 protection = min;
2497 }
2498
2499 /* Avoid TOCTOU with earlier protection check */
2500 usage = max(usage, protection);
2501
2502 scan -= scan * protection / (usage + 1);
2503
2504 /*
2505 * Minimally target SWAP_CLUSTER_MAX pages to keep
2506 * reclaim moving forwards, avoiding decrementing
2507 * sc->priority further than desirable.
2508 */
2509 scan = max(scan, SWAP_CLUSTER_MAX);
2510 }
2511 return scan;
2512 }
2513
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-12-10 1:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 13:02 [PATCH -next 0/2] memcg cleanups Chen Ridong
2025-12-09 13:02 ` [PATCH -next 1/2] memcg: move mem_cgroup_usage memcontrol-v1.c Chen Ridong
2025-12-09 13:02 ` [PATCH -next 2/2] memcg: remove mem_cgroup_size() Chen Ridong
2025-12-10 1:35 ` kernel test robot
2025-12-10 1:35 ` kernel test robot [this message]
2025-12-10 3:06 ` Chen Ridong
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=202512100924.LqJqXM7P-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huaweicloud.com \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=lujialin4@huawei.com \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=weixugc@google.com \
--cc=yuanchu@google.com \
--cc=zhengqi.arch@bytedance.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;
as well as URLs for NNTP newsgroup(s).