2002-10-08 15:39:29

by Martin J. Bligh

[permalink] [raw]
Subject: might_sleep warning in both 41 and 41-mm1

This one still happens in both 41 and 41-mm1. I'd mentioned
it before, and was told it was fixed in a later kernel, but
still seems to be there.

Debug: sleeping function called from illegal context at mm/page_alloc.c:512
Call Trace:
[<c0115fb3>] __might_sleep+0x43/0x47
[<c0134efc>] __alloc_pages+0x24/0x260
[<c0112638>] pte_alloc_one+0x38/0xfc
[<c01279cd>] pte_alloc_map+0x2d/0x1b0
[<c012f6cc>] move_one_page+0x11c/0x2d8
[<c012f794>] move_one_page+0x1e4/0x2d8
[<c012f8b7>] move_page_tables+0x2f/0x74
[<c012fe4d>] do_mremap+0x551/0x6dc
[<c013002b>] sys_mremap+0x53/0x74
[<c0106ff7>] syscall_call+0x7/0xb


2002-10-08 17:17:20

by Andrew Morton

[permalink] [raw]
Subject: Re: might_sleep warning in both 41 and 41-mm1

"Martin J. Bligh" wrote:
>
> This one still happens in both 41 and 41-mm1. I'd mentioned
> it before, and was told it was fixed in a later kernel, but
> still seems to be there.
>
> Debug: sleeping function called from illegal context at mm/page_alloc.c:512
> Call Trace:
> [<c0115fb3>] __might_sleep+0x43/0x47
> [<c0134efc>] __alloc_pages+0x24/0x260
> [<c0112638>] pte_alloc_one+0x38/0xfc
> [<c01279cd>] pte_alloc_map+0x2d/0x1b0
> [<c012f6cc>] move_one_page+0x11c/0x2d8
> [<c012f794>] move_one_page+0x1e4/0x2d8
> [<c012f8b7>] move_page_tables+0x2f/0x74
> [<c012fe4d>] do_mremap+0x551/0x6dc
> [<c013002b>] sys_mremap+0x53/0x74
> [<c0106ff7>] syscall_call+0x7/0xb
>

Oh. It seems that the pte mapping functions will run inc_preempt_count()
via kmap_atomic() even if CONFIG_HIGHPTE=n. So the ifdef around
page_table_present() needs to be CONFIG_HIGHMEM. Or we don't use
kmap_atomic() at all in the pte mapping functions.

Please tell me that you had CONFIG_HIGHPTE=n?

2002-10-08 17:36:48

by Martin J. Bligh

[permalink] [raw]
Subject: Re: might_sleep warning in both 41 and 41-mm1

> Oh. It seems that the pte mapping functions will run inc_preempt_count()
> via kmap_atomic() even if CONFIG_HIGHPTE=n. So the ifdef around
> page_table_present() needs to be CONFIG_HIGHMEM. Or we don't use
> kmap_atomic() at all in the pte mapping functions.
>
> Please tell me that you had CONFIG_HIGHPTE=n?

Yes. Highpte was off.

Thanks ;-)

M.