Netdev List
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v2] drop_monitor: dont sleep in atomic context
Date: Mon, 4 Jun 2012 06:49:37 -0400	[thread overview]
Message-ID: <20120604104937.GC20232@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1338805099.2760.1798.camel@edumazet-glaptop>

On Mon, Jun 04, 2012 at 12:18:19PM +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> drop_monitor calls several sleeping functions while in atomic context.
> 
>  BUG: sleeping function called from invalid context at mm/slub.c:943
>  in_atomic(): 1, irqs_disabled(): 0, pid: 2103, name: kworker/0:2
>  Pid: 2103, comm: kworker/0:2 Not tainted 3.5.0-rc1+ #55
>  Call Trace:
>   [<ffffffff810697ca>] __might_sleep+0xca/0xf0
>   [<ffffffff811345a3>] kmem_cache_alloc_node+0x1b3/0x1c0
>   [<ffffffff8105578c>] ? queue_delayed_work_on+0x11c/0x130
>   [<ffffffff815343fb>] __alloc_skb+0x4b/0x230
>   [<ffffffffa00b0360>] ? reset_per_cpu_data+0x160/0x160 [drop_monitor]
>   [<ffffffffa00b022f>] reset_per_cpu_data+0x2f/0x160 [drop_monitor]
>   [<ffffffffa00b03ab>] send_dm_alert+0x4b/0xb0 [drop_monitor]
>   [<ffffffff810568e0>] process_one_work+0x130/0x4c0
>   [<ffffffff81058249>] worker_thread+0x159/0x360
>   [<ffffffff810580f0>] ? manage_workers.isra.27+0x240/0x240
>   [<ffffffff8105d403>] kthread+0x93/0xa0
>   [<ffffffff816be6d4>] kernel_thread_helper+0x4/0x10
>   [<ffffffff8105d370>] ? kthread_freezable_should_stop+0x80/0x80
>   [<ffffffff816be6d0>] ? gs_change+0xb/0xb
> 
> Rework the logic to call the sleeping functions in right context.
> 
> Use standard timer/workqueue api to let system chose any cpu to perform
> the allocation and netlink send.
> 
> Also avoid a loop if reset_per_cpu_data() cannot allocate memory :
> use mod_timer() to wait 1/10 second before next try.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>

Thanks Eric!
Neil

  reply	other threads:[~2012-06-04 10:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04 10:18 [PATCH v2] drop_monitor: dont sleep in atomic context Eric Dumazet
2012-06-04 10:49 ` Neil Horman [this message]
2012-06-04 15:42   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120604104937.GC20232@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox