2006-03-15 19:38:10

by Tilman Schmidt

[permalink] [raw]
Subject: i810 framebuffer - BUG: sleeping function called from invalid context

Thought I'd finally report this, seeing it still around with 2.6.16-rc6-mm1.

With every 2.6.16-rc-mm version I can remember (sorry, no precise records)
my development machine (a Dell OptiPlex GX110, Intel P3/933, Intel chipset)
has been producing the following three BUG messages while booting:

<6>[ 36.528181] md: Autodetecting RAID arrays.
<3>[ 36.528263] BUG: sleeping function called from invalid context at mm/slab.c:2758
<4>[ 36.528270] in_atomic():1, irqs_disabled():1
<4>[ 36.528277] <c01503bb> kmem_cache_alloc+0x20/0x77 <c0259356> i810fb_cursor+0x1bd/0x2c9
<4>[ 36.528317] <c01a36ac> search_by_key+0x1a5/0xe04 <c020eec5> bit_cursor+0x467/0x48a
<4>[ 36.528357] <c020c25b> fbcon_cursor+0x226/0x25b <c020ea5e> bit_cursor+0x0/0x48a
<4>[ 36.528373] <c024db82> hide_cursor+0x1d/0x53 <c0251766> vt_console_print+0x8b/0x21e
<4>[ 36.528399] <c02516db> vt_console_print+0x0/0x21e <c0117a14> __call_console_drivers+0x34/0x40
<4>[ 36.528422] <c0117c14> release_console_sem+0xeb/0x185 <c011857a> vprintk+0x298/0x2d9
<4>[ 36.528439] <c0168e00> d_splice_alias+0xa5/0xe5 <c0191583> reiserfs_lookup+0xed/0xf8
<4>[ 36.528461] <c01185cd> printk+0x12/0x16 <c029f1bc> md_ioctl+0xc3/0x1289
<4>[ 36.528492] <c030c268> _spin_unlock+0xf/0x23 <c030c268> _spin_unlock+0xf/0x23
<4>[ 36.528525] <c0169453> inode_init_once+0x1a3/0x1cd <c01f2113> blkdev_driver_ioctl+0x49/0x59
<4>[ 36.528557] <c01f2824> blkdev_ioctl+0x6b6/0x6d6 <c030b84a> __mutex_lock_slowpath+0x2ca/0x39a
<4>[ 36.528576] <c012ac64> debug_mutex_add_waiter+0x14/0x24 <c015aa46> do_open+0x5b/0x32a
<4>[ 36.528607] <c030b84a> __mutex_lock_slowpath+0x2ca/0x39a <c015aa46> do_open+0x5b/0x32a
<4>[ 36.528622] <c030c268> _spin_unlock+0xf/0x23 <c030c34a> _read_unlock_irq+0x10/0x24
<4>[ 36.528638] <c0138721> find_get_page+0x35/0x3a <c0139e2f> filemap_nopage+0x1a1/0x31f
<4>[ 36.528655] <c030c268> _spin_unlock+0xf/0x23 <c01436bf> __handle_mm_fault+0x3e5/0x757
<4>[ 36.528688] <c015a361> block_ioctl+0x13/0x16 <c015a34e> block_ioctl+0x0/0x16
<4>[ 36.528701] <c0163510> do_ioctl+0x1c/0x5d <c01637a6> vfs_ioctl+0x255/0x268
<4>[ 36.528727] <c01637ff> sys_ioctl+0x46/0x5f <c0102b3b> sysenter_past_esp+0x54/0x75
<6>[ 36.682209] md: autorun ...
<6>[ 36.689499] md: ... autorun DONE.
<6>[ 40.081658] device-mapper: 4.5.0-ioctl (2005-10-04) initialised: [email protected]
<3>[ 40.081742] BUG: sleeping function called from invalid context at mm/slab.c:2758
<4>[ 40.081749] in_atomic():1, irqs_disabled():1
<4>[ 40.081756] <c01503bb> kmem_cache_alloc+0x20/0x77 <c0259356> i810fb_cursor+0x1bd/0x2c9
<4>[ 40.081802] <c020eec5> bit_cursor+0x467/0x48a <c0101d39> __switch_to+0x19/0x1b4
<4>[ 40.081835] <c020c25b> fbcon_cursor+0x226/0x25b <c020ea5e> bit_cursor+0x0/0x48a
<4>[ 40.081851] <c024db82> hide_cursor+0x1d/0x53 <c0251766> vt_console_print+0x8b/0x21e
<4>[ 40.081882] <c02516db> vt_console_print+0x0/0x21e <c0117a14> __call_console_drivers+0x34/0x40
<4>[ 40.081906] <c0117c14> release_console_sem+0xeb/0x185 <c011857a> vprintk+0x298/0x2d9
<4>[ 40.081925] <c0263c50> class_device_add+0x234/0x25b <c01185cd> printk+0x12/0x16
<4>[ 40.081956] <d885f196> dm_interface_init+0x51/0x58 [dm_mod] <d885f0d2> dm_init+0x12/0x39 [dm_mod]
<4>[ 40.082023] <c012e1d9> sys_init_module+0x1252/0x139e <c0102b3b> sysenter_past_esp+0x54/0x75
<6>[ 41.934599] NTFS driver 2.1.26 [Flags: R/W MODULE].
<3>[ 41.934682] BUG: sleeping function called from invalid context at mm/slab.c:2758
<4>[ 41.934689] in_atomic():1, irqs_disabled():1
<4>[ 41.934697] <c01503bb> kmem_cache_alloc+0x20/0x77 <c0259356> i810fb_cursor+0x1bd/0x2c9
<4>[ 41.934742] <c013cf66> __alloc_pages+0x2c0/0x2d2 <c020eec5> bit_cursor+0x467/0x48a
<4>[ 41.934783] <c030c268> _spin_unlock+0xf/0x23 <c020c25b> fbcon_cursor+0x226/0x25b
<4>[ 41.934816] <c020ea5e> bit_cursor+0x0/0x48a <c024db82> hide_cursor+0x1d/0x53
<4>[ 41.934845] <c0251766> vt_console_print+0x8b/0x21e <c02516db> vt_console_print+0x0/0x21e
<4>[ 41.934860] <c0117a14> __call_console_drivers+0x34/0x40 <c0117c14> release_console_sem+0xeb/0x185
<4>[ 41.934886] <c011857a> vprintk+0x298/0x2d9 <c013c46d> free_pages_bulk+0x27/0x234
<4>[ 41.934904] <c01185cd> printk+0x12/0x16 <d885f00b> init_ntfs_fs+0xb/0x1a1 [ntfs]
<4>[ 41.934941] <c012e1d9> sys_init_module+0x1252/0x139e <c0102b3b> sysenter_past_esp+0x54/0x75

At first glance, it looks to me like perhaps i810fb_cursor() shouldn't
kmalloc(~, GFP_KERNEL) at drivers/video/i810/i810_main.c:2216 if it may
be called with in_atomic() && irqs_disabled().

Apart from those messages, the system runs fine.

HTH
Tilman

--
Tilman Schmidt E-Mail: [email protected]
Bonn, Germany
In theory, there is no difference between theory and practice.
In practice, there is.



Attachments:
signature.asc (253.00 B)
OpenPGP digital signature

2006-03-17 11:17:04

by Andrew Morton

[permalink] [raw]
Subject: Re: i810 framebuffer - BUG: sleeping function called from invalid context

Tilman Schmidt <[email protected]> wrote:
>
> Thought I'd finally report this, seeing it still around with 2.6.16-rc6-mm1.
>
> With every 2.6.16-rc-mm version I can remember (sorry, no precise records)
> my development machine (a Dell OptiPlex GX110, Intel P3/933, Intel chipset)
> has been producing the following three BUG messages while booting:
>
> <6>[ 36.528181] md: Autodetecting RAID arrays.
> <3>[ 36.528263] BUG: sleeping function called from invalid context at mm/slab.c:2758
> <4>[ 36.528270] in_atomic():1, irqs_disabled():1
> <4>[ 36.528277] <c01503bb> kmem_cache_alloc+0x20/0x77 <c0259356> i810fb_cursor+0x1bd/0x2c9
> <4>[ 36.528317] <c01a36ac> search_by_key+0x1a5/0xe04 <c020eec5> bit_cursor+0x467/0x48a
> <4>[ 36.528357] <c020c25b> fbcon_cursor+0x226/0x25b <c020ea5e> bit_cursor+0x0/0x48a
> <4>[ 36.528373] <c024db82> hide_cursor+0x1d/0x53 <c0251766> vt_console_print+0x8b/0x21e
> <4>[ 36.528399] <c02516db> vt_console_print+0x0/0x21e <c0117a14> __call_console_drivers+0x34/0x40
> <4>[ 36.528422] <c0117c14> release_console_sem+0xeb/0x185 <c011857a> vprintk+0x298/0x2d9
> <4>[ 36.528439] <c0168e00> d_splice_alias+0xa5/0xe5 <c0191583> reiserfs_lookup+0xed/0xf8
> <4>[ 36.528461] <c01185cd> printk+0x12/0x16 <c029f1bc> md_ioctl+0xc3/0x1289
> <4>[ 36.528492] <c030c268> _spin_unlock+0xf/0x23 <c030c268> _spin_unlock+0xf/0x23
> <4>[ 36.528525] <c0169453> inode_init_once+0x1a3/0x1cd <c01f2113> blkdev_driver_ioctl+0x49/0x59
> <4>[ 36.528557] <c01f2824> blkdev_ioctl+0x6b6/0x6d6 <c030b84a> __mutex_lock_slowpath+0x2ca/0x39a
> <4>[ 36.528576] <c012ac64> debug_mutex_add_waiter+0x14/0x24 <c015aa46> do_open+0x5b/0x32a
> <4>[ 36.528607] <c030b84a> __mutex_lock_slowpath+0x2ca/0x39a <c015aa46> do_open+0x5b/0x32a
> <4>[ 36.528622] <c030c268> _spin_unlock+0xf/0x23 <c030c34a> _read_unlock_irq+0x10/0x24
> <4>[ 36.528638] <c0138721> find_get_page+0x35/0x3a <c0139e2f> filemap_nopage+0x1a1/0x31f
> <4>[ 36.528655] <c030c268> _spin_unlock+0xf/0x23 <c01436bf> __handle_mm_fault+0x3e5/0x757
> <4>[ 36.528688] <c015a361> block_ioctl+0x13/0x16 <c015a34e> block_ioctl+0x0/0x16
> <4>[ 36.528701] <c0163510> do_ioctl+0x1c/0x5d <c01637a6> vfs_ioctl+0x255/0x268
> <4>[ 36.528727] <c01637ff> sys_ioctl+0x46/0x5f <c0102b3b> sysenter_past_esp+0x54/0x75

