linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Can kfree() sleep at runtime?
@ 2018-05-31 13:10 Jia-Ju Bai
  2018-05-31 14:08 ` Matthew Wilcox
  2018-05-31 14:09 ` Christopher Lameter
  0 siblings, 2 replies; 10+ messages in thread
From: Jia-Ju Bai @ 2018-05-31 13:10 UTC (permalink / raw)
  To: cl, penberg, rientjes, iamjoonsoo.kim, akpm, linux-mm,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Hello,

I write a static analysis tool (DSAC), and it finds that kfree() can sleep.

Here is the call path for kfree().
Please look at it *from the bottom up*.

[FUNC] alloc_pages(GFP_KERNEL)
arch/x86/mm/pageattr.c, 756: alloc_pages in split_large_page
arch/x86/mm/pageattr.c, 1283: split_large_page in __change_page_attr
arch/x86/mm/pageattr.c, 1391: __change_page_attr in 
__change_page_attr_set_clr
arch/x86/mm/pageattr.c, 2014: __change_page_attr_set_clr in __set_pages_np
arch/x86/mm/pageattr.c, 2034: __set_pages_np in __kernel_map_pages
./include/linux/mm.h, 2488: __kernel_map_pages in kernel_map_pages
mm/page_alloc.c, 1074: kernel_map_pages in free_pages_prepare
mm/page_alloc.c, 1264: free_pages_prepare in __free_pages_ok
mm/page_alloc.c, 4312: __free_pages_ok in __free_pages
mm/slub.c, 3914: __free_pages in kfree

I always have an impression that kfree() never sleeps, so I feel 
confused here.
So could someone please help me to find the mistake?
Thanks in advance :)

Best wishes,
Jia-Ju Bai

[-- Attachment #2: Type: text/html, Size: 1492 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-06-01  1:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 13:10 Can kfree() sleep at runtime? Jia-Ju Bai
2018-05-31 14:08 ` Matthew Wilcox
2018-05-31 14:12   ` Christopher Lameter
2018-05-31 14:14     ` Matthew Wilcox
2018-05-31 14:30       ` Christopher Lameter
2018-06-01  1:22         ` Jia-Ju Bai
2018-06-01  1:34           ` Nadav Amit
2018-06-01  1:12   ` Jia-Ju Bai
2018-05-31 14:09 ` Christopher Lameter
2018-06-01  1:18   ` Jia-Ju Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox