linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] mm:add VM_BUG_ON() for page_mapcount()
@ 2014-12-08  9:33 Hillf Danton
  2014-12-08  9:51 ` Wang, Yalin
  2014-12-08  9:58 ` [PATCH V2] " Wang, Yalin
  0 siblings, 2 replies; 7+ messages in thread
From: Hillf Danton @ 2014-12-08  9:33 UTC (permalink / raw)
  To: Yalin.Wang
  Cc: linux-kernel, linux-mm, linux-arm-kernel, Andrew Morton, Hillf Danton

> 
> This patch add VM_BUG_ON() for slab page,
> because _mapcount is an union with slab struct in struct page,
> avoid access _mapcount if this page is a slab page.
> Also remove the unneeded bracket.
> 
> Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
> ---
>  include/linux/mm.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 11b65cf..34124c4 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -373,7 +373,8 @@ static inline void reset_page_mapcount(struct page *page)
> 
>  static inline int page_mapcount(struct page *page)
>  {
> -	return atomic_read(&(page)->_mapcount) + 1;
> +	VM_BUG_ON(PageSlab(page));

s/ VM_BUG_ON/ VM_BUG_ON_PAGE/ ?

> +	return atomic_read(&page->_mapcount) + 1;
>  }
> 


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

end of thread, other threads:[~2015-06-09 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08  9:33 [PATCH] mm:add VM_BUG_ON() for page_mapcount() Hillf Danton
2014-12-08  9:51 ` Wang, Yalin
2014-12-08  9:58 ` [PATCH V2] " Wang, Yalin
2014-12-08  9:59   ` [PATCH V3] mm:add VM_BUG_ON_PAGE() " Wang, Yalin
2014-12-08 11:54     ` Kirill A. Shutemov
2014-12-09  3:18     ` Hillf Danton
2015-06-09 16:14     ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).