Re: - zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter-fix-2.patchremoved from -mm tree

From: Suzuki
Date: Thu Jul 06 2006 - 01:22:22 EST


Hi,

Correct me if I am wrong :

I was wondering if we are hiding the real bug here. All the pages allocated should have the zone set properly. Also, we would not be playing with invalid pages, since the pages allocated through kmem_getpages() should be contiguous. Also, I did a check in kmem_getpages() to see if the zone is set for the pages, properly.. surprisingly it was not set for the last page in the allocation!


Thanks,

Suzuki K P
Linux Technology Centre
IBM Software Labs.


akpm@xxxxxxxx wrote:
The patch titled

Fix potential use of out of range page in kmem_getpages.

has been removed from the -mm tree. Its filename is

zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter-fix-2.patch

This patch was dropped because it was folded into zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter.patch

------------------------------------------------------
Subject: Fix potential use of out of range page in kmem_getpages.
From: Christoph Lameter <clameter@xxxxxxx>


ZVC: Fix potential use of out of range page in kmem_getpages.

We use page_zone(page) following several page increments in kmem_getpages().
Which page in a zone we use really does not matter. However, we may reach an
invalid page and then oops.

So move the counter decrement before we increment page.

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

mm/slab.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/slab.c~zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter-fix-2 mm/slab.c
--- 25/mm/slab.c~zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter-fix-2 Tue Jun 27 15:22:51 2006
+++ 25-akpm/mm/slab.c Tue Jun 27 15:22:51 2006
@@ -1522,12 +1522,12 @@ static void kmem_freepages(struct kmem_c
struct page *page = virt_to_page(addr);
const unsigned long nr_freed = i;
+ sub_zone_page_state(page_zone(page), NR_SLAB, nr_freed);
while (i--) {
BUG_ON(!PageSlab(page));
__ClearPageSlab(page);
page++;
}
- sub_zone_page_state(page_zone(page), NR_SLAB, nr_freed);
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += nr_freed;
free_pages((unsigned long)addr, cachep->gfporder);
_

Patches currently in -mm which might be from clameter@xxxxxxx are

origin.patch
usb-remove-empty-destructor-from-drivers-usb-mon-mon_textc.patch
zoned-vm-counters-create-vmstatc-h-from-page_allocc-h.patch
zoned-vm-counters-basic-zvc-zoned-vm-counter-implementation.patch
zoned-vm-counters-convert-nr_mapped-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_pagecache-to-per-zone-counter.patch
zoned-vm-counters-remove-nr_file_mapped-from-scan-control-structure.patch
zoned-vm-counters-split-nr_anon_pages-off-from-nr_file_mapped.patch
zoned-vm-counters-zone_reclaim-remove-proc-sys-vm-zone_reclaim_interval.patch
zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_slab-to-per-zone-counter-fix-2.patch
zoned-vm-counters-conversion-of-nr_pagetables-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_dirty-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_writeback-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_unstable-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_bounce-to-per-zone-counter.patch
zoned-vm-counters-conversion-of-nr_bounce-to-per-zone-counter-fix-2.patch
zoned-vm-counters-remove-useless-struct-wbs.patch
use-zoned-vm-counters-for-numa-statistics-v3.patch
light-weight-event-counters-v5.patch
slab-consolidate-code-to-free-slabs-from-freelist.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/