* [PATCH] ANDROID: mm: fix call_kern.cocci warnings
2020-10-01 8:14 [android-common:android-mainline 1313/1504] 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 kernel test robot
@ 2020-10-01 8:14 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-10-01 8:14 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
From: kernel test robot <lkp@intel.com>
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")
Signed-off-by: kernel test robot <lkp@intel.com>
---
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(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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);
}
^ permalink raw reply [flat|nested] 2+ messages in thread