All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ackerley Tng <ackerleytng@google.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH 05/39] mm: hugetlb: Refactor alloc_buddy_hugetlb_folio_with_mpol() to interpret mempolicy instead of vma
Date: Sat, 14 Sep 2024 05:32:50 +0800	[thread overview]
Message-ID: <202409140553.G2RGVWNA-lkp@intel.com> (raw)
In-Reply-To: <1778a7324a1242fa907981576ebd69716a94d778.1726009989.git.ackerleytng@google.com>

Hi Ackerley,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on kvm/queue]
[also build test ERROR on akpm-mm/mm-everything linus/master v6.11-rc7 next-20240913]
[cannot apply to kvm/linux-next]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ackerley-Tng/mm-hugetlb-Simplify-logic-in-dequeue_hugetlb_folio_vma/20240911-074716
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/1778a7324a1242fa907981576ebd69716a94d778.1726009989.git.ackerleytng%40google.com
patch subject: [RFC PATCH 05/39] mm: hugetlb: Refactor alloc_buddy_hugetlb_folio_with_mpol() to interpret mempolicy instead of vma
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20240914/202409140553.G2RGVWNA-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240914/202409140553.G2RGVWNA-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/202409140553.G2RGVWNA-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/hugetlb.c: In function 'alloc_hugetlb_folio':
>> mm/hugetlb.c:3197:23: error: implicit declaration of function 'policy_node_nodemask'; did you mean 'policy_mbind_nodemask'? [-Werror=implicit-function-declaration]
    3197 |                 nid = policy_node_nodemask(mpol, htlb_alloc_mask(h), ilx, &nodemask);
         |                       ^~~~~~~~~~~~~~~~~~~~
         |                       policy_mbind_nodemask
   cc1: some warnings being treated as errors


vim +3197 mm/hugetlb.c

  3119	
  3120	struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma,
  3121					    unsigned long addr, int avoid_reserve)
  3122	{
  3123		struct hugepage_subpool *spool = subpool_vma(vma);
  3124		struct hstate *h = hstate_vma(vma);
  3125		struct folio *folio;
  3126		long map_chg, map_commit, nr_pages = pages_per_huge_page(h);
  3127		long gbl_chg;
  3128		int memcg_charge_ret, ret, idx;
  3129		struct hugetlb_cgroup *h_cg = NULL;
  3130		struct mem_cgroup *memcg;
  3131		bool deferred_reserve;
  3132		gfp_t gfp = htlb_alloc_mask(h) | __GFP_RETRY_MAYFAIL;
  3133		bool use_hstate_resv;
  3134	
  3135		memcg = get_mem_cgroup_from_current();
  3136		memcg_charge_ret = mem_cgroup_hugetlb_try_charge(memcg, gfp, nr_pages);
  3137		if (memcg_charge_ret == -ENOMEM) {
  3138			mem_cgroup_put(memcg);
  3139			return ERR_PTR(-ENOMEM);
  3140		}
  3141	
  3142		idx = hstate_index(h);
  3143		/*
  3144		 * Examine the region/reserve map to determine if the process
  3145		 * has a reservation for the page to be allocated.  A return
  3146		 * code of zero indicates a reservation exists (no change).
  3147		 */
  3148		map_chg = gbl_chg = vma_needs_reservation(h, vma, addr);
  3149		if (map_chg < 0) {
  3150			if (!memcg_charge_ret)
  3151				mem_cgroup_cancel_charge(memcg, nr_pages);
  3152			mem_cgroup_put(memcg);
  3153			return ERR_PTR(-ENOMEM);
  3154		}
  3155	
  3156		/*
  3157		 * Processes that did not create the mapping will have no
  3158		 * reserves as indicated by the region/reserve map. Check
  3159		 * that the allocation will not exceed the subpool limit.
  3160		 * Allocations for MAP_NORESERVE mappings also need to be
  3161		 * checked against any subpool limit.
  3162		 */
  3163		if (map_chg || avoid_reserve) {
  3164			gbl_chg = hugepage_subpool_get_pages(spool, 1);
  3165			if (gbl_chg < 0)
  3166				goto out_end_reservation;
  3167	
  3168		}
  3169	
  3170		/* If this allocation is not consuming a reservation, charge it now.
  3171		 */
  3172		deferred_reserve = map_chg || avoid_reserve;
  3173		if (deferred_reserve) {
  3174			ret = hugetlb_cgroup_charge_cgroup_rsvd(
  3175				idx, pages_per_huge_page(h), &h_cg);
  3176			if (ret)
  3177				goto out_subpool_put;
  3178		}
  3179	
  3180		ret = hugetlb_cgroup_charge_cgroup(idx, pages_per_huge_page(h), &h_cg);
  3181		if (ret)
  3182			goto out_uncharge_cgroup_reservation;
  3183	
  3184		use_hstate_resv = should_use_hstate_resv(vma, gbl_chg, avoid_reserve);
  3185	
  3186		spin_lock_irq(&hugetlb_lock);
  3187		folio = dequeue_hugetlb_folio_vma(h, vma, addr, use_hstate_resv);
  3188		if (!folio) {
  3189			struct mempolicy *mpol;
  3190			nodemask_t *nodemask;
  3191			pgoff_t ilx;
  3192			int nid;
  3193	
  3194			spin_unlock_irq(&hugetlb_lock);
  3195	
  3196			mpol = get_vma_policy(vma, addr, hstate_vma(vma)->order, &ilx);
> 3197			nid = policy_node_nodemask(mpol, htlb_alloc_mask(h), ilx, &nodemask);
  3198			folio = alloc_buddy_hugetlb_folio_from_node(h, mpol, nid, nodemask);
  3199			mpol_cond_put(mpol);
  3200	
  3201			if (!folio)
  3202				goto out_uncharge_cgroup;
  3203			spin_lock_irq(&hugetlb_lock);
  3204			if (use_hstate_resv) {
  3205				folio_set_hugetlb_restore_reserve(folio);
  3206				h->resv_huge_pages--;
  3207			}
  3208			list_add(&folio->lru, &h->hugepage_activelist);
  3209			folio_ref_unfreeze(folio, 1);
  3210			/* Fall through */
  3211		}
  3212	
  3213		hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, folio);
  3214		/* If allocation is not consuming a reservation, also store the
  3215		 * hugetlb_cgroup pointer on the page.
  3216		 */
  3217		if (deferred_reserve) {
  3218			hugetlb_cgroup_commit_charge_rsvd(idx, pages_per_huge_page(h),
  3219							  h_cg, folio);
  3220		}
  3221	
  3222		spin_unlock_irq(&hugetlb_lock);
  3223	
  3224		hugetlb_set_folio_subpool(folio, spool);
  3225	
  3226		map_commit = vma_commit_reservation(h, vma, addr);
  3227		if (unlikely(map_chg > map_commit)) {
  3228			/*
  3229			 * The page was added to the reservation map between
  3230			 * vma_needs_reservation and vma_commit_reservation.
  3231			 * This indicates a race with hugetlb_reserve_pages.
  3232			 * Adjust for the subpool count incremented above AND
  3233			 * in hugetlb_reserve_pages for the same page.  Also,
  3234			 * the reservation count added in hugetlb_reserve_pages
  3235			 * no longer applies.
  3236			 */
  3237			long rsv_adjust;
  3238	
  3239			rsv_adjust = hugepage_subpool_put_pages(spool, 1);
  3240			hugetlb_acct_memory(h, -rsv_adjust);
  3241			if (deferred_reserve) {
  3242				spin_lock_irq(&hugetlb_lock);
  3243				hugetlb_cgroup_uncharge_folio_rsvd(hstate_index(h),
  3244						pages_per_huge_page(h), folio);
  3245				spin_unlock_irq(&hugetlb_lock);
  3246			}
  3247		}
  3248	
  3249		if (!memcg_charge_ret)
  3250			mem_cgroup_commit_charge(folio, memcg);
  3251		mem_cgroup_put(memcg);
  3252	
  3253		return folio;
  3254	
  3255	out_uncharge_cgroup:
  3256		hugetlb_cgroup_uncharge_cgroup(idx, pages_per_huge_page(h), h_cg);
  3257	out_uncharge_cgroup_reservation:
  3258		if (deferred_reserve)
  3259			hugetlb_cgroup_uncharge_cgroup_rsvd(idx, pages_per_huge_page(h),
  3260							    h_cg);
  3261	out_subpool_put:
  3262		if (map_chg || avoid_reserve)
  3263			hugepage_subpool_put_pages(spool, 1);
  3264	out_end_reservation:
  3265		vma_end_reservation(h, vma, addr);
  3266		if (!memcg_charge_ret)
  3267			mem_cgroup_cancel_charge(memcg, nr_pages);
  3268		mem_cgroup_put(memcg);
  3269		return ERR_PTR(-ENOSPC);
  3270	}
  3271	

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

  parent reply	other threads:[~2024-09-13 21:33 UTC|newest]

Thread overview: 134+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 23:43 [RFC PATCH 00/39] 1G page support for guest_memfd Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 01/39] mm: hugetlb: Simplify logic in dequeue_hugetlb_folio_vma() Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 02/39] mm: hugetlb: Refactor vma_has_reserves() to should_use_hstate_resv() Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 03/39] mm: hugetlb: Remove unnecessary check for avoid_reserve Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 04/39] mm: mempolicy: Refactor out policy_node_nodemask() Ackerley Tng
2024-09-11 16:46   ` Gregory Price
2024-09-10 23:43 ` [RFC PATCH 05/39] mm: hugetlb: Refactor alloc_buddy_hugetlb_folio_with_mpol() to interpret mempolicy instead of vma Ackerley Tng
2024-09-13 21:22   ` kernel test robot
2024-09-13 21:32   ` kernel test robot [this message]
2024-09-10 23:43 ` [RFC PATCH 06/39] mm: hugetlb: Refactor dequeue_hugetlb_folio_vma() to use mpol Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 07/39] mm: hugetlb: Refactor out hugetlb_alloc_folio Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 08/39] mm: truncate: Expose preparation steps for truncate_inode_pages_final Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 09/39] mm: hugetlb: Expose hugetlb_subpool_{get,put}_pages() Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 10/39] mm: hugetlb: Add option to create new subpool without using surplus Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 11/39] mm: hugetlb: Expose hugetlb_acct_memory() Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 12/39] mm: hugetlb: Move and expose hugetlb_zero_partial_page() Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 13/39] KVM: guest_memfd: Make guest mem use guest mem inodes instead of anonymous inodes Ackerley Tng
2025-04-02  4:01   ` Yan Zhao
2025-04-23 20:22     ` Ackerley Tng
2025-04-24  3:53       ` Yan Zhao
2024-09-10 23:43 ` [RFC PATCH 14/39] KVM: guest_memfd: hugetlb: initialization and cleanup Ackerley Tng
2024-09-20  9:17   ` Vishal Annapurve
2024-10-01 23:00     ` Ackerley Tng
2024-12-01 17:59   ` Peter Xu
2025-02-13  9:47     ` Ackerley Tng
2025-02-26 18:55       ` Ackerley Tng
2025-03-06 17:33   ` Peter Xu
2024-09-10 23:43 ` [RFC PATCH 15/39] KVM: guest_memfd: hugetlb: allocate and truncate from hugetlb Ackerley Tng
2024-09-13 22:26   ` Elliot Berman
2024-10-03 20:23     ` Ackerley Tng
2024-10-30  9:01   ` Jun Miao
2025-02-11  1:21     ` Ackerley Tng
2024-12-01 17:55   ` Peter Xu
2025-02-13  7:52     ` Ackerley Tng
2025-02-13 16:48       ` Peter Xu
2024-09-10 23:43 ` [RFC PATCH 16/39] KVM: guest_memfd: Add page alignment check for hugetlb guest_memfd Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 17/39] KVM: selftests: Add basic selftests for hugetlb-backed guest_memfd Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 18/39] KVM: selftests: Support various types of backing sources for private memory Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 19/39] KVM: selftests: Update test for various private memory backing source types Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 20/39] KVM: selftests: Add private_mem_conversions_test.sh Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 21/39] KVM: selftests: Test that guest_memfd usage is reported via hugetlb Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 22/39] mm: hugetlb: Expose vmemmap optimization functions Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 23/39] mm: hugetlb: Expose HugeTLB functions for promoting/demoting pages Ackerley Tng
2024-09-13 22:35   ` kernel test robot
2024-09-10 23:43 ` [RFC PATCH 24/39] mm: hugetlb: Add functions to add/move/remove from hugetlb lists Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 25/39] KVM: guest_memfd: Split HugeTLB pages for guest_memfd use Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 26/39] KVM: guest_memfd: Track faultability within a struct kvm_gmem_private Ackerley Tng
2024-10-10 16:06   ` Peter Xu
2024-10-11 23:32     ` Ackerley Tng
2024-10-15 21:34       ` Peter Xu
2024-10-15 23:42         ` Ackerley Tng
2024-10-16  8:45           ` David Hildenbrand
2024-10-16 20:16             ` Peter Xu
2024-10-16 22:51               ` Jason Gunthorpe
2024-10-16 23:49                 ` Peter Xu
2024-10-16 23:54                   ` Jason Gunthorpe
2024-10-17 14:58                     ` Peter Xu
2024-10-17 16:47                       ` Jason Gunthorpe
2024-10-17 17:05                         ` Peter Xu
2024-10-17 17:10                           ` Jason Gunthorpe
2024-10-17 19:11                             ` Peter Xu
2024-10-17 19:18                               ` Jason Gunthorpe
2024-10-17 19:29                                 ` David Hildenbrand
2024-10-18  7:15                                 ` Patrick Roy
2024-10-18  7:50                                   ` David Hildenbrand
2024-10-18  9:34                                     ` Patrick Roy
2024-10-17 17:11                         ` David Hildenbrand
2024-10-17 17:16                           ` Jason Gunthorpe
2024-10-17 17:55                             ` David Hildenbrand
2024-10-17 18:26                             ` Vishal Annapurve
2024-10-17 14:56                   ` David Hildenbrand
2024-10-17 15:02               ` David Hildenbrand
2024-10-16  8:50           ` David Hildenbrand
2024-10-16 10:48             ` Vishal Annapurve
2024-10-16 11:54               ` David Hildenbrand
2024-10-16 11:57                 ` Jason Gunthorpe
2025-02-25 20:37   ` Peter Xu
2025-04-23 22:07     ` Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 27/39] KVM: guest_memfd: Allow mmapping guest_memfd files Ackerley Tng
2025-01-20 22:42   ` Peter Xu
2025-04-23 20:25     ` Ackerley Tng
2025-03-04 23:24   ` Peter Xu
2025-04-02  4:07   ` Yan Zhao
2025-04-23 20:28     ` Ackerley Tng
2024-09-10 23:43 ` [RFC PATCH 28/39] KVM: guest_memfd: Use vm_type to determine default faultability Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 29/39] KVM: Handle conversions in the SET_MEMORY_ATTRIBUTES ioctl Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 30/39] KVM: guest_memfd: Handle folio preparation for guest_memfd mmap Ackerley Tng
2024-09-16 20:00   ` Elliot Berman
2024-10-03 21:32     ` Ackerley Tng
2024-10-03 23:43       ` Ackerley Tng
2024-10-08 19:30         ` Sean Christopherson
2024-10-07 15:56       ` Patrick Roy
2024-10-08 18:07         ` Ackerley Tng
2024-10-08 19:56           ` Sean Christopherson
2024-10-09  3:51             ` Manwaring, Derek
2024-10-09 13:52               ` Andrew Cooper
2024-10-10 16:21             ` Patrick Roy
2024-10-10 19:27               ` Manwaring, Derek
2024-10-17 23:16               ` Ackerley Tng
2024-10-18  7:10                 ` Patrick Roy
2024-09-10 23:44 ` [RFC PATCH 31/39] KVM: selftests: Allow vm_set_memory_attributes to be used without asserting return value of 0 Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 32/39] KVM: selftests: Test using guest_memfd memory from userspace Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 33/39] KVM: selftests: Test guest_memfd memory sharing between guest and host Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 34/39] KVM: selftests: Add notes in private_mem_kvm_exits_test for mmap-able guest_memfd Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 35/39] KVM: selftests: Test that pinned pages block KVM from setting memory attributes to PRIVATE Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 36/39] KVM: selftests: Refactor vm_mem_add to be more flexible Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 37/39] KVM: selftests: Add helper to perform madvise by memslots Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 38/39] KVM: selftests: Update private_mem_conversions_test for mmap()able guest_memfd Ackerley Tng
2024-09-10 23:44 ` [RFC PATCH 39/39] KVM: guest_memfd: Dynamically split/reconstruct HugeTLB page Ackerley Tng
2024-09-14 10:07   ` kernel test robot
2025-04-03 12:33   ` Yan Zhao
2025-04-23 22:02     ` Ackerley Tng
2025-04-24  1:09       ` Yan Zhao
2025-04-24  4:25         ` Yan Zhao
2025-04-24  5:55           ` Chenyi Qiang
2025-04-24  8:13             ` Yan Zhao
2025-04-24 14:10               ` Vishal Annapurve
2025-04-24 18:15                 ` Ackerley Tng
2025-04-25  4:02                   ` Yan Zhao
2025-04-25 22:45                     ` Ackerley Tng
2025-04-28  1:05                       ` Yan Zhao
2025-04-28 19:02                         ` Vishal Annapurve
2025-04-30 20:09                         ` Ackerley Tng
2025-05-06  1:23                           ` Yan Zhao
2025-05-06 19:22                             ` Ackerley Tng
2025-05-07  3:15                               ` Yan Zhao
2025-05-13 17:33                                 ` Ackerley Tng
2024-09-11  6:56 ` [RFC PATCH 00/39] 1G page support for guest_memfd Michal Hocko
2024-09-14  1:08 ` Du, Fan
2024-09-14 13:34   ` Vishal Annapurve
2025-01-28  9:42 ` Amit Shah
2025-02-03  8:35   ` Ackerley Tng
2025-02-06 11:07     ` Amit Shah
2025-02-07  6:25       ` Ackerley Tng

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=202409140553.G2RGVWNA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ackerleytng@google.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 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.