All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [COW-BUG] __alloc_pages called from atomic context
@ 2007-08-07 13:06 Jan Kiszka
  2007-08-07 13:19 ` [Xenomai-core] [Adeos-main] " Gilles Chanteperdrix
       [not found] ` <46B86FE4.3040209@domain.hid>
  0 siblings, 2 replies; 17+ messages in thread
From: Jan Kiszka @ 2007-08-07 13:06 UTC (permalink / raw)
  To: Philippe Gerum, Gilles Chanteperdrix; +Cc: adeos-main, xenomai-core

[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]

Hi all,

we are getting a lot of

BUG: sleeping function called from invalid context at mm/page_alloc.c:1225
in_atomic():1, irqs_disabled():0
 [<c010305d>] show_trace_log_lvl+0x1a/0x2f
 [<c0103156>] show_trace+0x12/0x14
 [<c0103915>] dump_stack+0x16/0x18
 [<c010c4ab>] __might_sleep+0xcd/0xd3
 [<c0149488>] __alloc_pages+0x32/0x281
 [<c014fdd2>] copy_page_range+0x221/0x41e
 [<c010ec18>] copy_process+0x9e1/0xfe2
 [<c010f415>] do_fork+0x99/0x176
 [<c0100e75>] sys_clone+0x33/0x39
 [<c0102aaf>] syscall_call+0x7/0xb
 =======================

here due to a Xenomai program issuing system() calls.

After once again dissecting the "nice" mm code (sigh...), the reason
turned out to be plain simple:

copy_pte_range(...);
  spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
  copy_one_pte(...);
    if (is_cow_mapping(vm_flags))
      alloc_page_vma(GFP_HIGHUSER, ...);
        __alloc_pages(...)
	  might_sleep_if(gfp_mask & __GFP_WAIT);

And this is true due to #define GFP_HIGHUSER (__GFP_WAIT | ...

So the bad news is that the COW code in likely all i-pipe versions is
broken. But the good new is that this might be easily fixable by
providing the right gfp_mask. GFP_ATOMIC?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-08-08 12:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07 13:06 [Xenomai-core] [COW-BUG] __alloc_pages called from atomic context Jan Kiszka
2007-08-07 13:19 ` [Xenomai-core] [Adeos-main] " Gilles Chanteperdrix
     [not found] ` <46B86FE4.3040209@domain.hid>
2007-08-07 14:02   ` [Xenomai-core] " Jan Kiszka
2007-08-07 14:11     ` [Xenomai-core] [Adeos-main] " Gilles Chanteperdrix
2007-08-07 14:20       ` Jan Kiszka
2007-08-07 14:24         ` Gilles Chanteperdrix
2007-08-07 14:46           ` Jan Kiszka
2007-08-07 14:56             ` Gilles Chanteperdrix
2007-08-07 14:59               ` Jan Kiszka
2007-08-07 15:09                 ` Gilles Chanteperdrix
2007-08-07 16:55                   ` Philippe Gerum
2007-08-07 17:01                     ` Jan Kiszka
2007-08-07 17:32                       ` Jan Kiszka
2007-08-08  7:28                         ` Gilles Chanteperdrix
2007-08-08  8:40                           ` Gilles Chanteperdrix
2007-08-08  9:51                             ` Jan Kiszka
2007-08-08 12:33                             ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.