Re: Badness at include/linux/slub_def.h

2007-05-28 Thread Christian Kujau

Michel Dänzer wrote:

Does the patch below against the drm tree fix it? Only build tested.


yes, now glxinfo/glxgears returns without this badness, DRI is still
working fine. I've attached some details.

Thank you!
Christian.


---

From f0e6bdc165cb484b8992b14172a7280f301bf513 Mon Sep 17 00:00:00 2001

From: =?utf-8?q?Michel_D=C3=A4nzer?= <[EMAIL PROTECTED]>
Date: Fri, 25 May 2007 11:02:05 +0200
Subject: Make sure the drawable code doesn't call malloc(0).

config_2.6.22-rc2-git7.gz
Description: GNU Zip compressed data
[0.00] Using PowerMac machine description
[0.00] Total memory = 768MB; using 2048kB for hash table (at cfe0)
[0.00] Linux version 2.6.22-rc2-git7 ([EMAIL PROTECTED]) (gcc version 
4.1.2 (Ubuntu 4.1.2-0ubuntu4)) #1 PREEMPT Mon May 28 14:09:13 CEST 2007
[0.00] Found UniNorth memory controller & host bridge @ 0xf800 
revision: 0xd2
[0.00] Mapped at 0xfdfc
[0.00] Found a Intrepid mac-io controller, rev: 0, mapped at 0xfdf4
[0.00] Processor NAP mode on idle enabled.
[0.00] PowerMac motherboard: iBook G4
[0.00] via-pmu: Server Mode is disabled
[0.00] PMU driver v2 initialized for Core99, firmware: 0c
[0.00] Entering add_active_range(0, 0, 196608) 0 entries of 256 used
[0.00] Found UniNorth PCI host bridge at 0xf000. Firmware 
bus number: 0->0
[0.00] Found UniNorth PCI host bridge at 0xf200. Firmware 
bus number: 0->0
[0.00] Found UniNorth PCI host bridge at 0xf400. Firmware 
bus number: 0->0
[0.00] nvram: Checking bank 0...
[0.00] nvram: gen0=330, gen1=329
[0.00] nvram: Active bank is: 0
[0.00] nvram: OF partition at 0x410
[0.00] nvram: XP partition at 0x1020
[0.00] nvram: NR partition at 0x1120
[0.00] Top of RAM: 0x3000, Total RAM: 0x3000
[0.00] Memory hole size: 0MB
[0.00] Zone PFN ranges:
[0.00]   DMA 0 ->   196608
[0.00]   Normal 196608 ->   196608
[0.00] early_node_map[1] active PFN ranges
[0.00] 0:0 ->   196608
[0.00] On node 0 totalpages: 196608
[0.00]   DMA zone: 1536 pages used for memmap
[0.00]   DMA zone: 0 pages reserved
[0.00]   DMA zone: 195072 pages, LIFO batch:31
[0.00]   Normal zone: 0 pages used for memmap
[0.00] Built 1 zonelists.  Total pages: 195072
[0.00] Kernel command line: root=/dev/hda6 ro panic=10 [EMAIL 
PROTECTED]/eth0,[EMAIL PROTECTED]/00:11:09:EA:13:63 
[0.00] netconsole: local port 6665
[0.00] netconsole: local IP 192.168.10.29
[0.00] netconsole: interface eth0
[0.00] netconsole: remote port 
[0.00] netconsole: remote IP 192.168.10.10
[0.00] netconsole: remote ethernet address 00:11:09:ea:13:63
[0.00] mpic: Setting up MPIC " MPIC 1   " version 1.2 at 8004, max 
4 CPUs
[0.00] mpic: ISU size: 64, shift: 6, mask: 3f
[0.00] mpic: Initializing for 64 sources
[0.00] PID hash table entries: 4096 (order: 12, 16384 bytes)
[0.00] GMT Delta read from XPRAM: 0 minutes, DST: off
[0.00] time_init: decrementer frequency = 18.432000 MHz
[0.00] time_init: processor frequency   = 1199.97 MHz
[   20.112686] Console: colour dummy device 80x25
[   20.113127] console handover: boot [udbg0] -> real [tty0]
[   20.113613] 
[   20.113624] | Locking API testsuite:
[   20.113632] 

