Skip to contentSkip to conversation

ANDROID: mm: fix call_kern.cocci warnings (fwd)

PATCH New Julia Lawall 1 participant 1 message Oct 1, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ANDROID: mm: fix call_kern.cocci warnings (fwd)

Just passing this along. I don't know if it is a real problem. Check the call sites in the same file.

julia

---------- Forwarded message ----------
Date: Thu, 1 Oct 2020 16:14:17 +0800
From: kernel test robot <[email protected]>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <[email protected]>
Subject: [PATCH] ANDROID: mm: fix call_kern.cocci warnings

CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com

From: kernel test robot <[email protected]>

mm/page_alloc.c:5778:46-56: ERROR: function local_memory_node called on line 5883 inside lock on line 5854 but uses GFP_KERNEL mm/page_alloc.c:5779:16-26: ERROR: function local_memory_node called on line 5883 inside lock on line 5854 but uses GFP_KERNEL mm/page_alloc.c:5185:59-69: ERROR: function nr_free_zone_pages called on line 7792 inside lock on line 7788 but uses GFP_KERNEL

Find functions that refer to GFP_KERNEL but are called with locks held.

Semantic patch information:
The proposed change of converting the GFP_KERNEL is not necessarily the correct one. It may be desired to unlock the lock, or to not call the function under the lock in the first place.

Generated by: scripts/coccinelle/locks/call_kern.cocci

Fixes aa9752dec8d8 ("ANDROID: mm: fix up removal of vm_total_pages problem")

---

tree:   https://android.googlesource.com/kernel/common android-mainline
head:   c1e2c674005c758817710ba1714d35185f6fa8b6
commit: aa9752dec8d8d95c0872f26c9c1935c410a8f1b8 [1313/1504] ANDROID: mm: fix up removal of vm_total_pages problem

:::::: branch date: 15 hours ago
:::::: commit date: 8 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 page_alloc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/page_alloc.c +3 -3
@@ -5182,7 +5182,7 @@ static unsigned long nr_free_zone_pages(
 	/* Just pick one node, since fallback list is circular */
 	unsigned long sum = 0;
 
-	struct zonelist *zonelist = node_zonelist(numa_node_id(), GFP_KERNEL);
+	struct zonelist *zonelist = node_zonelist(numa_node_id(), GFP_ATOMIC);
 
 	for_each_zone_zonelist(zone, z, zonelist, offset) {
 		unsigned long size = zone_managed_pages(zone);
@@ -5775,8 +5775,8 @@ int local_memory_node(int node)
 {
 	struct zoneref *z;
 
-	z = first_zones_zonelist(node_zonelist(node, GFP_KERNEL),
-				   gfp_zone(GFP_KERNEL),
+	z = first_zones_zonelist(node_zonelist(node, GFP_ATOMIC),
+				   gfp_zone(GFP_ATOMIC),
 				   NULL);
 	return zone_to_nid(z->zone);
 }