[PATCH] UGLY DEBUGING

From: Jerome Glisse
Date: Fri Dec 02 2011 - 17:50:02 EST


WARNING: at mm/slub.c:3357, kernel BUG at mm/slub.c:3413
---
drivers/gpu/drm/drm_crtc.c | 2 ++
drivers/gpu/drm/drm_pci.c | 2 ++
drivers/gpu/drm/drm_platform.c | 2 ++
lib/idr.c | 6 +++++-
mm/slab.c | 2 +-
5 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 8323fc3..a1a0a69 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -242,6 +242,7 @@ again:

obj->id = new_id;
obj->type = obj_type;
+DRM_INFO("allocating idr %p %d idr %d\n", obj, obj_type, new_id);
return 0;
}

@@ -259,6 +260,7 @@ static void drm_mode_object_put(struct drm_device *dev,
struct drm_mode_object *object)
{
mutex_lock(&dev->mode_config.idr_mutex);
+DRM_INFO("remove idr %p %d idr %d\n", object, object->type, object->id);
idr_remove(&dev->mode_config.crtc_idr, object->id);
mutex_unlock(&dev->mode_config.idr_mutex);
}
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index d4d10b7..7932ebb 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -345,11 +345,13 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,

if (drm_core_check_feature(dev, DRIVER_MODESET)) {
pci_set_drvdata(pdev, dev);
+printk(KERN_INFO "%s %d\n", __func__, __LINE__);
ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL);
if (ret)
goto err_g2;
}

+printk(KERN_INFO "%s %d\n", __func__, __LINE__);
if ((ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY)))
goto err_g3;

diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index ae9db5e..3e7e401 100644
--- a/drivers/gpu/drm/drm_platform.c
+++ b/drivers/gpu/drm/drm_platform.c
@@ -65,11 +65,13 @@ int drm_get_platform_dev(struct platform_device *platdev,

if (drm_core_check_feature(dev, DRIVER_MODESET)) {
dev_set_drvdata(&platdev->dev, dev);
+printk(KERN_INFO "%s %d\n", __func__, __LINE__);
ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL);
if (ret)
goto err_g1;
}

+printk(KERN_INFO "%s %d\n", __func__, __LINE__);
ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY);
if (ret)
goto err_g2;
diff --git a/lib/idr.c b/lib/idr.c
index ed055b2..22c3ec6 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -427,6 +427,7 @@ void idr_remove(struct idr *idp, int id)
* layers that fall into the freelist are those that have been
* preallocated.
*/
+printk(KERN_INFO "%s free idr %p\n", __func__, p);
kmem_cache_free(idr_layer_cache, p);
}
return;
@@ -489,6 +490,7 @@ void idr_destroy(struct idr *idp)
{
while (idp->id_free_cnt) {
struct idr_layer *p = get_from_free_list(idp);
+printk(KERN_INFO "%s free idr %p\n", __func__, p);
kmem_cache_free(idr_layer_cache, p);
}
}
@@ -841,8 +843,10 @@ int ida_get_new_above(struct ida *ida, int starting_id, int *p_id)
*/
if (ida->idr.id_free_cnt || ida->free_bitmap) {
struct idr_layer *p = get_from_free_list(&ida->idr);
- if (p)
+ if (p) {
+printk(KERN_INFO "%s free idr %p\n", __func__, p);
kmem_cache_free(idr_layer_cache, p);
+ }
}

return 0;
diff --git a/mm/slab.c b/mm/slab.c
index 708efe8..83864f9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1926,7 +1926,7 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp)
/* Mismatch ! */
/* Print header */
if (lines == 0) {
- printk(KERN_ERR
+ WARN(1,
"Slab corruption: %s start=%p, len=%d\n",
cachep->name, realobj, size);
print_objinfo(cachep, objp, 0);
--
1.7.7.1


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