[   20.113645]  | spin |wlock |rlock |mutex | 
wsem | rsem |
[   20.113658]   
--
[   20.113676]  A-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113723]  A-B-B-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113767]  A-B-B-C-C-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113809]  A-B-C-A-B-C deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113853]  A-B-B-C-C-D-D-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113899]  A-B-C-D-B-D-D-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113945]  A-B-C-D-B-C-D-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113991] double unlock:  ok  |  ok  |failed|  ok  
|failed|failed|
[   20.114030]   initialize 
held:failed|failed|failed|failed|failed|failed|
[   20.114077]  bad unlock order:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   20.114124]   
--
[   20.114147]   recursive read-lock: |  ok  |  
   |failed|
[   20.114181]recursive read-lock #2: |  ok  

Re: Badness at include/linux/slub_def.h

2007-05-28 Thread Christian Kujau

Michel Dänzer wrote:

Does the patch below against the drm tree fix it? Only build tested.


yes, now glxinfo/glxgears returns without this badness, DRI is still
working fine. I've attached some details.

Thank you!
Christian.


---

From f0e6bdc165cb484b8992b14172a7280f301bf513 Mon Sep 17 00:00:00 2001

From: =?utf-8?q?Michel_D=C3=A4nzer?= [EMAIL PROTECTED]
Date: Fri, 25 May 2007 11:02:05 +0200
Subject: Make sure the drawable code doesn't call malloc(0).

config_2.6.22-rc2-git7.gz
Description: GNU Zip compressed data
[0.00] Using PowerMac machine description
[0.00] Total memory = 768MB; using 2048kB for hash table (at cfe0)
[0.00] Linux version 2.6.22-rc2-git7 ([EMAIL PROTECTED]) (gcc version 
4.1.2 (Ubuntu 4.1.2-0ubuntu4)) #1 PREEMPT Mon May 28 14:09:13 CEST 2007
[0.00] Found UniNorth memory controller  host bridge @ 0xf800 
revision: 0xd2
[0.00] Mapped at 0xfdfc
[0.00] Found a Intrepid mac-io controller, rev: 0, mapped at 0xfdf4
[0.00] Processor NAP mode on idle enabled.
[0.00] PowerMac motherboard: iBook G4
[0.00] via-pmu: Server Mode is disabled
[0.00] PMU driver v2 initialized for Core99, firmware: 0c
[0.00] Entering add_active_range(0, 0, 196608) 0 entries of 256 used
[0.00] Found UniNorth PCI host bridge at 0xf000. Firmware 
bus number: 0-0
[0.00] Found UniNorth PCI host bridge at 0xf200. Firmware 
bus number: 0-0
[0.00] Found UniNorth PCI host bridge at 0xf400. Firmware 
bus number: 0-0
[0.00] nvram: Checking bank 0...
[0.00] nvram: gen0=330, gen1=329
[0.00] nvram: Active bank is: 0
[0.00] nvram: OF partition at 0x410
[0.00] nvram: XP partition at 0x1020
[0.00] nvram: NR partition at 0x1120
[0.00] Top of RAM: 0x3000, Total RAM: 0x3000
[0.00] Memory hole size: 0MB
[0.00] Zone PFN ranges:
[0.00]   DMA 0 -   196608
[0.00]   Normal 196608 -   196608
[0.00] early_node_map[1] active PFN ranges
[0.00] 0:0 -   196608
[0.00] On node 0 totalpages: 196608
[0.00]   DMA zone: 1536 pages used for memmap
[0.00]   DMA zone: 0 pages reserved
[0.00]   DMA zone: 195072 pages, LIFO batch:31
[0.00]   Normal zone: 0 pages used for memmap
[0.00] Built 1 zonelists.  Total pages: 195072
[0.00] Kernel command line: root=/dev/hda6 ro panic=10 [EMAIL 
PROTECTED]/eth0,[EMAIL PROTECTED]/00:11:09:EA:13:63 
[0.00] netconsole: local port 6665
[0.00] netconsole: local IP 192.168.10.29
[0.00] netconsole: interface eth0
[0.00] netconsole: remote port 
[0.00] netconsole: remote IP 192.168.10.10
[0.00] netconsole: remote ethernet address 00:11:09:ea:13:63
[0.00] mpic: Setting up MPIC  MPIC 1version 1.2 at 8004, max 
4 CPUs
[0.00] mpic: ISU size: 64, shift: 6, mask: 3f
[0.00] mpic: Initializing for 64 sources
[0.00] PID hash table entries: 4096 (order: 12, 16384 bytes)
[0.00] GMT Delta read from XPRAM: 0 minutes, DST: off
[0.00] time_init: decrementer frequency = 18.432000 MHz
[0.00] time_init: processor frequency   = 1199.97 MHz
[   20.112686] Console: colour dummy device 80x25
[   20.113127] console handover: boot [udbg0] - real [tty0]
[   20.113613] 
[   20.113624] | Locking API testsuite:
[   20.113632] 

