linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, Dave Hansen <dave@linux.vnet.ibm.com>
Subject: [RFC][PATCH 2/3] track numbers of pagetable pages
Date: Fri, 15 Apr 2011 10:38:23 -0700	[thread overview]
Message-ID: <20110415173823.EA7A7473@kernel> (raw)
In-Reply-To: <20110415173821.62660715@kernel>


Now that we have the mm in the constructor and destructor, it's
simple to to bump a counter.  Add the counter to the mm and use
the existing MM_* counter infrastructure.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---

 linux-2.6.git-dave/include/linux/mm.h       |    2 ++
 linux-2.6.git-dave/include/linux/mm_types.h |    1 +
 2 files changed, 3 insertions(+)

diff -puN include/linux/mm.h~track-pagetable-pages include/linux/mm.h
--- linux-2.6.git/include/linux/mm.h~track-pagetable-pages	2011-04-15 10:37:10.768832396 -0700
+++ linux-2.6.git-dave/include/linux/mm.h	2011-04-15 10:37:10.780832393 -0700
@@ -1245,12 +1245,14 @@ static inline pmd_t *pmd_alloc(struct mm
 static inline void pgtable_page_ctor(struct mm_struct *mm, struct page *page)
 {
 	pte_lock_init(page);
+	inc_mm_counter(mm, MM_PTEPAGES);
 	inc_zone_page_state(page, NR_PAGETABLE);
 }
 
 static inline void pgtable_page_dtor(struct mm_struct *mm, struct page *page)
 {
 	pte_lock_deinit(page);
+	dec_mm_counter(mm, MM_PTEPAGES);
 	dec_zone_page_state(page, NR_PAGETABLE);
 }
 
diff -puN include/linux/mm_types.h~track-pagetable-pages include/linux/mm_types.h
--- linux-2.6.git/include/linux/mm_types.h~track-pagetable-pages	2011-04-15 10:37:10.772832395 -0700
+++ linux-2.6.git-dave/include/linux/mm_types.h	2011-04-15 10:37:10.780832393 -0700
@@ -200,6 +200,7 @@ enum {
 	MM_FILEPAGES,
 	MM_ANONPAGES,
 	MM_SWAPENTS,
+	MM_PTEPAGES,
 	NR_MM_COUNTERS
 };
 
_

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-04-15 17:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 17:38 [RFC][PATCH 0/3] track pte pages and use in OOM score Dave Hansen
2011-04-15 17:38 ` [RFC][PATCH 1/3] pass mm in to pgtable ctor/dtor Dave Hansen
2011-04-15 17:38 ` Dave Hansen [this message]
2011-04-16  9:44   ` [RFC][PATCH 2/3] track numbers of pagetable pages Matt Fleming
2011-04-18 15:02     ` Dave Hansen
2011-04-26 14:57       ` Matt Fleming
2011-04-26 19:26         ` Hugh Dickins
2011-04-15 17:38 ` [RFC][PATCH 3/3] use pte pages in OOM score Dave Hansen

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=20110415173823.EA7A7473@kernel \
    --to=dave@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 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).