VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Shakeel Butt <shakeelb@google.com> 2021-10-28 14:36:04 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-10-28 17:18:54 -0700 commit: 8dcb3060d81dbfa8d954a2ec64ef7ca330f5bb4d parent: 411a44c24a561e449b592ff631b7ae321f1eb559
Commit Summary:
memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT
Diffstat:
1 file changed, 4 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b37435c274cf..3ec39552d00f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5223,6 +5223,10 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
 	if (unlikely(page_array && nr_pages - nr_populated == 0))
 		goto out;
 
+	/* Bulk allocator does not support memcg accounting. */
+	if (memcg_kmem_enabled() && (gfp & __GFP_ACCOUNT))
+		goto failed;
+
 	/* Use the single page allocator for one page. */
 	if (nr_pages - nr_populated == 1)
 		goto failed;