linux-mips
[Top] [All Lists]

[PATCH] MIPS/mm: add compound tail page _mapcount when mapped

To: Ralf Baechle <ralf@linux-mips.org>, Andrew Morton <akpm@linux-foundation.org>, Andrea Arcangeli <aarcange@redhat.com>, linux-mips@linux-mips.org, Youquan Song <youquan.song@intel.com>, Andi Kleen <andi@firstfloor.org>, LKML <linux-kernel@vger.kernel.org>, stable@vger.kernel.org
Subject: [PATCH] MIPS/mm: add compound tail page _mapcount when mapped
From: Jovi Zhang <bookjovi@gmail.com>
Date: Wed, 22 Aug 2012 11:02:34 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Zfp/fDsXhAU7rF0RJQ6tYbJAohBCVdIBrwJOuJdQG5s=; b=uadLjMFd1frrzFJQvnEIbbwhDDpCdYyG+z1RWJZnEGRbX5dj1i5aW/E2h9fNMvPgKE gSWGgXCpOQ56DaxBQguOTBrljP8GyeJVFgKGB9ODjxJtZ/rexeL1lpUKHMn67KQY6YRK ZeTE/uN7JnVTxD6ZcWtnQ6WkPb05OMZucacBn7RjpgMFu9VGOSEDWlLomJQJTucZ+3ua +kqy253i3zmkv0HeJTqpr6e/1tJ11Pi4/sGsFi+iMVGOMmq6p4MXPdJrN7b8SeK4XmEb xiz12JpGc3NXTMGEGgbKGxygOEvRsVWkIILJXXUyEyS8gz4Y++axyo2oWJESp+Xc0CA7 mt2w==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Sender: linux-mips-bounce@linux-mips.org
>From 3dc19ea2b535719d0b4177f17bbbff9cbf257b23 Mon Sep 17 00:00:00 2001
From: Jovi Zhang <bookjovi@gmail.com>
Date: Wed, 22 Aug 2012 10:34:08 +0800
Subject: [PATCH] MIPS/mm: add compound tail page _mapcount when mapped

see commit b6999b191 which target for x86 mm/gup, let it align with
mips architecture.

Quote from commit b6999b191:
    "If compound pages are used and the page is a
    tail page, gup_huge_pmd() increases _mapcount to record tail page are
    mapped while gup_huge_pud does not do that."

Signed-off-by: Jovi Zhang <boojovi@gmail.com>
Cc: Youquan Song <youquan.song@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: <stable@vger.kernel.org>
---
 arch/mips/mm/gup.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/mm/gup.c b/arch/mips/mm/gup.c
index 33aadbc..dcfd573 100644
--- a/arch/mips/mm/gup.c
+++ b/arch/mips/mm/gup.c
@@ -152,6 +152,8 @@ static int gup_huge_pud(pud_t pud, unsigned long
addr, unsigned long end,
        do {
                VM_BUG_ON(compound_head(page) != head);
                pages[*nr] = page;
+               if (PageTail(page))
+                       get_huge_page_tail(page);
                (*nr)++;
                page++;
                refs++;
-- 
1.7.9.7

<Prev in Thread] Current Thread [Next in Thread>