All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 3196/3635] mm/memcontrol.c:2859:41: error: implicit declaration of function 'irq_work_queue'; did you mean 'drain_workqueue'?
@ 2026-09-04 13:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-04 13:36 UTC (permalink / raw)
  To: David Stevens; +Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9d80aa4617b32f5054c5aa471d06b66704854935
commit: f4bb278a0bb905c7703993060e0d9271820f7532 [3196/3635] memcg: don't call schedule_work when no spinning is allowed
config: sparc-randconfig-r061-20260904 (https://download.01.org/0day-ci/archive/20260904/202609042120.6bgj0pUa-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260904/202609042120.6bgj0pUa-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/202609042120.6bgj0pUa-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/memcontrol.c: In function 'try_charge_memcg':
>> mm/memcontrol.c:2859:41: error: implicit declaration of function 'irq_work_queue'; did you mean 'drain_workqueue'? [-Werror=implicit-function-declaration]
    2859 |                                         irq_work_queue(&memcg->high_irq_work);
         |                                         ^~~~~~~~~~~~~~
         |                                         drain_workqueue
   mm/memcontrol.c: In function 'mem_cgroup_alloc':
>> mm/memcontrol.c:4234:9: error: implicit declaration of function 'init_irq_work'; did you mean 'init_irq_proc'? [-Werror=implicit-function-declaration]
    4234 |         init_irq_work(&memcg->high_irq_work, high_irq_work_func);
         |         ^~~~~~~~~~~~~
         |         init_irq_proc
   mm/memcontrol.c: In function 'mem_cgroup_css_free':
>> mm/memcontrol.c:4443:9: error: implicit declaration of function 'irq_work_sync' [-Werror=implicit-function-declaration]
    4443 |         irq_work_sync(&memcg->high_irq_work);
         |         ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +2859 mm/memcontrol.c

  2678	
  2679	static int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask,
  2680				    unsigned int nr_pages)
  2681	{
  2682		unsigned int batch = max(MEMCG_CHARGE_BATCH, nr_pages);
  2683		int nr_retries = MAX_RECLAIM_RETRIES;
  2684		struct mem_cgroup *mem_over_limit;
  2685		struct page_counter *counter;
  2686		unsigned long nr_reclaimed;
  2687		bool passed_oom = false;
  2688		unsigned int reclaim_options;
  2689		bool drained = false;
  2690		bool raised_max_event = false;
  2691		unsigned long pflags;
  2692		bool allow_spinning = gfpflags_allow_spinning(gfp_mask);
  2693		int ret = 0;
  2694	
  2695	retry:
  2696		if (consume_stock(memcg, nr_pages))
  2697			return ret;
  2698	
  2699		if (!allow_spinning)
  2700			/* Avoid the refill and flush of the older stock */
  2701			batch = nr_pages;
  2702	
  2703		reclaim_options = MEMCG_RECLAIM_MAY_SWAP;
  2704		if (!do_memsw_account() ||
  2705		    page_counter_try_charge(&memcg->memsw, batch, &counter)) {
  2706			if (page_counter_try_charge(&memcg->memory, batch, &counter))
  2707				goto done_restock;
  2708			if (do_memsw_account())
  2709				page_counter_uncharge(&memcg->memsw, batch);
  2710			mem_over_limit = mem_cgroup_from_counter(counter, memory);
  2711		} else {
  2712			mem_over_limit = mem_cgroup_from_counter(counter, memsw);
  2713			reclaim_options &= ~MEMCG_RECLAIM_MAY_SWAP;
  2714		}
  2715	
  2716		if (batch > nr_pages) {
  2717			batch = nr_pages;
  2718			goto retry;
  2719		}
  2720	
  2721		/*
  2722		 * Prevent unbounded recursion when reclaim operations need to
  2723		 * allocate memory. This might exceed the limits temporarily,
  2724		 * but we prefer facilitating memory reclaim and getting back
  2725		 * under the limit over triggering OOM kills in these cases.
  2726		 */
  2727		if (unlikely(current->flags & PF_MEMALLOC))
  2728			goto force;
  2729	
  2730		if (unlikely(task_in_memcg_oom(current)))
  2731			goto nomem;
  2732	
  2733		if (!gfpflags_allow_blocking(gfp_mask))
  2734			goto nomem;
  2735	
  2736		/*
  2737		 * OOM victim still needs to charge memory to exit. OOM reaper should
  2738		 * help but it might fail on mmap_lock contention. If the victim is a
  2739		 * large thread group then all exiting threads might compete on oom_lock
  2740		 * just to learn that there is nothing really killable anymore. Bail
  2741		 * out early and fail the charge to expedite their exit. They are
  2742		 * considered fully reclaimed by the oom reaper and they shouldn't
  2743		 * contribute further charges.
  2744		 */
  2745		if (tsk_is_oom_victim(current) &&
  2746		    mm_flags_test(MMF_OOM_SKIP, current->signal->oom_mm))
  2747			goto nomem;
  2748	
  2749		__memcg_memory_event(mem_over_limit, MEMCG_MAX, allow_spinning);
  2750		raised_max_event = true;
  2751	
  2752		psi_memstall_enter(&pflags);
  2753		nr_reclaimed = try_to_free_mem_cgroup_pages(mem_over_limit, nr_pages,
  2754							    gfp_mask, reclaim_options, NULL);
  2755		psi_memstall_leave(&pflags);
  2756	
  2757		if (mem_cgroup_margin(mem_over_limit) >= nr_pages)
  2758			goto retry;
  2759	
  2760		if (!drained) {
  2761			drain_all_stock(mem_over_limit);
  2762			drained = true;
  2763			goto retry;
  2764		}
  2765	
  2766		if (gfp_mask & __GFP_NORETRY)
  2767			goto nomem;
  2768		/*
  2769		 * Even though the limit is exceeded at this point, reclaim
  2770		 * may have been able to free some pages.  Retry the charge
  2771		 * before killing the task.
  2772		 *
  2773		 * Only for regular pages, though: huge pages are rather
  2774		 * unlikely to succeed so close to the limit, and we fall back
  2775		 * to regular pages anyway in case of failure.
  2776		 */
  2777		if (nr_reclaimed && nr_pages <= (1 << PAGE_ALLOC_COSTLY_ORDER))
  2778			goto retry;
  2779	
  2780		if (nr_retries--)
  2781			goto retry;
  2782	
  2783		if (gfp_mask & __GFP_RETRY_MAYFAIL)
  2784			goto nomem;
  2785	
  2786		/* Avoid endless loop for tasks bypassed by the oom killer */
  2787		if (passed_oom && task_is_dying())
  2788			goto nomem;
  2789	
  2790		/*
  2791		 * keep retrying as long as the memcg oom killer is able to make
  2792		 * a forward progress or bypass the charge if the oom killer
  2793		 * couldn't make any progress.
  2794		 */
  2795		if (mem_cgroup_oom(mem_over_limit, gfp_mask,
  2796				   get_order(nr_pages * PAGE_SIZE))) {
  2797			passed_oom = true;
  2798			nr_retries = MAX_RECLAIM_RETRIES;
  2799			goto retry;
  2800		}
  2801	nomem:
  2802		/*
  2803		 * Memcg doesn't have a dedicated reserve for atomic
  2804		 * allocations. But like the global atomic pool, we need to
  2805		 * put the burden of reclaim on regular allocation requests
  2806		 * and let these go through as privileged allocations.
  2807		 */
  2808		if (!(gfp_mask & (__GFP_NOFAIL | __GFP_HIGH))) {
  2809			ret = -ENOMEM;
  2810			goto out;
  2811		}
  2812	force:
  2813		/*
  2814		 * The allocation either can't fail or will lead to more memory
  2815		 * being freed very soon.  Allow memory usage go over the limit
  2816		 * temporarily by force charging it.
  2817		 */
  2818		page_counter_charge(&memcg->memory, nr_pages);
  2819		if (do_memsw_account())
  2820			page_counter_charge(&memcg->memsw, nr_pages);
  2821	
  2822	out:
  2823		/*
  2824		 * Don't forget to raise a MEMCG_MAX event for forced or rejected
  2825		 * requests.
  2826		 */
  2827		if (!raised_max_event)
  2828			__memcg_memory_event(mem_over_limit, MEMCG_MAX, allow_spinning);
  2829	
  2830		return ret;
  2831	
  2832	done_restock:
  2833		if (batch > nr_pages)
  2834			refill_stock(memcg, batch - nr_pages);
  2835	
  2836		/*
  2837		 * If the hierarchy is above the normal consumption range, schedule
  2838		 * reclaim on returning to userland.  We can perform reclaim here
  2839		 * if __GFP_RECLAIM but let's always punt for simplicity and so that
  2840		 * GFP_KERNEL can consistently be used during reclaim.  @memcg is
  2841		 * not recorded as it most likely matches current's and won't
  2842		 * change in the meantime.  As high limit is checked again before
  2843		 * reclaim, the cost of mismatch is negligible.
  2844		 */
  2845		do {
  2846			bool mem_high, swap_high;
  2847	
  2848			mem_high = page_counter_read(&memcg->memory) >
  2849				READ_ONCE(memcg->memory.high);
  2850			swap_high = page_counter_read(&memcg->swap) >
  2851				READ_ONCE(memcg->swap.high);
  2852	
  2853			/* Don't bother a random interrupted task */
  2854			if (!in_task()) {
  2855				if (mem_high) {
  2856					if (allow_spinning)
  2857						schedule_work(&memcg->high_work);
  2858					else
> 2859						irq_work_queue(&memcg->high_irq_work);
  2860					break;
  2861				}
  2862				continue;
  2863			}
  2864	
  2865			if (mem_high || swap_high) {
  2866				/*
  2867				 * The allocating tasks in this cgroup will need to do
  2868				 * reclaim or be throttled to prevent further growth
  2869				 * of the memory or swap footprints.
  2870				 *
  2871				 * Target some best-effort fairness between the tasks,
  2872				 * and distribute reclaim work and delay penalties
  2873				 * based on how much each task is actually allocating.
  2874				 */
  2875				current->memcg_nr_pages_over_high += batch;
  2876				set_notify_resume(current);
  2877				break;
  2878			}
  2879		} while ((memcg = parent_mem_cgroup(memcg)));
  2880	
  2881		/*
  2882		 * Reclaim is set up above to be called from the userland
  2883		 * return path. But also attempt synchronous reclaim to avoid
  2884		 * excessive overrun while the task is still inside the
  2885		 * kernel. If this is successful, the return path will see it
  2886		 * when it rechecks the overage and simply bail out.
  2887		 */
  2888		if (current->memcg_nr_pages_over_high > MEMCG_CHARGE_BATCH &&
  2889		    !(current->flags & PF_MEMALLOC) &&
  2890		    gfpflags_allow_blocking(gfp_mask))
  2891			__mem_cgroup_handle_over_high(gfp_mask);
  2892		return ret;
  2893	}
  2894	

--
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:[~2026-09-04 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 13:36 [linux-next:master 3196/3635] mm/memcontrol.c:2859:41: error: implicit declaration of function 'irq_work_queue'; did you mean 'drain_workqueue'? 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.