PROBLEM with kernel

Previous thread: [PATCH] Net: reorder udp_iter_state to remove padding on 64bit builds by Richard Kennedy on Thursday, June 5, 2008 - 3:33 am. (3 messages)

Next thread: [PATCH] x86: fix compile warning in io_apic_{32,64}.c by Andreas Herrmann on Thursday, June 5, 2008 - 5:05 am. (5 messages)
From: Andrej Hocevar
Date: Thursday, June 5, 2008 - 4:23 am

I got this right after resuming from hibernation. Unfortunatelly, I
don't have the kernel-sources anymore as I've actually upgraded to
2.6.25.4. 



Buffer I/O error on device sda1, logical block 0
lost page write due to I/O error on sda1
scsi 1:0:0:0: Direct-Access     WD       5000AAKS Externa 106a PQ: 0
ANSI: 4
sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 11 00 00 00
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 11 00 00 00
sd 1:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1 sdb2 sdb3
 sd 1:0:0:0: [sdb] Attached SCSI disk
usb-storage: device scan complete
------------[ cut here ]------------
WARNING: at fs/buffer.c:1183 mark_buffer_dirty+0x20/0x6a()
Modules linked in: xt_state xt_tcpudp iptable_filter ip_tables x_tables
nf_nat_ftp nf_nat nf_conntrack_ipv4 nf_conntrack_ftp nf_conntrack ppdev
lp cpufreq_stats fuse sr_mod sbp2 sd_mod parport_pc parport
snd_intel8x0 snd_ac97_codec rtc ac97_bus snd_pcm_oss snd_mixer_oss
snd_pcm 8250_pci snd_timer 8250 serial_core snd_page_alloc rng_core
video output evdev ide_cd_mod cdrom ide_disk usb_storage usbhid
scsi_mod ohci1394 piix ieee1394 ide_core ehci_hcd uhci_hcd usbcore unix
[last unloaded: firmware_class]
Pid: 7364, comm: umount Not tainted 2.6.25.3summer #1
[<c011767f>] warn_on_slowpath+0x40/0x4f
[<c013c6d5>] generic_writepages+0x1a/0x21
[<c014dd56>] check_bytes_and_report+0x25/0x98
[<c014dd56>] check_bytes_and_report+0x25/0x98
[<c014e046>] check_object+0x114/0x19f
[<c0192fdf>] journal_destroy+0x11e/0x125
[<c014e561>] __slab_free+0x1be/0x1ed
[<c0192fdf>] journal_destroy+0x11e/0x125
[<c014eb91>] kfree+0x79/0x81
[<c0192fdf>] journal_destroy+0x11e/0x125
[<c0192fdf>] journal_destroy+0x11e/0x125
[<c0124ac8>] autoremove_wake_function+0x0/0x2d
[<c016a436>] ...
From: Christoph Lameter
Date: Friday, May 9, 2008 - 7:21 pm

Add the two methods needed for defragmentation and add the display of the
methods via the proc interface.

Add documentation explaining the use of these methods and the prototypes
for slab.h. Add functions to setup the defrag methods for a slab cache.

Add empty functions for SLAB/SLOB. The API is generic so it
could be theoretically implemented for either allocator.

Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>

---
 include/linux/slab.h     |   50 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/slub_def.h |    3 ++
 mm/slub.c                |   29 ++++++++++++++++++++++++++-
 3 files changed, 81 insertions(+), 1 deletion(-)

Index: linux-2.6/include/linux/slub_def.h
===================================================================
--- linux-2.6.orig/include/linux/slub_def.h	2008-07-31 12:19:28.000000000 -0500
+++ linux-2.6/include/linux/slub_def.h	2008-07-31 12:19:39.000000000 -0500
@@ -86,6 +86,9 @@
 	gfp_t allocflags;	/* gfp flags to use on each alloc */
 	int refcount;		/* Refcount for slab cache destroy */
 	void (*ctor)(void *);
+	kmem_defrag_get_func *get;
+	kmem_defrag_kick_func *kick;
+
 	int inuse;		/* Offset to metadata */
 	int align;		/* Alignment */
 	int defrag_ratio;	/*
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c	2008-07-31 12:19:28.000000000 -0500
+++ linux-2.6/mm/slub.c	2008-07-31 12:19:48.000000000 -0500
@@ -2736,6 +2736,19 @@
 }
 EXPORT_SYMBOL(kfree);
 
+void kmem_cache_setup_defrag(struct kmem_cache *s,
+	kmem_defrag_get_func get, kmem_defrag_kick_func kick)
+{
+	/*
+	 * Defragmentable slabs must have a ctor otherwise objects may be
+	 * in an undetermined state after they are allocated.
+	 */
+	BUG_ON(!s->ctor);
+	s->get = get;
+	s->kick = ...
Previous thread: [PATCH] Net: reorder udp_iter_state to remove padding on 64bit builds by Richard Kennedy on Thursday, June 5, 2008 - 3:33 am. (3 messages)

Next thread: [PATCH] x86: fix compile warning in io_apic_{32,64}.c by Andreas Herrmann on Thursday, June 5, 2008 - 5:05 am. (5 messages)