From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with SMTP id B47B86B0082 for ; Thu, 17 Dec 2009 14:16:42 -0500 (EST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH 18 of 28] ensure mapcount is taken on head pages Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2009 19:00:21 -0000 From: Andrea Arcangeli Sender: owner-linux-mm@kvack.org To: linux-mm@kvack.org Cc: Marcelo Tosatti , Adam Litke , Avi Kivity , Izik Eidus , Hugh Dickins , Nick Piggin , Rik van Riel , Mel Gorman , Andi Kleen , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright Dave Hansen , Andrew Morton List-ID: From: Andrea Arcangeli Unlike the page count, the page mapcount cannot be taken on PageTail compound pages. Signed-off-by: Andrea Arcangeli --- diff --git a/include/linux/rmap.h b/include/linux/rmap.h --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -105,6 +105,7 @@ void page_remove_rmap(struct page *); static inline void page_dup_rmap(struct page *page) { + VM_BUG_ON(PageTail(page)); atomic_inc(&page->_mapcount); } diff --git a/mm/rmap.c b/mm/rmap.c --- a/mm/rmap.c +++ b/mm/rmap.c @@ -733,6 +733,7 @@ void page_add_file_rmap(struct page *pag */ void page_remove_rmap(struct page *page) { + VM_BUG_ON(PageTail(page)); /* page still mapped by someone else? */ if (!atomic_add_negative(-1, &page->_mapcount)) return; @@ -1281,6 +1282,7 @@ static int rmap_walk_file(struct page *p int rmap_walk(struct page *page, int (*rmap_one)(struct page *, struct vm_area_struct *, unsigned long, void *), void *arg) { + VM_BUG_ON(PageTail(page)); VM_BUG_ON(!PageLocked(page)); if (unlikely(PageKsm(page))) -- 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: email@kvack.org