From: Dhaval Giani on
> > It was just
> >
> > while echo ; do cat /sys/kernel/<some file> ; done
> >
> > it's all in the email threads somewhere..
>
> The patch that was posted in the thread that I mentioned earlier is here.
> I ran the test for 15 minutes and things are still fine.
>
>
>
> quicklist: Set tlb->need_flush if pages are remaining in quicklist 0
>
> This ensures that the quicklists are drained. Otherwise draining may only
> occur when the processor reaches an idle state.
>

Hi Christoph,

No, it does not stop the oom I am seeing here.

Thanks,

> Signed-off-by: Christoph Lameter <clameter(a)sgi.com>
>
> Index: linux-2.6/include/asm-generic/tlb.h
> ===================================================================
> --- linux-2.6.orig/include/asm-generic/tlb.h 2007-12-13 14:45:38.000000000 -0800
> +++ linux-2.6/include/asm-generic/tlb.h 2007-12-13 14:51:07.000000000 -0800
> @@ -14,6 +14,7 @@
> #define _ASM_GENERIC__TLB_H
>
> #include <linux/swap.h>
> +#include <linux/quicklist.h>
> #include <asm/pgalloc.h>
> #include <asm/tlbflush.h>
>
> @@ -85,6 +86,9 @@ tlb_flush_mmu(struct mmu_gather *tlb, un
> static inline void
> tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
> {
> +#ifdef CONFIG_QUICKLIST
> + tlb->need_flush += &__get_cpu_var(quicklist)[0].nr_pages != 0;
> +#endif
> tlb_flush_mmu(tlb, start, end);
>
> /* keep the page table cache within bounds */

--
regards,
Dhaval
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Christoph Lameter on
On Fri, 21 Dec 2007, Dhaval Giani wrote:

> No, it does not stop the oom I am seeing here.

Duh. Disregard that patch. It looks like check_pgt_cache() is not called.
This could happen if tlb_flush_mmu is never called during the
fork/terminate sequences in your script. pgd_free is called *after* a
possible tlb flush so the pgd page is on the quicklist (which is good for
the next process which needs a pgd). The tlb_flush_mmu's during pte
eviction should trim the quicklist. For some reason this is not happening
on your box (it works here).

Could you try this script that insures that check_pgt_cache is called
after every pgd_free?

Index: linux-2.6/arch/x86/mm/pgtable_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/pgtable_32.c 2007-12-26 12:55:10.000000000 -0800
+++ linux-2.6/arch/x86/mm/pgtable_32.c 2007-12-26 12:55:54.000000000 -0800
@@ -366,6 +366,15 @@ void pgd_free(pgd_t *pgd)
}
/* in the non-PAE case, free_pgtables() clears user pgd entries */
quicklist_free(0, pgd_dtor, pgd);
+
+ /*
+ * We must call check_pgd_cache() here because the pgd is freed after
+ * tlb flushing and the call to check_pgd_cache. In some cases the VM
+ * may not call tlb_flush_mmu during process termination (??).
+ * If this is repeated then we may never call check_pgd_cache.
+ * The quicklist will grow and grow. So call check_pgd_cache here.
+ */
+ check_pgt_cache();
}

void check_pgt_cache(void)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Ingo Molnar on

* Christoph Lameter <clameter(a)sgi.com> wrote:

> Index: linux-2.6/arch/x86/mm/pgtable_32.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/mm/pgtable_32.c 2007-12-26 12:55:10.000000000 -0800
> +++ linux-2.6/arch/x86/mm/pgtable_32.c 2007-12-26 12:55:54.000000000 -0800
> @@ -366,6 +366,15 @@ void pgd_free(pgd_t *pgd)
> }
> /* in the non-PAE case, free_pgtables() clears user pgd entries */
> quicklist_free(0, pgd_dtor, pgd);
> +
> + /*
> + * We must call check_pgd_cache() here because the pgd is freed after
> + * tlb flushing and the call to check_pgd_cache. In some cases the VM
> + * may not call tlb_flush_mmu during process termination (??).

that's incorrect i think: during process termination exit_mmap() calls
tlb_finish_mmu() unconditionally which calls tlb_flush_mmu().

> + * If this is repeated then we may never call check_pgd_cache.
> + * The quicklist will grow and grow. So call check_pgd_cache here.
> + */
> + check_pgt_cache();
> }

so we still dont seem to understand the failure mode well enough. This
also looks like a quite dangerous change so late in the v2.6.24 cycle.
Does it really fix the OOM? If yes, why exactly?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Dhaval Giani on
On Sun, Dec 30, 2007 at 03:01:16PM +0100, Ingo Molnar wrote:
>
> * Christoph Lameter <clameter(a)sgi.com> wrote:
>
> > Index: linux-2.6/arch/x86/mm/pgtable_32.c
> > ===================================================================
> > --- linux-2.6.orig/arch/x86/mm/pgtable_32.c 2007-12-26 12:55:10.000000000 -0800
> > +++ linux-2.6/arch/x86/mm/pgtable_32.c 2007-12-26 12:55:54.000000000 -0800
> > @@ -366,6 +366,15 @@ void pgd_free(pgd_t *pgd)
> > }
> > /* in the non-PAE case, free_pgtables() clears user pgd entries */
> > quicklist_free(0, pgd_dtor, pgd);
> > +
> > + /*
> > + * We must call check_pgd_cache() here because the pgd is freed after
> > + * tlb flushing and the call to check_pgd_cache. In some cases the VM
> > + * may not call tlb_flush_mmu during process termination (??).
>
> that's incorrect i think: during process termination exit_mmap() calls
> tlb_finish_mmu() unconditionally which calls tlb_flush_mmu().
>
> > + * If this is repeated then we may never call check_pgd_cache.
> > + * The quicklist will grow and grow. So call check_pgd_cache here.
> > + */
> > + check_pgt_cache();
> > }
>
> so we still dont seem to understand the failure mode well enough. This
> also looks like a quite dangerous change so late in the v2.6.24 cycle.
> Does it really fix the OOM? If yes, why exactly?
>

No it does not. I've sent out some more information if it helps, will
send to you separately.

--
regards,
Dhaval
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Christoph Lameter on
On Sun, 30 Dec 2007, Ingo Molnar wrote:

> so we still dont seem to understand the failure mode well enough. This
> also looks like a quite dangerous change so late in the v2.6.24 cycle.
> Does it really fix the OOM? If yes, why exactly?

Not exactly sure. I suspect that there is some memory corruption. See my
earlier post from today. I do not see this issue on my system. So it must
be particular to a certain config.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/