Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-6

From: Steven Rostedt
Date: Wed Dec 08 2004 - 17:15:19 EST


On Wed, 2004-12-08 at 21:39 +0000, Rui Nuno Capela wrote:
>
> Almost there, perhaps not...
>
> It doesn't solve the problem completely, if not at all. What was kind of a
> deterministic failure now seems probabilistic: the fault still occur on
> unplugging the usb-storage stick, but not everytime as before.
>

OK, so I would say that this is part of a fix, but there are others.
There are lots of changes done to the slab.c file by Ingo. The change I
made (and that is just a quick patch, it needs real work), was only in a
place that was obvious that there could be problems.

Are you running an SMP machine? If so, than the patch I gave you is
definitely not enough.

Ingo really scares me with all the removing of local_irq_disables in the
rt mode. I'm not sure exactly what is going on there, and why they can,
or should be removed. Ingo?

> Did try several times, reboot included, and now it fails after unplugging
> a second or a third time. Never needed to replug/unplug more than 3 times
> for it to show up, however.
>
> Here is one sample, taken on the patched RT-V0.7.32-9:
>
> usb 4-5: USB disconnect, address 7
> slab error in kmem_cache_destroy(): cache `scsi_cmd_cache': Can't free
> all objects
> [<c010361f>] dump_stack+0x23/0x25 (20)
> [<c014669f>] kmem_cache_destroy+0x103/0x1aa (28)
> [<c026e61a>] scsi_destroy_command_freelist+0x97/0xa8 (28)
> [<c026f451>] scsi_host_dev_release+0x37/0xe1 (104)
> [<c023c569>] device_release+0x7a/0x7c (32)
> [<c01efc50>] kobject_cleanup+0x87/0x89 (28)
> [<c01f06ab>] kref_put+0x52/0xef (40)
> [<c01efc8c>] kobject_put+0x25/0x27 (16)
> [<f8cf1843>] usb_stor_release_resources+0x66/0xca [usb_storage] (16)
> [<f8cf1d93>] storage_disconnect+0x8e/0x9b [usb_storage] (16)
> [<f89ca117>] usb_unbind_interface+0x84/0x86 [usbcore] (28)
> [<c023d7d5>] device_release_driver+0x75/0x77 (28)
> [<c023d9d8>] bus_remove_device+0x53/0x82 (20)
> [<c023c9a1>] device_del+0x4b/0x9b (20)
> [<f89d142a>] usb_disable_device+0xf5/0x10a [usbcore] (28)
> [<f89cc61c>] usb_disconnect+0xc8/0x164 [usbcore] (40)
> [<f89cd77e>] hub_port_connect_change+0x2ef/0x426 [usbcore] (56)
> [<f89cda7b>] hub_events+0x1c6/0x39d [usbcore] (56)
> [<f89cdc89>] hub_thread+0x37/0x109 [usbcore] (96)
> [<c01009b1>] kernel_thread_helper+0x5/0xb (150118420)
>

Unfortunately this really doesn't help. The problem occurs earlier than
this. What happened was that there are still slabs out there that need
to be freed that were postponed to a later time and not done with the
kmem_cache_free call. So this dump only tells you that. The backtrace
unfortunately doesn't give us any more clues. It's all in the slab.c
code.
(Of course if the driver really did not free the objects then it's not
slab.c's fault, and why Ingo may not have thought it was related to RT)

Tschuess,

-- Steve

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