Re: Debug: sleeping function called from invalid context at mm/slab.c:2126

From: Parag Warudkar (kernel-stuff_at_comcast.net)
Date: 11/10/05

  • Next message: Wu Fengguang: "Re: [PATCH 01/16] mm: delayed page activation"
    To: Tony <tony.uestc@gmail.com>, linux-kernel@vger.kernel.org
    Date:	Thu, 10 Nov 2005 03:07:32 +0000
    
    

    > I'm writing a net_device driver. I want to send a packet when the timer
    > is out. I get the following warning. It seems that I should not call
    > alloc_skb. Can anyone tell me how to get rid of this? Thanks in advance.
    >

    You are calling alloc_skb which in turn calls kmem_cache_alloc in interrupt context where things can't sleep and kmem_cache_alloc can sleep. The reason for this is that you are passing GFP_KERNEL to alloc_skb. Try passing GFP_ATOMIC instead.

    Other alternative is to may be use a precreated pool of skbs - may be this can be done in driver init function or any other safe context. But I don't know how much feasible that is in your situation.

    HTH
    Parag

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


  • Next message: Wu Fengguang: "Re: [PATCH 01/16] mm: delayed page activation"

    Relevant Pages

    • [2.6 patch] tmscsim: remove kernel kenel 2.2 #ifdefs
      ... The patch below removes #ifdefs for kernel 2.0 and 2.2 from the tmscsim ... MODULE_DESCRIPTION("SCSI host adapter driver for Tekram DC390 and other AMD53C974A based PCI SCSI adapters"); ... static inline int timer_pending(struct timer_list * timer) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] fix warnings in drivers/mtd/devices/doc200?.c
      ... > #warning This driver should be updated to the new ECC API. ... know something needs updating here" as opposed to just a compiler warning ... > working on a new driver and at that point we'll also update the code ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • PREEMPT_RT with e1000
      ... It looks like Gigabit Ethernet is still having some problems. ... with the e1000 driver. ... starts to work the warning below goes away, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] orinoco: Fix flood of kernel log with stupid WE warnings
      ... The WE core will now printk a warning on every call ... to get_wireless_statson a driver that still uses the old field. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Cpufreq for opteron
      ... Actually I doubt an #error and a #warning are necessary here. ... > +to force the system to save power when running from battery. ... > +This driver does NOT have the support in it to detect transitions from ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)