From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: Possible regression with cgroups in 3.11 Date: Wed, 20 Nov 2013 23:26:18 -0500 Message-ID: <528D8B6A.40008@oracle.com> References: <5270BFE7.4000602@huawei.com> <20131031130647.0ff6f2c7@gandalf.local.home> <20131113032804.GB19394@mtj.dyndns.org> <20131113073806.GA23244@mtj.dyndns.org> <20131116002820.GA31073@google.com> <20131116045356.GA5618@mtj.dyndns.org> <20131118181440.GA2996@google.com> <20131118203925.GA26682@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131118203925.GA26682-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Bjorn Helgaas , Yinghai Lu Cc: Tejun Heo , Hugh Dickins , Steven Rostedt , Li Zefan , Markus Blank-Burian , Michal Hocko , Johannes Weiner , David Rientjes , Ying Han , Greg Thelen , Michel Lespinasse , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Srivatsa S. Bhat" , Lai Jiangshan , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "Rafael J. Wysocki" , Alexander Duyck , "linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" On 11/18/2013 03:39 PM, Bjorn Helgaas wrote: > On Mon, Nov 18, 2013 at 11:29:32AM -0800, Yinghai Lu wrote: >> On Mon, Nov 18, 2013 at 10:14 AM, Bjorn Helgaas wrote: >>>> A bit of comment here would be nice but yeah I think this should work. >>>> Can you please also queue the revert of c2fda509667b ("workqueue: >>>> allow work_on_cpu() to be called recursively") after this patch? >>>> Please feel free to add my acked-by. >>> >>> OK, below are the two patches (Alex's fix + the revert) I propose to >>> merge. Unless there are objections, I'll ask Linus to pull these >>> before v3.13-rc1. >>> >>> >>> >>> commit 84f23f99b507c2c9247f47d3db0f71a3fd65e3a3 >>> Author: Alexander Duyck >>> Date: Mon Nov 18 10:59:59 2013 -0700 >>> >>> PCI: Avoid unnecessary CPU switch when calling driver .probe() method >>> >>> If we are already on a CPU local to the device, call the driver .probe() >>> method directly without using work_on_cpu(). >>> >>> This is a workaround for a lockdep warning in the following scenario: >>> >>> pci_call_probe >>> work_on_cpu(cpu, local_pci_probe, ...) >>> driver .probe >>> pci_enable_sriov >>> ... >>> pci_bus_add_device >>> ... >>> pci_call_probe >>> work_on_cpu(cpu, local_pci_probe, ...) >>> >>> It would be better to fix PCI so we don't call VF driver .probe() methods >>> from inside a PF driver .probe() method, but that's a bigger project. >>> >>> [bhelgaas: disable preemption, open bugzilla, rework comments & changelog] >>> Link: https://bugzilla.kernel.org/show_bug.cgi?id=65071 >>> Link: http://lkml.kernel.org/r/CAE9FiQXYQEAZ=0sG6+2OdffBqfLS9MpoN1xviRR9aDbxPxcKxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org >>> Link: http://lkml.kernel.org/r/20130624195942.40795.27292.stgit-+uVpp3jiz/Q1YPczIWDRvLvm/XP+8Wra@public.gmane.org >>> Signed-off-by: Alexander Duyck >>> Signed-off-by: Bjorn Helgaas >>> Acked-by: Tejun Heo >> >> Tested-by: Yinghai Lu >> Acked-by: Yinghai Lu > > Thanks, I added these and pushed my for-linus branch for -next to > pick up before I ask Linus to pull them. Hi guys, This patch seems to be causing virtio (wouldn't it happen with any other driver too?) to give the following spew: [ 11.966381] virtio-pci 0000:00:00.0: enabling device (0000 -> 0003) [ 11.968306] BUG: scheduling while atomic: swapper/0/1/0x00000002 [ 11.968616] 2 locks held by swapper/0/1: [ 11.969144] #0: (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x48/0xa0 [ 11.969720] #1: (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x59/0xa0 [ 11.971519] Modules linked in: [ 11.971519] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G W 3.12.0-next-20131120-sasha-00002-gf582b19 #4023 [ 11.972293] 0000000000000003 ffff880fced736c8 ffffffff8429caa2 0000000000000003 [ 11.973145] ffff880fce820000 ffff880fced736e8 ffffffff8115b67b 0000000000000003 [ 11.973952] ffff880fe5dd7880 ffff880fced73768 ffffffff8429d463 ffff880fced73708 [ 11.974881] Call Trace: [ 11.975233] [] dump_stack+0x52/0x7f [ 11.975786] [] __schedule_bug+0x6b/0x90 [ 11.976411] [] __schedule+0x93/0x760 [ 11.976971] [] ? kvm_clock_read+0x24/0x50 [ 11.977646] [] schedule+0x65/0x70 [ 11.978223] [] schedule_timeout+0x3d/0x260 [ 11.978821] [] ? put_lock_stats+0xe/0x30 [ 11.979595] [] ? wait_for_completion+0xb7/0x120 [ 11.980324] [] ? __lock_release+0x1da/0x1f0 [ 11.981554] [] ? wait_for_completion+0xb7/0x120 [ 11.981664] [] wait_for_completion+0xbf/0x120 [ 11.982266] [] ? try_to_wake_up+0x2a0/0x2a0 [ 11.982891] [] call_usermodehelper_exec+0x198/0x240 [ 11.983552] [] ? complete+0x28/0x60 [ 11.984053] [] call_usermodehelper+0x45/0x50 [ 11.984660] [] kobject_uevent_env+0x594/0x600 [ 11.985254] [] kobject_uevent+0xb/0x10 [ 11.985855] [] device_add+0x2b5/0x4a0 [ 11.986495] [] device_register+0x1e/0x30 [ 11.987051] [] register_virtio_device+0x87/0xb0 [ 11.987760] [] ? pci_set_master+0x23/0x30 [ 11.988410] [] virtio_pci_probe+0x162/0x1c0 [ 11.989000] [] local_pci_probe+0x4c/0xb0 [ 11.989683] [] pci_call_probe+0xa1/0xd0 [ 11.990359] [] pci_device_probe+0x63/0xa0 [ 11.991829] [] ? driver_sysfs_add+0x73/0xb0 [ 11.991829] [] really_probe+0x11f/0x2f0 [ 11.992234] [] driver_probe_device+0x83/0xb0 [ 11.992847] [] __driver_attach+0x6e/0xa0 [ 11.993407] [] ? driver_probe_device+0xb0/0xb0 [ 11.994020] [] ? driver_probe_device+0xb0/0xb0 [ 11.994719] [] bus_for_each_dev+0x66/0xc0 [ 11.995272] [] driver_attach+0x1e/0x20 [ 11.995829] [] bus_add_driver+0x11e/0x240 [ 11.996411] [] ? virtio_mmio_init+0x14/0x14 [ 11.996996] [] driver_register+0xa8/0xf0 [ 11.997628] [] ? virtio_mmio_init+0x14/0x14 [ 11.998196] [] __pci_register_driver+0x64/0x70 [ 11.998798] [] virtio_pci_driver_init+0x19/0x1b [ 11.999421] [] do_one_initcall+0xca/0x1d0 [ 12.000109] [] ? parse_args+0x1cb/0x310 [ 12.000666] [] ? kernel_init_freeable+0x339/0x339 [ 12.001364] [] do_basic_setup+0x9c/0xbf [ 12.001903] [] ? kernel_init_freeable+0x339/0x339 [ 12.002542] [] ? sched_init_smp+0x13f/0x141 [ 12.003202] [] kernel_init_freeable+0x2b6/0x339 [ 12.003815] [] ? kernel_init+0xe/0x130 [ 12.004475] [] ? rest_init+0xd0/0xd0 [ 12.005011] [] kernel_init+0xe/0x130 [ 12.005541] [] ret_from_fork+0x7c/0xb0 [ 12.006068] [] ? rest_init+0xd0/0xd0 Thanks, Sasha