linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* free_more_memory() calls try_to_free_pages() with a NULL classzone
@ 2002-09-19  2:54 William Lee Irwin III
  2002-09-19  3:11 ` Martin J. Bligh
  0 siblings, 1 reply; 4+ messages in thread
From: William Lee Irwin III @ 2002-09-19  2:54 UTC (permalink / raw)
  To: linux-mm

I'm not convinced contig_page_data is supposed to even be defined.
This needs to do something similar to

	for_each_pgdat(pgdat) {
		zone = pgdat->node_zonelists[GFP_NOFS & GFP_ZONEMASK];
		if (!zone || !zone->size)
			continue;
		try_to_free_pages(zone, GFP_NOFS, 0);
	}

Discovered during tiobench 16K on 32x/32G NUMA-Q.


Bill

Program received signal SIGSEGV, Segmentation fault.
shrink_caches (classzone=0x0, priority=12, total_scanned=0xea86fd9c,
    gfp_mask=208, nr_pages=32) at vmscan.c:614
614     vmscan.c: No such file or directory.
        in vmscan.c
(gdb) bt
#0  shrink_caches (classzone=0x0, priority=12, total_scanned=0xea86fd9c,
    gfp_mask=208, nr_pages=32) at vmscan.c:614
#1  0xc0137ea8 in try_to_free_pages (classzone=0x0, gfp_mask=208, order=0)
    at vmscan.c:673
#2  0xc014719f in free_more_memory () at buffer.c:476
#3  0xc0147d68 in __getblk_slow (bdev=0xf68fada0, block=36, size=4096)
    at buffer.c:1157                                  
#4  0xc01480cb in __getblk (bdev=0xf68fada0, block=36, size=4096)
    at buffer.c:1402
#5  0xc01480f7 in __bread (bdev=0xf68fada0, block=36, size=4096)
    at buffer.c:1412
#6  0xc0177361 in ext2_get_inode (sb=0xf68e0e00, ino=993, p=0xea86fe6c)
    at /mnt/b/2.5.36/linux-2.5.36/include/linux/buffer_head.h:227
#7  0xc017767a in ext2_update_inode (inode=0xdbc510b4, do_sync=0)
    at inode.c:1076
#8  0xc0177998 in ext2_write_inode (inode=0xdbc510b4, wait=0) at inode.c:1164
#9  0xc0163062 in write_inode (inode=0xdbc510b4, sync=0) at fs-writeback.c:108
#10 0xc01630f2 in __sync_single_inode (inode=0xdbc510b4, wait=0,
    wbc=0xea86ff98) at fs-writeback.c:152
#11 0xc01632c0 in __writeback_single_inode (inode=0xdbc510b4, sync=0,
    wbc=0xea86ff98) at fs-writeback.c:198
#12 0xc0163452 in sync_sb_inodes (sb=0xf68e0e00, wbc=0xea86ff98)
    at fs-writeback.c:276
#13 0xc01635c1 in writeback_inodes (wbc=0xea86ff98) at fs-writeback.c:322
#14 0xc01413df in background_writeout (_min_pages=3235) at page-writeback.c:190
#15 0xc0140ff8 in __pdflush (my_work=0xea86ffd4) at pdflush.c:119
#16 0xc01410e7 in pdflush (dummy=0x0) at pdflush.c:167

MemTotal:     32107248 kB
MemFree:      14422976 kB
MemShared:           0 kB
Buffers:          1396 kB
Cached:       16772800 kB
SwapCached:          0 kB
Active:          36004 kB
Inactive:     16982084 kB
HighTotal:    31588352 kB
HighFree:     14421456 kB
LowTotal:       518896 kB
LowFree:          1520 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:         2278444 kB
Writeback:       46356 kB
Mapped:         253176 kB
Slab:           332592 kB
Committed_AS: 38937664 kB
PageTables:      78708 kB
ReverseMaps:     94874

       buffer_head:   199327KB   199327KB  100.0 
       names_cache:    47520KB    47520KB  100.0 
       task_struct:    24898KB    25295KB   98.42
   radix_tree_node:    20438KB    20438KB  100.0 
    vm_area_struct:     3363KB     3363KB  100.0 
  ext2_inode_cache:     2197KB     2197KB  100.0 
         size-1024:     1604KB     1604KB  100.0 
         biovec-16:     1044KB     1293KB   80.75
         size-2048:     1008KB     1008KB  100.0 
         pte_chain:      754KB      819KB   92.1 
      dentry_cache:      780KB      780KB  100.0 
        biovec-256:      780KB      780KB  100.0 
              filp:      697KB      701KB   99.46
         size-4096:      608KB      608KB  100.0 
          sigqueue:      530KB      579KB   91.59
           size-32:      512KB      512KB  100.0 
 skbuff_head_cache:      498KB      498KB  100.0 
          size-512:      480KB      480KB  100.0 
               bio:      333KB      464KB   71.77
        biovec-128:      390KB      390KB  100.0 
          size-256:      367KB      367KB  100.0 
   blkdev_requests:      336KB      341KB   98.68
--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: free_more_memory() calls try_to_free_pages() with a NULL classzone
  2002-09-19  2:54 free_more_memory() calls try_to_free_pages() with a NULL classzone William Lee Irwin III
@ 2002-09-19  3:11 ` Martin J. Bligh
  2002-09-19  5:07   ` Martin J. Bligh
  0 siblings, 1 reply; 4+ messages in thread
From: Martin J. Bligh @ 2002-09-19  3:11 UTC (permalink / raw)
  To: William Lee Irwin III, linux-mm

> I'm not convinced contig_page_data is supposed to even be defined.

It's not. Thus this:

zone = contig_page_data.node_zonelists[GFP_NOFS&GFP_ZONEMASK].zones[0];

should have been caught at compile time.

The fact that we define it in numa.c is even more amusing.

If you fix what you pointed out, and add the appended, does it
compile?

--- 2.5.36-mm1/mm/numa.c.old	2002-09-18 19:47:11.000000000 -0700
+++ 2.5.36-mm1/mm/numa.c	2002-09-18 19:47:32.000000000 -0700
@@ -11,11 +11,11 @@
 
 int numnodes = 1;	/* Initialized for UMA platforms */
 
+#ifndef CONFIG_DISCONTIGMEM
+
 static bootmem_data_t contig_bootmem_data;
 pg_data_t contig_page_data = { .bdata = &contig_bootmem_data };
 
-#ifndef CONFIG_DISCONTIGMEM
-
 /*
  * This is meant to be invoked by platforms whose physical memory starts
  * at a considerably higher value than 0. Examples are Super-H, ARM, m68k.

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: free_more_memory() calls try_to_free_pages() with a NULL classzone
  2002-09-19  3:11 ` Martin J. Bligh
@ 2002-09-19  5:07   ` Martin J. Bligh
  2002-09-26  8:52     ` William Lee Irwin III
  0 siblings, 1 reply; 4+ messages in thread
From: Martin J. Bligh @ 2002-09-19  5:07 UTC (permalink / raw)
  To: William Lee Irwin III, linux-mm

> mbligh:
>> wli:
>> I'm not convinced contig_page_data is supposed to even be defined.
> 
> It's not. Thus this:
> 
> zone = contig_page_data.node_zonelists[GFP_NOFS&GFP_ZONEMASK].zones[0];
> 
> should have been caught at compile time.

OK, here's more or less your fix as a patch (one typo fixed)
plus the undef of contig_page_data for discontigmem.
You don't need to check the zone size, that gets done when the
zonelist is built.

Can you put it through the wli snot-kicking test?
Compiles and boots (well, if you apply the other patch I sent
earlier first).

Thanks,

M.

diff -urN -X /home/mbligh/.diff.exclude numafixes/fs/buffer.c numafixes2/fs/buffer.c
--- numafixes/fs/buffer.c	Wed Sep 18 20:41:12 2002
+++ numafixes2/fs/buffer.c	Wed Sep 18 21:41:05 2002
@@ -468,12 +468,17 @@
 static void free_more_memory(void)
 {
 	struct zone *zone;
+	pg_data_t *pgdat;
 
-	zone = contig_page_data.node_zonelists[GFP_NOFS&GFP_ZONEMASK].zones[0];
 	wakeup_bdflush(1024);
 	blk_run_queues();
 	yield();
-	try_to_free_pages(zone, GFP_NOFS, 0);
+
+	for_each_pgdat(pgdat) {
+		zone = pgdat->node_zonelists[GFP_NOFS&GFP_ZONEMASK].zones[0];
+		if (zone)
+			try_to_free_pages(zone, GFP_NOFS, 0);
+	}
 }
 
 /*
diff -urN -X /home/mbligh/.diff.exclude numafixes/mm/bootmem.c numafixes2/mm/bootmem.c
--- numafixes/mm/bootmem.c	Tue Sep 17 17:58:50
2002
+++ numafixes2/mm/bootmem.c	Wed Sep 18 21:44:16 2002
@@ -311,6 +311,7 @@
 	return(free_all_bootmem_core(pgdat));
 }
 
+#ifndef CONFIG_DISCONTIGMEM
 unsigned long __init init_bootmem (unsigned long start, unsigned long pages)
 {
 	max_low_pfn = pages;
@@ -334,6 +335,7 @@
 {
 	return(free_all_bootmem_core(&contig_page_data));
 }
+#endif /* !CONFIG_DISCONTIGMEM */
 
 void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal)
 {
diff -urN -X /home/mbligh/.diff.exclude numafixes/mm/numa.c numafixes2/mm/numa.c
--- numafixes/mm/numa.c	Wed Sep 18 20:41:12 2002
+++ numafixes2/mm/numa.c	Wed Sep 18 21:41:05 2002
@@ -11,10 +11,10 @@
 
 int numnodes = 1;	/* Initialized for UMA platforms */
 
+#ifndef CONFIG_DISCONTIGMEM
+

static bootmem_data_t contig_bootmem_data;
 pg_data_t contig_page_data = { .bdata = &contig_bootmem_data };
-
-#ifndef CONFIG_DISCONTIGMEM
 
 /*
  * This is meant to be invoked by platforms whose physical memory starts

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: free_more_memory() calls try_to_free_pages() with a NULL classzone
  2002-09-19  5:07   ` Martin J. Bligh
@ 2002-09-26  8:52     ` William Lee Irwin III
  0 siblings, 0 replies; 4+ messages in thread
From: William Lee Irwin III @ 2002-09-26  8:52 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: linux-mm

On Wed, Sep 18, 2002 at 10:07:42PM -0700, Martin J. Bligh wrote:
> Can you put it through the wli snot-kicking test?
> Compiles and boots (well, if you apply the other patch I sent
> earlier first).
> Thanks,
> M.

It went away. Looks good!


Cheers,
Bill
--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-09-26  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-19  2:54 free_more_memory() calls try_to_free_pages() with a NULL classzone William Lee Irwin III
2002-09-19  3:11 ` Martin J. Bligh
2002-09-19  5:07   ` Martin J. Bligh
2002-09-26  8:52     ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox