Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1274230ybl; Fri, 13 Dec 2019 12:27:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz8Ohp+MPnhS+UEfvm3SMerQEZxdG96nF0hEDCREL9km+ydB4GBTqmcDuY5h4afquwkYFET X-Received: by 2002:a05:6830:1353:: with SMTP id r19mr17029746otq.288.1576268842038; Fri, 13 Dec 2019 12:27:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576268842; cv=none; d=google.com; s=arc-20160816; b=HLMo76oL/9GWG6+/98PHvEmlnf2k5VauI7/ZocqrPthjyJSsvIZauKh0BJcFHjeDVq KeYJnO6JQFSSIE8GC7pil8g5dE86lY4HDF2HPzfZlZyOGQ6Vm+ysOh0H9YSRtrSUJxvX Iix2FO14RuOtthk9TqlTq4OQnCvTecAaT8AQYZKwOACboOTsABbQTLBdt4hbwOGgh11s a5sIsHwErJg0xz57AE4Jp9b4HfN5O3W+ukukM45u4fVAo7iPJ83D6N2HYrbkbkbli67C /zguSgw1+fWHNSToV19tFL6eVGzedeVf2Co2swLo/Dc17RuH23XHQzbwjIRHDlFbhfE0 +qew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=4QxWWhfzkeeg/sj/lRZm77rHhBFZZB7dyoW1bA8QM34=; b=O4iHF0NZHm6rVFmBXWvXKb6CPFJJHuCvTfKeE50JVuaJBY6R9uPZ7rNBkkGXcdHWOG SVxhyR62E33/Oi88rf5JjEAYnV/v+n1IRbuLCSQEa4dZc0EeOx8YNfSQZ5gF6/DmNWj+ dNc0TE/ubY9p21aOSTsMOUZMRv3Q2wWor13LQtADuXWS5TXDzRzQn0VehPTib3LrGCgE vLmis4twFW3lIAhzCu9GfYghsTZztMseuiP56zwYxROi31ylePv3SMJEpI360qDM/lkp 1nxLgViiLvz+Q6L2whFMx05IJ6ZPyR/61ktq6g5FmNS5j7NI3Sry95Y0H3fT8VkZddls +KFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=k5TC2Qgd; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si6244227otq.156.2019.12.13.12.26.55; Fri, 13 Dec 2019 12:27:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=k5TC2Qgd; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728731AbfLMU0k (ORCPT + 99 others); Fri, 13 Dec 2019 15:26:40 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:38586 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728696AbfLMU0k (ORCPT ); Fri, 13 Dec 2019 15:26:40 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBDKJRHu065373; Fri, 13 Dec 2019 20:26:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2019-08-05; bh=4QxWWhfzkeeg/sj/lRZm77rHhBFZZB7dyoW1bA8QM34=; b=k5TC2QgdEH/G1ODuvCAQO2/KjcINSU6NjwZApWC1Nn+NhnCbYxGAIW88Ekvtc6U0clwH /WuaOgKNoYujEiaVrmieeMuSx0joMTT1LqiSCSc8mWpZT7t1JEcojOm1aM49ziHvz5cT WO9bXB6eWGrdjEW/tNsQPqfBgK2/gbe5m3ekv8C58BT9HCkv2e+du7NZCWx09zqdUpaW E/uq59n7uF1l+zNOFkf3831UwRu5qZfyn8+bpjgdjxebO5s7M0Tuk49hKKcf7QSdcpfW PBru3brkBCRxNNAS8tQYNnqTtRAlc06pK9qZfbqcccqjKbjWlZ7ZHyZNWkKaaezZ/63u QA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2wr41qu6m9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Dec 2019 20:26:31 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBDKIaFo029237; Fri, 13 Dec 2019 20:26:30 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2wvdwqqskf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Dec 2019 20:26:30 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xBDKQUBQ014080; Fri, 13 Dec 2019 20:26:30 GMT Received: from anon-dhcp-152.1015granger.net (/68.61.232.219) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 13 Dec 2019 12:26:30 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: CPU lockup in or near new filecache code From: Chuck Lever In-Reply-To: Date: Fri, 13 Dec 2019 15:26:28 -0500 Cc: Bruce Fields , Jeff Layton , Linux NFS Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <74C1EB52-06D7-4FB5-BA1C-BB1EC2F325CA@oracle.com> References: <9977648B-7D14-42EB-BD4A-CBD041A0C21A@oracle.com> <3af633a4016a183a930a44e3287f9da230711629.camel@hammerspace.com> To: Trond Myklebust X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9470 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912130149 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9470 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912130149 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > On Dec 13, 2019, at 3:12 PM, Trond Myklebust = wrote: >=20 > On Wed, 2019-12-11 at 15:01 -0500, Chuck Lever wrote: >> OK, I finally got a hit. It took a long time. I've seen this >> particular >> stack trace before, several times. >>=20 >> Dec 11 14:58:34 klimt kernel: watchdog: BUG: soft lockup - CPU#0 >> stuck for 22s! [nfsd:2005] >> Dec 11 14:58:34 klimt kernel: Modules linked in: rpcsec_gss_krb5 >> ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager >> ocfs2_stackglue ib_umad ib_ipoib mlx4_ib sb_edac x86_pkg_temp_thermal >> kvm_intel coretemp kvm irqbypass crct10dif_pclmul crc32_pclmul >> ghash_clmulni_intel iTCO_wdt ext4 iTCO_vendor_support aesni_intel >> mbcache jbd2 glue_helper rpcrdma crypto_simd cryptd rdma_ucm ib_iser >> rdma_cm pcspkr iw_cm ib_cm mei_me raid0 libiscsi lpc_ich mei sg >> scsi_transport_iscsi i2c_i801 mfd_core wmi ipmi_si ipmi_devintf >> ipmi_msghandler ioatdma acpi_power_meter nfsd nfs_acl lockd >> auth_rpcgss grace sunrpc ip_tables xfs libcrc32c mlx4_en sr_mod >> sd_mod cdrom qedr ast drm_vram_helper drm_ttm_helper ttm crc32c_intel >> drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm igb >> dca i2c_algo_bit i2c_core mlx4_core ahci libahci libata nvme >> nvme_core qede qed dm_mirror dm_region_hash dm_log dm_mod crc8 >> ib_uverbs dax ib_core >> Dec 11 14:58:34 klimt kernel: CPU: 0 PID: 2005 Comm: nfsd Tainted: >> G W 5.5.0-rc1-00003-g170e7adc2317 #1401 >> Dec 11 14:58:34 klimt kernel: Hardware name: Supermicro Super >> Server/X10SRL-F, BIOS 1.0c 09/09/2015 >> Dec 11 14:58:34 klimt kernel: RIP: 0010:__srcu_read_lock+0x23/0x24 >> Dec 11 14:58:34 klimt kernel: Code: 07 00 0f 1f 40 00 c3 0f 1f 44 00 >> 00 8b 87 c8 c3 00 00 48 8b 97 f0 c3 00 00 83 e0 01 48 63 c8 65 48 ff >> 04 ca f0 83 44 24 fc 00 0f 1f 44 00 00 f0 83 44 24 fc 00 48 63 >> f6 48 8b 87 f0 c3 00 00 >> Dec 11 14:58:34 klimt kernel: RSP: 0018:ffffc90001d97bd0 EFLAGS: >> 00000246 ORIG_RAX: ffffffffffffff13 >> Dec 11 14:58:34 klimt kernel: RAX: 0000000000000001 RBX: >> ffff888830d0eb78 RCX: 0000000000000001 >> Dec 11 14:58:34 klimt kernel: RDX: 0000000000030f00 RSI: >> ffff888853f4da00 RDI: ffffffff82815a40 >> Dec 11 14:58:34 klimt kernel: RBP: ffff88883112d828 R08: >> ffff888843540000 R09: ffffffff8121d707 >> Dec 11 14:58:34 klimt kernel: R10: ffffc90001d97bf0 R11: >> 0000000000001b84 R12: ffff888853f4da00 >> Dec 11 14:58:34 klimt kernel: R13: ffff8888132a1410 R14: >> ffff88883112d7e0 R15: 00000000ffffffef >> Dec 11 14:58:34 klimt kernel: FS: 0000000000000000(0000) >> GS:ffff88885fc00000(0000) knlGS:0000000000000000 >> Dec 11 14:58:34 klimt kernel: CS: 0010 DS: 0000 ES: 0000 CR0: >> 0000000080050033 >> Dec 11 14:58:34 klimt kernel: CR2: 00007f2d6a2d8000 CR3: >> 0000000859b38004 CR4: 00000000001606f0 >> Dec 11 14:58:34 klimt kernel: Call Trace: >> Dec 11 14:58:34 klimt kernel: fsnotify_grab_connector+0x16/0x4f >> Dec 11 14:58:34 klimt kernel: fsnotify_find_mark+0x11/0x6a >> Dec 11 14:58:34 klimt kernel: nfsd_file_acquire+0x3a9/0x5b2 [nfsd] >> Dec 11 14:58:34 klimt kernel: nfs4_get_vfs_file+0x14c/0x20f [nfsd] >> Dec 11 14:58:34 klimt kernel: nfsd4_process_open2+0xcd6/0xd98 [nfsd] >> Dec 11 14:58:34 klimt kernel: ? fh_verify+0x42e/0x4ef [nfsd] >> Dec 11 14:58:34 klimt kernel: ? nfsd4_process_open1+0x233/0x29d >> [nfsd] >> Dec 11 14:58:34 klimt kernel: nfsd4_open+0x500/0x5cb [nfsd] >> Dec 11 14:58:34 klimt kernel: nfsd4_proc_compound+0x32a/0x5c7 [nfsd] >> Dec 11 14:58:34 klimt kernel: nfsd_dispatch+0x102/0x1e2 [nfsd] >> Dec 11 14:58:34 klimt kernel: svc_process_common+0x3b3/0x65d [sunrpc] >> Dec 11 14:58:34 klimt kernel: ? svc_xprt_put+0x12/0x21 [sunrpc] >> Dec 11 14:58:34 klimt kernel: ? nfsd_svc+0x2be/0x2be [nfsd] >> Dec 11 14:58:34 klimt kernel: ? nfsd_destroy+0x51/0x51 [nfsd] >> Dec 11 14:58:34 klimt kernel: svc_process+0xf6/0x115 [sunrpc] >> Dec 11 14:58:34 klimt kernel: nfsd+0xf2/0x149 [nfsd] >> Dec 11 14:58:34 klimt kernel: kthread+0xf6/0xfb >> Dec 11 14:58:34 klimt kernel: ? kthread_queue_delayed_work+0x74/0x74 >> Dec 11 14:58:34 klimt kernel: ret_from_fork+0x3a/0x50 >>=20 >=20 > Does something like the following help? >=20 > 8<--------------------------------------------------- > =46rom caf515c82ed572e4f92ac8293e5da4818da0c6ce Mon Sep 17 00:00:00 = 2001 > From: Trond Myklebust > Date: Fri, 13 Dec 2019 15:07:33 -0500 > Subject: [PATCH] nfsd: Fix a soft lockup race in > nfsd_file_mark_find_or_create() >=20 > If nfsd_file_mark_find_or_create() keeps winning the race for the > nfsd_file_fsnotify_group->mark_mutex against nfsd_file_mark_put() > then it can soft lock up, since fsnotify_add_inode_mark() ends > up always finding an existing entry. >=20 > Signed-off-by: Trond Myklebust > --- > fs/nfsd/filecache.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > index 9c2b29e07975..f275c11c4e28 100644 > --- a/fs/nfsd/filecache.c > +++ b/fs/nfsd/filecache.c > @@ -132,9 +132,13 @@ nfsd_file_mark_find_or_create(struct nfsd_file = *nf) > struct nfsd_file_mark, > nfm_mark)); > = mutex_unlock(&nfsd_file_fsnotify_group->mark_mutex); > - fsnotify_put_mark(mark); > - if (likely(nfm)) > + if (nfm) { > + fsnotify_put_mark(mark); > break; > + } > + /* Avoid soft lockup race with = nfsd_file_mark_put() */ > + fsnotify_destroy_mark(mark, = nfsd_file_fsnotify_group); > + fsnotify_put_mark(mark); > } else > = mutex_unlock(&nfsd_file_fsnotify_group->mark_mutex); >=20 Received. I'll have some time over the weekend or on Monday to test it. -- Chuck Lever