From: Matt Fleming <matt@console-pimps.org>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC][PATCH 2/3] track numbers of pagetable pages
Date: Sat, 16 Apr 2011 10:44:56 +0100 [thread overview]
Message-ID: <20110416104456.3915b7de@mfleming-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20110415173823.EA7A7473@kernel>
On Fri, 15 Apr 2011 10:38:23 -0700
Dave Hansen <dave@linux.vnet.ibm.com> wrote:
>
> 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);
> }
I'm probably missing something really obvious but...
Is this safe in the non-USE_SPLIT_PTLOCKS case? If we're not using
split-ptlocks then inc/dec_mm_counter() are only safe when done under
mm->page_table_lock, right? But it looks to me like we can end up doing,
__pte_alloc()
pte_alloc_one()
pgtable_page_ctor()
before acquiring mm->page_table_lock in __pte_alloc().
--
Matt Fleming, Intel Open Source Technology Center
--
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>
next prev parent reply other threads:[~2011-04-16 9:45 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 ` [RFC][PATCH 2/3] track numbers of pagetable pages Dave Hansen
2011-04-16 9:44 ` Matt Fleming [this message]
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=20110416104456.3915b7de@mfleming-mobl1.ger.corp.intel.com \
--to=matt@console-pimps.org \
--cc=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