Yes, thanks - i810fb_cursor is called on the printk() path and it's doing a
GFP_KERNEL memory allocation(!).

Tony, can you think which patch might have caused this? It's not
immediately obvious...

2006-03-17 14:51:12

by Antonino A. Daplas

[permalink] [raw]
Subject: Re: i810 framebuffer - BUG: sleeping function called from invalid context

The console cursor can be called in atomic context. Change memory
allocation to use the GFP_ATOMIC flag in i810fb_cursor().

Signed-off-by: Antonino Daplas <[email protected]>

---
Andrew Morton wrote:
> Tilman Schmidt <[email protected]> wrote:
>> Thought I'd finally report this, seeing it still around with 2.6.16-rc6-mm1.
>>
>> With every 2.6.16-rc-mm version I can remember (sorry, no precise records)
>> my development machine (a Dell OptiPlex GX110, Intel P3/933, Intel chipset)
>> has been producing the following three BUG messages while booting:
>>
>> <6>[ 36.528181] md: Autodetecting RAID arrays.
>> <3>[ 36.528263] BUG: sleeping function called from invalid context at mm/slab.c:2758
>> <4>[ 36.528270] in_atomic():1, irqs_disabled():

This one, most probably.

Tony

i810_main.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)


diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index d8467c0..788297e 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -1508,7 +1508,7 @@ static int i810fb_cursor(struct fb_info
int size = ((cursor->image.width + 7) >> 3) *
cursor->image.height;
int i;
- u8 *data = kmalloc(64 * 8, GFP_KERNEL);
+ u8 *data = kmalloc(64 * 8, GFP_ATOMIC);

if (data == NULL)
return -ENOMEM;

2006-03-18 11:30:50

by Tilman Schmidt

[permalink] [raw]
Subject: Re: i810 framebuffer - BUG: sleeping function called from invalid context

On 17.03.2006 15:51, Antonino A. Daplas wrote:
> The console cursor can be called in atomic context. Change memory
> allocation to use the GFP_ATOMIC flag in i810fb_cursor().

Thanks, that fixed it.

--
Tilman Schmidt E-Mail: [email protected]
Bonn, Germany
It is well known that a vital ingredient of success is not knowing
that what you're attempting can't be done. (Terry Pratchett)


Attachments:
signature.asc (253.00 B)
OpenPGP digital signature

2006-03-24 15:08:38

by Adrian Bunk

[permalink] [raw]
Subject: Re: i810 framebuffer - BUG: sleeping function called from invalid context

On Sat, Mar 18, 2006 at 12:31:09PM +0100, Tilman Schmidt wrote:
> On 17.03.2006 15:51, Antonino A. Daplas wrote:
> > The console cursor can be called in atomic context. Change memory
> > allocation to use the GFP_ATOMIC flag in i810fb_cursor().
>
> Thanks, that fixed it.

Tony, this seems to be 2.6.16.1 material?
If yes, can you submit it for -stable?

TIA
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-03-24 19:07:15

by Andrew Morton

[permalink] [raw]
Subject: Re: i810 framebuffer - BUG: sleeping function called from invalid context

Adrian Bunk <[email protected]> wrote:
>
> On Sat, Mar 18, 2006 at 12:31:09PM +0100, Tilman Schmidt wrote:
> > On 17.03.2006 15:51, Antonino A. Daplas wrote:
> > > The console cursor can be called in atomic context. Change memory
> > > allocation to use the GFP_ATOMIC flag in i810fb_cursor().
> >
> > Thanks, that fixed it.
>
> Tony, this seems to be 2.6.16.1 material?
> If yes, can you submit it for -stable?
>

I did that.