Re: [wq:review-wq-mod_delayed] WARNING: at __queue_work()

From: Tejun Heo
Date: Mon Jul 30 2012 - 14:39:59 EST


On Sun, Jul 29, 2012 at 01:21:59PM +0800, Fengguang Wu wrote:
> Hi Tejun,
>
> I got the below warning on
>
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-wq-mod_delayed
> head: 6f510bfa84f26319b1021b9e706ebb814809c4a3
> commit: 54eaaeaa4d2b871c835ff826af5dab3b96f90da0 [4/15] workqueue: disable preemption while manipulating PENDING
>
> [ 0.624901] NET: Registered protocol family 1
> [ 0.626536] ------------[ cut here ]------------
> [ 0.627849] WARNING: at /c/kernel-tests/src/tip/kernel/workqueue.c:995 __queue_work+0x33/0x1ab()
> [ 0.630262] Pid: 1, comm: swapper Not tainted 3.5.0-07346-g54eaaea #1043
> [ 0.632100] Call Trace:
> [ 0.632803] [<8102546a>] warn_slowpath_common+0x54/0x69
> [ 0.634246] [<81034e5d>] ? __queue_work+0x33/0x1ab
> [ 0.635578] [<81034e5d>] ? __queue_work+0x33/0x1ab
> [ 0.636944] [<8102551d>] warn_slowpath_null+0x1d/0x20
> [ 0.638344] [<81034e5d>] __queue_work+0x33/0x1ab
> [ 0.639632] [<8103506c>] queue_work_on+0x13/0x1c
> [ 0.640945] [<81035083>] queue_work+0xe/0x10
> [ 0.642137] [<81035136>] queue_delayed_work+0xf/0x22
> [ 0.643525] [<81035642>] schedule_delayed_work+0x11/0x13
> [ 0.645038] [<815a3750>] sunrpc_init_cache_detail+0x7f/0x82
> [ 0.646579] [<815a3db6>] cache_register_net+0x8/0xc
> [ 0.647941] [<815a0520>] ip_map_cache_create+0x34/0x56
> [ 0.649399] [<81ac0ffe>] sunrpc_init_net+0x73/0xce
> [ 0.650743] [<81ac0f8b>] ? init_sunrpc+0x5f/0x5f
> [ 0.652049] [<814f3bba>] ops_init.constprop.5+0xc5/0xeb
> [ 0.653510] [<814f3c34>] register_pernet_operations.isra.2+0x54/0x7d
> [ 0.655325] [<81ac0f2c>] ? rpc_init_generic_auth+0xf/0xf
> [ 0.656821] [<814f3dbb>] register_pernet_subsys+0x19/0x2a
> [ 0.658316] [<81ac0f55>] init_sunrpc+0x29/0x5f
> [ 0.659555] [<81a879cb>] do_one_initcall+0x7e/0x129
> [ 0.660936] [<81a87b59>] kernel_init+0xe3/0x17a
> [ 0.662205] [<81a87435>] ? do_early_param+0x7a/0x7a
> [ 0.663574] [<81a87a76>] ? do_one_initcall+0x129/0x129
> [ 0.665038] [<81652f36>] kernel_thread_helper+0x6/0xd

The WARN_ON should have been on preemptible() instead of directly on
preempt_count(); otherwise, with !CONFIG_PREEMPT_COUNT, the condition
triggers spuriously. Will fix.

Thanks a lot for the report.

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