[   20.113645]  | spin |wlock |rlock |mutex | 
wsem | rsem |
[   20.113658]   
--
[   20.113676]  A-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113723]  A-B-B-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113767]  A-B-B-C-C-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113809]  A-B-C-A-B-C deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113853]  A-B-B-C-C-D-D-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113899]  A-B-C-D-B-D-D-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113945]  A-B-C-D-B-C-D-A deadlock:failed|failed|  ok  
|failed|failed|failed|
[   20.113991] double unlock:  ok  |  ok  |failed|  ok  
|failed|failed|
[   20.114030]   initialize 
held:failed|failed|failed|failed|failed|failed|
[   20.114077]  bad unlock order:  ok  |  ok  |  ok  |  ok  |  
ok  |  ok  |
[   20.114124]   
--
[   20.114147]   recursive read-lock: |  ok  |  
   |failed|
[   20.114181]recursive read-lock #2: |  ok  |  

Re: Badness at include/linux/slub_def.h

2007-05-25 Thread Michel Dänzer
On Sun, 2007-05-20 at 23:10 +0100, Christian Kujau wrote:
> 
> [41653.487050] Badness at include/linux/slub_def.h:77
> [41653.487060] Call Trace:
> [41653.487068] [ecafbcb0] [c0008d00] show_stack+0x3c/0x194 (unreliable)
> [41653.487097] [ecafbce0] [c01426d4] report_bug+0x84/0xf4
> [41653.487116] [ecafbcf0] [c0010280] program_check_exception+0xbc/0x530
> [41653.487137] [ecafbd20] [c0011f8c] ret_from_except_full+0x0/0x4c
> [41653.487154] --- Exception: 700 at get_slab+0x248/0x260
> [41653.487168] LR = __kmalloc+0x1c/0x9c
> [41653.487176] [ecafbde0] [101dfbc8] 0x101dfbc8 (unreliable)
> [41653.487213] [ecafbe10] [c0080398] __kmalloc+0x1c/0x9c
> [41653.487227] [ecafbe30] [c01c2150] drm_rmdraw+0x26c/0x29c
> [41653.487243] [ecafbe80] [c01c2b74] drm_ioctl+0xe0/0x250
> [41653.487257] [ecafbeb0] [c00924a0] do_ioctl+0x9c/0xa8
> [41653.487273] [ecafbed0] [c0092530] vfs_ioctl+0x84/0x490
> [41653.487287] [ecafbf10] [c009297c] sys_ioctl+0x40/0x74
> [41653.487301] [ecafbf40] [c0011930] ret_from_syscall+0x0/0x38
> [41653.487315] --- Exception: c01 at 0xfd132a8
> [41653.487327] LR = 0xfd13240

Does the patch below against the drm tree fix it? Only build tested.

---
>From f0e6bdc165cb484b8992b14172a7280f301bf513 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Michel_D=C3=A4nzer?= <[EMAIL PROTECTED]>
Date: Fri, 25 May 2007 11:02:05 +0200
Subject: Make sure the drawable code doesn't call malloc(0).


Signed-off-by: Michel Dänzer <[EMAIL PROTECTED]>
---
 linux-core/drm_drawable.c |   41 ++---
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/linux-core/drm_drawable.c b/linux-core/drm_drawable.c
index 0817e32..b540a0e 100644
--- a/linux-core/drm_drawable.c
+++ b/linux-core/drm_drawable.c
@@ -172,38 +172,49 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
 
