All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android15-6.6 3/3] mm/vmscan.c:3178:26: error: implicit declaration of function 'sc_swappiness'; did you mean 'si_swapinfo'?
@ 2025-08-13  0:12 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-13  0:12 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android15-6.6
head:   ea3d9795af950549909e57bfd2efc6250bb69503
commit: ea3d9795af950549909e57bfd2efc6250bb69503 [3/3] BACKPORT: mm: add swappiness= arg to memory.reclaim
config: i386-buildonly-randconfig-003-20250813 (https://download.01.org/0day-ci/archive/20250813/202508130846.FHB2EKAL-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250813/202508130846.FHB2EKAL-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/202508130846.FHB2EKAL-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/vmscan.c:1066:15: warning: no previous prototype for 'shrink_slab' [-Wmissing-prototypes]
    1066 | unsigned long shrink_slab(gfp_t gfp_mask, int nid,
         |               ^~~~~~~~~~~
   mm/vmscan.c:2663:15: warning: no previous prototype for 'shrink_inactive_list' [-Wmissing-prototypes]
    2663 | unsigned long shrink_inactive_list(unsigned long nr_to_scan,
         |               ^~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c: In function 'get_scan_count':
>> mm/vmscan.c:3178:26: error: implicit declaration of function 'sc_swappiness'; did you mean 'si_swapinfo'? [-Werror=implicit-function-declaration]
    3178 |         int swappiness = sc_swappiness(sc, memcg);
         |                          ^~~~~~~~~~~~~
         |                          si_swapinfo
   cc1: some warnings being treated as errors


vim +3178 mm/vmscan.c

  3164	
  3165	/*
  3166	 * Determine how aggressively the anon and file LRU lists should be
  3167	 * scanned.
  3168	 *
  3169	 * nr[0] = anon inactive folios to scan; nr[1] = anon active folios to scan
  3170	 * nr[2] = file inactive folios to scan; nr[3] = file active folios to scan
  3171	 */
  3172	static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
  3173				   unsigned long *nr)
  3174	{
  3175		struct pglist_data *pgdat = lruvec_pgdat(lruvec);
  3176		struct mem_cgroup *memcg = lruvec_memcg(lruvec);
  3177		unsigned long anon_cost, file_cost, total_cost;
> 3178		int swappiness = sc_swappiness(sc, memcg);
  3179		u64 fraction[ANON_AND_FILE];
  3180		u64 denominator = 0;	/* gcc */
  3181		enum scan_balance scan_balance;
  3182		unsigned long ap, fp;
  3183		enum lru_list lru;
  3184		bool balance_anon_file_reclaim = false;
  3185	
  3186		/* If we have no swap space, do not bother scanning anon folios. */
  3187		if (!sc->may_swap || !can_reclaim_anon_pages(memcg, pgdat->node_id, sc)) {
  3188			scan_balance = SCAN_FILE;
  3189			goto out;
  3190		}
  3191	
  3192	
  3193		trace_android_vh_tune_swappiness(&swappiness);
  3194		/*
  3195		 * Global reclaim will swap to prevent OOM even with no
  3196		 * swappiness, but memcg users want to use this knob to
  3197		 * disable swapping for individual groups completely when
  3198		 * using the memory controller's swap limit feature would be
  3199		 * too expensive.
  3200		 */
  3201		if (cgroup_reclaim(sc) && !swappiness) {
  3202			scan_balance = SCAN_FILE;
  3203			goto out;
  3204		}
  3205	
  3206		/*
  3207		 * Do not apply any pressure balancing cleverness when the
  3208		 * system is close to OOM, scan both anon and file equally
  3209		 * (unless the swappiness setting disagrees with swapping).
  3210		 */
  3211		if (!sc->priority && swappiness) {
  3212			scan_balance = SCAN_EQUAL;
  3213			goto out;
  3214		}
  3215	
  3216		/*
  3217		 * If the system is almost out of file pages, force-scan anon.
  3218		 */
  3219		if (sc->file_is_tiny) {
  3220			scan_balance = SCAN_ANON;
  3221			goto out;
  3222		}
  3223	
  3224		trace_android_rvh_set_balance_anon_file_reclaim(&balance_anon_file_reclaim);
  3225	
  3226		/*
  3227		 * If there is enough inactive page cache, we do not reclaim
  3228		 * anything from the anonymous working right now. But when balancing
  3229		 * anon and page cache files for reclaim, allow swapping of anon pages
  3230		 * even if there are a number of inactive file cache pages.
  3231		 */
  3232		if (!balance_anon_file_reclaim && sc->cache_trim_mode) {
  3233			scan_balance = SCAN_FILE;
  3234			goto out;
  3235		}
  3236	
  3237		scan_balance = SCAN_FRACT;
  3238		/*
  3239		 * Calculate the pressure balance between anon and file pages.
  3240		 *
  3241		 * The amount of pressure we put on each LRU is inversely
  3242		 * proportional to the cost of reclaiming each list, as
  3243		 * determined by the share of pages that are refaulting, times
  3244		 * the relative IO cost of bringing back a swapped out
  3245		 * anonymous page vs reloading a filesystem page (swappiness).
  3246		 *
  3247		 * Although we limit that influence to ensure no list gets
  3248		 * left behind completely: at least a third of the pressure is
  3249		 * applied, before swappiness.
  3250		 *
  3251		 * With swappiness at 100, anon and file have equal IO cost.
  3252		 */
  3253		total_cost = sc->anon_cost + sc->file_cost;
  3254		anon_cost = total_cost + sc->anon_cost;
  3255		file_cost = total_cost + sc->file_cost;
  3256		total_cost = anon_cost + file_cost;
  3257	
  3258		ap = swappiness * (total_cost + 1);
  3259		ap /= anon_cost + 1;
  3260	
  3261		fp = (MAX_SWAPPINESS - swappiness) * (total_cost + 1);
  3262		fp /= file_cost + 1;
  3263	
  3264		fraction[0] = ap;
  3265		fraction[1] = fp;
  3266		denominator = ap + fp;
  3267	out:
  3268		trace_android_vh_tune_scan_type(&scan_balance);
  3269		for_each_evictable_lru(lru) {
  3270			int file = is_file_lru(lru);
  3271			unsigned long lruvec_size;
  3272			unsigned long low, min;
  3273			unsigned long scan;
  3274	
  3275			lruvec_size = lruvec_lru_size(lruvec, lru, sc->reclaim_idx);
  3276			mem_cgroup_protection(sc->target_mem_cgroup, memcg,
  3277					      &min, &low);
  3278	
  3279			if (min || low) {
  3280				/*
  3281				 * Scale a cgroup's reclaim pressure by proportioning
  3282				 * its current usage to its memory.low or memory.min
  3283				 * setting.
  3284				 *
  3285				 * This is important, as otherwise scanning aggression
  3286				 * becomes extremely binary -- from nothing as we
  3287				 * approach the memory protection threshold, to totally
  3288				 * nominal as we exceed it.  This results in requiring
  3289				 * setting extremely liberal protection thresholds. It
  3290				 * also means we simply get no protection at all if we
  3291				 * set it too low, which is not ideal.
  3292				 *
  3293				 * If there is any protection in place, we reduce scan
  3294				 * pressure by how much of the total memory used is
  3295				 * within protection thresholds.
  3296				 *
  3297				 * There is one special case: in the first reclaim pass,
  3298				 * we skip over all groups that are within their low
  3299				 * protection. If that fails to reclaim enough pages to
  3300				 * satisfy the reclaim goal, we come back and override
  3301				 * the best-effort low protection. However, we still
  3302				 * ideally want to honor how well-behaved groups are in
  3303				 * that case instead of simply punishing them all
  3304				 * equally. As such, we reclaim them based on how much
  3305				 * memory they are using, reducing the scan pressure
  3306				 * again by how much of the total memory used is under
  3307				 * hard protection.
  3308				 */
  3309				unsigned long cgroup_size = mem_cgroup_size(memcg);
  3310				unsigned long protection;
  3311	
  3312				/* memory.low scaling, make sure we retry before OOM */
  3313				if (!sc->memcg_low_reclaim && low > min) {
  3314					protection = low;
  3315					sc->memcg_low_skipped = 1;
  3316				} else {
  3317					protection = min;
  3318				}
  3319	
  3320				/* Avoid TOCTOU with earlier protection check */
  3321				cgroup_size = max(cgroup_size, protection);
  3322	
  3323				scan = lruvec_size - lruvec_size * protection /
  3324					(cgroup_size + 1);
  3325	
  3326				/*
  3327				 * Minimally target SWAP_CLUSTER_MAX pages to keep
  3328				 * reclaim moving forwards, avoiding decrementing
  3329				 * sc->priority further than desirable.
  3330				 */
  3331				scan = max(scan, SWAP_CLUSTER_MAX);
  3332			} else {
  3333				scan = lruvec_size;
  3334			}
  3335	
  3336			scan >>= sc->priority;
  3337	
  3338			/*
  3339			 * If the cgroup's already been deleted, make sure to
  3340			 * scrape out the remaining cache.
  3341			 */
  3342			if (!scan && !mem_cgroup_online(memcg))
  3343				scan = min(lruvec_size, SWAP_CLUSTER_MAX);
  3344	
  3345			switch (scan_balance) {
  3346			case SCAN_EQUAL:
  3347				/* Scan lists relative to size */
  3348				break;
  3349			case SCAN_FRACT:
  3350				/*
  3351				 * Scan types proportional to swappiness and
  3352				 * their relative recent reclaim efficiency.
  3353				 * Make sure we don't miss the last page on
  3354				 * the offlined memory cgroups because of a
  3355				 * round-off error.
  3356				 */
  3357				scan = mem_cgroup_online(memcg) ?
  3358				       div64_u64(scan * fraction[file], denominator) :
  3359				       DIV64_U64_ROUND_UP(scan * fraction[file],
  3360							  denominator);
  3361				break;
  3362			case SCAN_FILE:
  3363			case SCAN_ANON:
  3364				/* Scan one type exclusively */
  3365				if ((scan_balance == SCAN_FILE) != file)
  3366					scan = 0;
  3367				break;
  3368			default:
  3369				/* Look ma, no brain */
  3370				BUG();
  3371			}
  3372	
  3373			nr[lru] = scan;
  3374		}
  3375	}
  3376	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-13  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  0:12 [android-common:android15-6.6 3/3] mm/vmscan.c:3178:26: error: implicit declaration of function 'sc_swappiness'; did you mean 'si_swapinfo'? 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.