All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	John David Anglin <dave.anglin@bell.net>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Graham Gower <graham.gower@gmail.com>,
	Domenico Andreoli <cavokz@gmail.com>
Subject: [PATCH] parisc: fix pmd accounting with 3-level page tables
Date: Fri, 13 Mar 2015 12:30:02 +0200	[thread overview]
Message-ID: <1426242602-52804-1-git-send-email-kirill.shutemov@linux.intel.com> (raw)

There's hack in pgd_alloc() on parisc to initialize one pmd, which is
not accounted. It leads to underflow on exit.

Let's adjust nr_pmds on pgd_alloc() to get accounting correct.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: John David Anglin <dave.anglin@bell.net>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Graham Gower <graham.gower@gmail.com>
Cc: Domenico Andreoli <cavokz@gmail.com>
---
 arch/parisc/include/asm/pgalloc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h
index 55ad8be9b7f3..068b2fb9a47c 100644
--- a/arch/parisc/include/asm/pgalloc.h
+++ b/arch/parisc/include/asm/pgalloc.h
@@ -38,6 +38,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 		/* The first pmd entry also is marked with _PAGE_GATEWAY as
 		 * a signal that this pmd may not be freed */
 		__pgd_val_set(*pgd, PxD_FLAG_ATTACHED);
+		mm_inc_nr_pmds(mm);
 #endif
 	}
 	return actual_pgd;
-- 
2.1.4


WARNING: multiple messages have this Message-ID (diff)
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	John David Anglin <dave.anglin@bell.net>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Graham Gower <graham.gower@gmail.com>,
	Domenico Andreoli <cavokz@gmail.com>
Subject: [PATCH] parisc: fix pmd accounting with 3-level page tables
Date: Fri, 13 Mar 2015 12:30:02 +0200	[thread overview]
Message-ID: <1426242602-52804-1-git-send-email-kirill.shutemov@linux.intel.com> (raw)

There's hack in pgd_alloc() on parisc to initialize one pmd, which is
not accounted. It leads to underflow on exit.

Let's adjust nr_pmds on pgd_alloc() to get accounting correct.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: John David Anglin <dave.anglin@bell.net>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Graham Gower <graham.gower@gmail.com>
Cc: Domenico Andreoli <cavokz@gmail.com>
---
 arch/parisc/include/asm/pgalloc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h
index 55ad8be9b7f3..068b2fb9a47c 100644
--- a/arch/parisc/include/asm/pgalloc.h
+++ b/arch/parisc/include/asm/pgalloc.h
@@ -38,6 +38,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 		/* The first pmd entry also is marked with _PAGE_GATEWAY as
 		 * a signal that this pmd may not be freed */
 		__pgd_val_set(*pgd, PxD_FLAG_ATTACHED);
+		mm_inc_nr_pmds(mm);
 #endif
 	}
 	return actual_pgd;
-- 
2.1.4

--
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:[~2015-03-13 10:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 10:30 Kirill A. Shutemov [this message]
2015-03-13 10:30 ` [PATCH] parisc: fix pmd accounting with 3-level page tables Kirill A. Shutemov
2015-03-13 21:50 ` Graham Gower
2015-03-13 21:50   ` Graham Gower

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=1426242602-52804-1-git-send-email-kirill.shutemov@linux.intel.com \
    --to=kirill.shutemov@linux.intel.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=cavokz@gmail.com \
    --cc=dave.anglin@bell.net \
    --cc=graham.gower@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.