bitfield_length = idx + 1;
 
-   if (idx != id / (8 * sizeof(*bitfield)))
-   bitfield = drm_alloc(bitfield_length *
-sizeof(*bitfield), DRM_MEM_BUFS);
+   bitfield = NULL;
 
-   if (!bitfield && bitfield_length) {
-   bitfield = dev->drw_bitfield;
-   bitfield_length = dev->drw_bitfield_length;
+   if (bitfield_length) {
+   if (bitfield_length != dev->drw_bitfield_length)
+   bitfield = drm_alloc(bitfield_length *
+sizeof(*bitfield),
+DRM_MEM_BUFS);
+
+   if (!bitfield) {
+   bitfield = dev->drw_bitfield;
+   bitfield_length = dev->drw_bitfield_length;
+   }
}
}
 
if (bitfield != dev->drw_bitfield) {
info_length = 8 * sizeof(*bitfield) * bitfield_length;
 
-   info = drm_alloc(info_length * sizeof(*info), DRM_MEM_BUFS);
+   if (info_length) {
+   info = drm_alloc(info_length * sizeof(*info),
+DRM_MEM_BUFS);
 
-   if (!info && info_length) {
-   info = dev->drw_info;
-   info_length = dev->drw_info_length;
-   }
+   if (!info) {
+   info = dev->drw_info;
+   info_length = dev->drw_info_length;
+   }
+   } else
+   info = NULL;
 
spin_lock_irqsave(>drw_lock, irqflags);
 
-   memcpy(bitfield, dev->drw_bitfield, bitfield_length *
-  sizeof(*bitfield));
+   if (bitfield)
+   memcpy(bitfield, dev->drw_bitfield, bitfield_length *
+  sizeof(*bitfield));
drm_free(dev->drw_bitfield, sizeof(*bitfield) *
 dev->drw_bitfield_length, DRM_MEM_BUFS);
dev->drw_bitfield = bitfield;
dev->drw_bitfield_length = bitfield_length;
 
if (info != dev->drw_info) {
-   memcpy(info, dev->drw_info, info_length *
-  sizeof(*info));
+   if (info)
+   memcpy(info, dev->drw_info, info_length *
+  sizeof(*info));
drm_free(dev->drw_info, sizeof(*info) *
 dev->drw_info_length, DRM_MEM_BUFS);
dev->drw_info = info;
-- 
1.5.2-rc3.GIT





-- 
Earthling Michel Dänzer   |  http://tungstengraphics.com
Libre software enthusiast |  Debian, X and DRI developer

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  

Re: Badness at include/linux/slub_def.h

2007-05-25 Thread Michel Dänzer
On Sun, 2007-05-20 at 23:10 +0100, Christian Kujau wrote:
 
 [41653.487050] Badness at include/linux/slub_def.h:77
 [41653.487060] Call Trace:
 [41653.487068] [ecafbcb0] [c0008d00] show_stack+0x3c/0x194 (unreliable)
 [41653.487097] [ecafbce0] [c01426d4] report_bug+0x84/0xf4
 [41653.487116] [ecafbcf0] [c0010280] program_check_exception+0xbc/0x530
 [41653.487137] [ecafbd20] [c0011f8c] ret_from_except_full+0x0/0x4c
 [41653.487154] --- Exception: 700 at get_slab+0x248/0x260
 [41653.487168] LR = __kmalloc+0x1c/0x9c
 [41653.487176] [ecafbde0] [101dfbc8] 0x101dfbc8 (unreliable)
 [41653.487213] [ecafbe10] [c0080398] __kmalloc+0x1c/0x9c
 [41653.487227] [ecafbe30] [c01c2150] drm_rmdraw+0x26c/0x29c
 [41653.487243] [ecafbe80] [c01c2b74] drm_ioctl+0xe0/0x250
 [41653.487257] [ecafbeb0] [c00924a0] do_ioctl+0x9c/0xa8
 [41653.487273] [ecafbed0] [c0092530] vfs_ioctl+0x84/0x490
 [41653.487287] [ecafbf10] [c009297c] sys_ioctl+0x40/0x74
 [41653.487301] [ecafbf40] [c0011930] ret_from_syscall+0x0/0x38
 [41653.487315] --- Exception: c01 at 0xfd132a8
 [41653.487327] LR = 0xfd13240

Does the patch below against the drm tree fix it? Only build tested.

---
From f0e6bdc165cb484b8992b14172a7280f301bf513 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Michel_D=C3=A4nzer?= [EMAIL PROTECTED]
Date: Fri, 25 May 2007 11:02:05 +0200
Subject: Make sure the drawable code doesn't call malloc(0).


Signed-off-by: Michel Dänzer [EMAIL PROTECTED]
---
 linux-core/drm_drawable.c |   41 ++---
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/linux-core/drm_drawable.c b/linux-core/drm_drawable.c
index 0817e32..b540a0e 100644
--- a/linux-core/drm_drawable.c
+++ b/linux-core/drm_drawable.c
@@ -172,38 +172,49 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
 
bitfield_length = idx + 1;
 
-   if (idx != id / (8 * sizeof(*bitfield)))
-   bitfield = drm_alloc(bitfield_length *
-sizeof(*bitfield), DRM_MEM_BUFS);
+   bitfield = NULL;
 
-   if (!bitfield  bitfield_length) {
-   bitfield = dev-drw_bitfield;
-   bitfield_length = dev-drw_bitfield_length;
+   if (bitfield_length) {
+   if (bitfield_length != dev-drw_bitfield_length)
+   bitfield = drm_alloc(bitfield_length *
+sizeof(*bitfield),
+DRM_MEM_BUFS);
+
+   if (!bitfield) {
+   bitfield = dev-drw_bitfield;
+   bitfield_length = dev-drw_bitfield_length;
+   }
}
}
 
if (bitfield != dev-drw_bitfield) {
info_length = 8 * sizeof(*bitfield) * bitfield_length;
 
-   info = drm_alloc(info_length * sizeof(*info), DRM_MEM_BUFS);
+   if (info_length) {
+   info = drm_alloc(info_length * sizeof(*info),
+DRM_MEM_BUFS);
 
-   if (!info  info_length) {
-   info = dev-drw_info;
-   info_length = dev-drw_info_length;
-   }
+   if (!info) {
+   info = dev-drw_info;
+   info_length = dev-drw_info_length;
+   }
+   } else
+   info = NULL;
 
spin_lock_irqsave(dev-drw_lock, irqflags);
 
-   memcpy(bitfield, dev-drw_bitfield, bitfield_length *
-  sizeof(*bitfield));
+   if (bitfield)
+   memcpy(bitfield, dev-drw_bitfield, bitfield_length *
+  sizeof(*bitfield));
drm_free(dev-drw_bitfield, sizeof(*bitfield) *
 dev-drw_bitfield_length, DRM_MEM_BUFS);
dev-drw_bitfield = bitfield;
dev-drw_bitfield_length = bitfield_length;
 
if (info != dev-drw_info) {
-   memcpy(info, dev-drw_info, info_length *
-  sizeof(*info));
+   if (info)
+   memcpy(info, dev-drw_info, info_length *
+  sizeof(*info));
drm_free(dev-drw_info, sizeof(*info) *
 dev-drw_info_length, DRM_MEM_BUFS);
dev-drw_info = info;
-- 
1.5.2-rc3.GIT





-- 
Earthling Michel Dänzer   |  http://tungstengraphics.com
Libre software enthusiast |  Debian, X and DRI developer

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  

Re: Badness at include/linux/slub_def.h

2007-05-20 Thread Benjamin Herrenschmidt
On Sun, 2007-05-20 at 23:10 +0100, Christian Kujau wrote:
> hi there,
> 
> yet another[0] badness, again from this very iBook running vanilla 
> 2.6.22-rc1-git8:

Just another kmalloc(0)... report this one to the DRI folks, it's not
powerpc specific.

Cheers,
Ben.


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


Re: Badness at include/linux/slub_def.h

2007-05-20 Thread Benjamin Herrenschmidt
On Sun, 2007-05-20 at 23:10 +0100, Christian Kujau wrote:
 hi there,
 
 yet another[0] badness, again from this very iBook running vanilla 
 2.6.22-rc1-git8:

Just another kmalloc(0)... report this one to the DRI folks, it's not
powerpc specific.

Cheers,
Ben.


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