Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1401564 > unrolled thread

Re: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c

Started byMichal Hocko <mhocko@kernel.org>
First post2016-05-16 17:20 +0200
Last post2016-05-17 07:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Question About Functions "__free_pages_check" and  "check_new_page" in page_alloc.c Michal Hocko <mhocko@kernel.org> - 2016-05-16 17:20 +0200
    Re: Question About Functions "__free_pages_check" and  "check_new_page" in page_alloc.c Vlastimil Babka <vbabka@suse.cz> - 2016-05-17 07:20 +0200

#1401564 — Re: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c

FromMichal Hocko <mhocko@kernel.org>
Date2016-05-16 17:20 +0200
SubjectRe: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c
Message-ID<rzstk-df-9@gated-at.bofh.it>
On Mon 16-05-16 21:42:23, Wang Xiaoqiang wrote:
> 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.
-- 
Michal Hocko
SUSE Labs

[toc] | [next] | [standalone]


#1402111

FromVlastimil Babka <vbabka@suse.cz>
Date2016-05-17 07:20 +0200
Message-ID<rzFAe-iS-1@gated-at.bofh.it>
In reply to#1401564
On 05/17/2016 03:06 AM, Wang Xiaoqiang wrote:
>>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.

>>will then print more detailed information.
>>--
>>Michal Hocko
>>SUSE Labs
> 
> thank you, Michal.
> 
> 
>  
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web