Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c
Hi all,
I am really confused about these two functions. The following code snippet:
if(unlikely(atomic_read(&page->_mapcount) != -1))
bad_reason ="nonzero mapcount";if(unlikely(page->mapping != NULL))
bad_reason ="non-NULL mapping";if(unlikely(page_ref_count(page) !=0))
bad_reason ="nonzero _count";
...Wouldn't the previous value of "bad_reason" be overwritten by the later? Hope to receive from you.
--
thx!
Wang Xiaoqiang
Quoted 11 lines · Wang Xiaoqiang
Hi all,
I am really confused about these two functions. The following code snippet:
if(unlikely(atomic_read(&page->_mapcount) != -1))bad_reason ="nonzero mapcount";if(unlikely(page->mapping != NULL)) bad_reason ="non-NULL mapping";if(unlikely(page_ref_count(page) !=0)) bad_reason ="nonzero _count"; ...Wouldn't the previous value of "
bad_reason" be overwritten by the later? Hope to receive from you.
yes it would. Why that would matter. The checks should be in an order which could give us a more specific reason with later checks. bad_page() will then print more detailed information.
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 2 lines
yes it would. Why that would matter. The checks should be in an order which could give us a more specific reason with later checks.
bad_page()
I see, you mean the later "bad_reason" is the superset of the previous one.
Quoted 4 lines
will then print more detailed information.
--
Michal Hocko
SUSE Labs
thank you, Michal.
Quoted 4 lines · Wang Xiaoqiang
Quoted 2 lines
yes it would. Why that would matter. The checks should be in an order which could give us a more specific reason with later checks.
bad_page()I see, you mean the later "
bad_reason" is the superset of the previous one.
Not exactly. It's not possible to sort all the reasons like that. But as Michal said, bad_page() will print all the relevant info so you can reconstruct all reasons from it. The bad_reason text is mostly a hint what to check first.
Quoted 10 lines
Quoted 4 lines
will then print more detailed information.
--
Michal Hocko
SUSE Labsthank you, Michal.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
thank you very much! Vlastimil.
Quoted 17 lines · Vlastimil Babka
Quoted 4 lines · Wang Xiaoqiang
Quoted 2 lines
yes it would. Why that would matter. The checks should be in an order which could give us a more specific reason with later checks.
bad_page()I see, you mean the later "
bad_reason" is the superset of the previous one.Not exactly. It's not possible to sort all the reasons like that. But as Michal said,
bad_page()will print all the relevant info so you can reconstruct all reasons from it. Thebad_reasontext is mostly a hint what to check first.Quoted 6 lines
Quoted 4 lines
will then print more detailed information.
--
Michal Hocko
SUSE Labsthank you, Michal.