Re: [RFC PATCH] dcache: give a chance to yield in shrink_dentry_list
From: Nikolay Borisov
Date: Thu Jul 14 2016 - 07:52:14 EST
On 07/14/2016 02:12 PM, Biscuit Ninja wrote:
>> A softlockup in shrink_dentry_list when called from shrink_dcache_sb
>> was observed on a very busy server. It's possible that the list
>> passed to shrink_dentry_list is so big that it takes a while to
>> dispose of all entries. Adding a simple cond_resched would give
>> the cpu a chance to do some other useful work and no trip the
>> softlockup watchdog.
>
> Hello Nikolay,
>
> I'm interested in your proposed patch because I believe I've come across
> the same issue a handful of times, typically:
[CCing Al Viro to ping re. the following patch:
https://patchwork.kernel.org/patch/8642031/ ]
I haven't looked at the 3.13 source but the patch is trivial enough so
that you can apply it. Just go ahead and test :) Too bad I didn't
receive any feedback and have frankly forgotten it.
>
> WARNING: CPU: 0 PID: 22717
> at /build/buildd/linux-lts-trusty-3.13.0/fs/dcache.c:362 d_shrink_del
> +0x79/0x90()
> Modules linked in: pcnet32 mii vmwgfx ttm drm psmouse lp i2c_piix4 ppdev
> parport_pc vmw_vmci shpchp serio_raw mac_hid vmw_balloon parport floppy
> mptspi mptscsih mptbase e1000 vmw_pvscsi vmxnet3
> CPU: 0 PID: 22717 Comm: sh Not tainted 3.13.0-32-generic
> #57~precise1-Ubuntu
> Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop
> Reference Platform, BIOS 6.00 10/22/2013
> 000000000000016a ffff88000616bbe8 ffffffff81752c9e 0000000000000007
> 0000000000000000 ffff88000616bc28 ffffffff8106af7c ffff88000616bc08
> ffff880037f54480 ffff880037f54480 ffff880037f54500 ffff880037f544d8
> Call Trace:
> [<ffffffff81752c9e>] dump_stack+0x46/0x58
> [<ffffffff8106af7c>] warn_slowpath_common+0x8c/0xc0
> [<ffffffff8106afca>] warn_slowpath_null+0x1a/0x20
> [<ffffffff811df419>] d_shrink_del+0x79/0x90
> [<ffffffff811e0ad2>] shrink_dentry_list+0x62/0xe0
> [<ffffffff811e0c18>] shrink_dcache_parent+0x28/0x70
> [<ffffffff812321c7>] proc_flush_task_mnt.isra.15+0x77/0x170
> [<ffffffff812356e6>] proc_flush_task+0x56/0x70
> [<ffffffff8106c803>] release_task+0x33/0x130
> [<ffffffff8106cdcf>] wait_task_zombie+0x4cf/0x5f0
> [<ffffffff8106cffb>] wait_consider_task.part.8+0x10b/0x180
> [<ffffffff8106d0d5>] wait_consider_task+0x65/0x70
> [<ffffffff8106d1e1>] do_wait+0x101/0x260
> [<ffffffff8106e213>] SyS_wait4+0xa3/0x100
> [<ffffffff8106bc10>] ? task_stopped_code+0x50/0x50
> [<ffffffff8176847f>] tracesys+0xe1/0xe6
> ---[ end trace e2a4a7d8b698f0ea ]---
> BUG: soft lockup - CPU#0 stuck for 22s! [sh:22717]
> Modules linked in: pcnet32 mii vmwgfx ttm drm psmouse lp i2c_piix4 ppdev
> parport_pc vmw_vmci shpchp serio_raw mac_hid vmw_balloon parport floppy
> mptspi mptscsih mptbase e1000 vmw_pvscsi vmxnet3
> CPU: 0 PID: 22717 Comm: sh Tainted: G W 3.13.0-32-generic
> #57~precise1-Ubuntu
> Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop
> Reference Platform, BIOS 6.00 10/22/2013
> task: ffff88001ef717f0 ti: ffff88000616a000 task.ti: ffff88000616a000
> RIP: 0010:[<ffffffff8175f28c>] [<ffffffff8175f28c>] _raw_spin_lock
> +0x1c/0x50
> RSP: 0018:ffff88000616bc58 EFLAGS: 00000246
>
>
> This is under Ubuntu 12.04.5 with kernel 3.13.0-32-generic.
>