From: Ingo Molnar <mingo@elte.hu>
To: Arjan van de Ven <arjan@infradead.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <clameter@sgi.com>,
Bart Van Assche <bart.vanassche@gmail.com>
Subject: Re: quicklists confuse meminfo
Date: Sun, 9 Mar 2008 20:27:45 +0100 [thread overview]
Message-ID: <20080309192745.GA16929@elte.hu> (raw)
In-Reply-To: <20080309192514.GA16759@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> > careful with this; the quicklists aren't JUST for speed they are
> > also there to make sure a page we free that is a pagetable, is not
> > reused until we have finished flushing the tlbs on all the cpus that
> > saw it. This is a really hard correctness requirement, and while I
> > can see that quicklists are probably not the best way to achieve
> > this, we can't just throw away the behavior ;(
>
> no, that's not true anymore - and the current quicklists code doesnt
> do anything like that AFAICS. It used to be a lot more complex, but
> now it's just a thin wrapper around the page allocator.
i.e. the patch below should do the trick.
(it's still work in progress but it seems to boot just fine)
Ingo
------------>
Subject: x86: patches/remove-quicklists.patch
From: Ingo Molnar <mingo@elte.hu>
Date: Sun Mar 09 20:04:32 CET 2008
---
arch/x86/mm/pgtable_32.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
Index: linux-x86.q/arch/x86/mm/pgtable_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/mm/pgtable_32.c
+++ linux-x86.q/arch/x86/mm/pgtable_32.c
@@ -10,7 +10,6 @@
#include <linux/pagemap.h>
#include <linux/spinlock.h>
#include <linux/module.h>
-#include <linux/quicklist.h>
#include <asm/system.h>
#include <asm/pgtable.h>
@@ -338,12 +337,16 @@ static void pgd_mop_up_pmds(struct mm_st
pgd_t *pgd_alloc(struct mm_struct *mm)
{
- pgd_t *pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
+ pgd_t *pgd;
+
+ pgd = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
+ if (pgd)
+ pgd_ctor(pgd);
mm->pgd = pgd; /* so that alloc_pd can use it */
if (pgd && !pgd_prepopulate_pmd(mm, pgd)) {
- quicklist_free(0, pgd_dtor, pgd);
+ free_page((unsigned long)pgd);
pgd = NULL;
}
@@ -353,12 +356,12 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
pgd_mop_up_pmds(mm, pgd);
- quicklist_free(0, pgd_dtor, pgd);
+ pgd_dtor(pgd);
+ free_page((unsigned long)pgd);
}
void check_pgt_cache(void)
{
- quicklist_trim(0, pgd_dtor, 25, 16);
}
void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
next prev parent reply other threads:[~2008-03-09 19:28 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-09 10:19 quicklists confuse meminfo Thomas Gleixner
2008-03-09 10:26 ` Bart Van Assche
2008-03-09 10:29 ` Andi Kleen
2008-03-09 10:42 ` KOSAKI Motohiro
2008-03-09 12:00 ` Thomas Gleixner
2008-03-09 11:14 ` Ingo Molnar
2008-03-09 11:56 ` Thomas Gleixner
2008-03-09 12:01 ` Ingo Molnar
2008-03-09 12:49 ` Andi Kleen
2008-03-10 15:51 ` Christoph Lameter
2008-03-09 12:03 ` Johannes Weiner
2008-03-09 12:03 ` KOSAKI Motohiro
2008-03-09 12:09 ` Ingo Molnar
2008-03-09 12:34 ` Ingo Molnar
2008-03-09 12:51 ` KOSAKI Motohiro
2008-03-09 13:20 ` Thomas Gleixner
2008-03-09 18:46 ` Andrew Morton
2008-03-09 20:21 ` Andi Kleen
2008-03-10 15:54 ` Christoph Lameter
2008-03-10 16:43 ` Andi Kleen
2008-03-10 17:19 ` Hugh Dickins
2008-03-10 17:25 ` Andi Kleen
2008-03-10 17:31 ` Jeremy Fitzhardinge
2008-03-10 17:53 ` Andi Kleen
2008-03-10 18:35 ` Jeremy Fitzhardinge
2008-03-10 19:06 ` Andi Kleen
2008-03-10 20:54 ` H. Peter Anvin
2008-03-10 21:26 ` Jeremy Fitzhardinge
2008-03-11 4:07 ` Nick Piggin
2008-03-21 12:52 ` Bart Van Assche
2008-03-21 14:45 ` Ingo Molnar
2008-03-26 7:45 ` Bart Van Assche
2008-03-26 7:53 ` Andrew Morton
2008-03-26 8:13 ` Ingo Molnar
2008-03-26 10:37 ` Bart Van Assche
2008-03-26 16:34 ` Christoph Lameter
2008-03-27 9:48 ` Bart Van Assche
2008-03-09 19:11 ` Arjan van de Ven
2008-03-09 19:25 ` Ingo Molnar
2008-03-09 19:27 ` Ingo Molnar [this message]
2008-03-09 19:31 ` Ingo Molnar
2008-03-10 15:57 ` Christoph Lameter
2008-03-10 15:55 ` Christoph Lameter
2008-03-09 12:47 ` KOSAKI Motohiro
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=20080309192745.GA16929@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=bart.vanassche@gmail.com \
--cc=clameter@sgi.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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.