linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Wang Xiaoqiang <wang_xiaoq@126.com>
Cc: vbabka@suse.cz, n-horiguchi@ah.jp.nec.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c
Date: Mon, 16 May 2016 17:16:57 +0200	[thread overview]
Message-ID: <20160516151657.GC23251@dhcp22.suse.cz> (raw)
In-Reply-To: <7374bd2e.da35.154b9cda7d2.Coremail.wang_xiaoq@126.com>

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-05-16 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 13:42 Wang Xiaoqiang
2016-05-16 15:16 ` Michal Hocko [this message]
2016-05-17  1:06   ` Wang Xiaoqiang
2016-05-17  5:14     ` Vlastimil Babka
2016-05-17  8:17       ` Wang Xiaoqiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160516151657.GC23251@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=vbabka@suse.cz \
    --cc=wang_xiaoq@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox