From patchwork Fri May 5 13:21:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sahitya Tummala X-Patchwork-Id: 9713539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F389F60362 for ; Fri, 5 May 2017 13:21:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC6A428617 for ; Fri, 5 May 2017 13:21:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0CB02869A; Fri, 5 May 2017 13:21:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 548E728617 for ; Fri, 5 May 2017 13:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752752AbdEENVN (ORCPT ); Fri, 5 May 2017 09:21:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54046 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbdEENVN (ORCPT ); Fri, 5 May 2017 09:21:13 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 225F060A61; Fri, 5 May 2017 13:21:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1493990472; bh=Uwl4f+uk1QxwaWENow81PkInBmfpZvQW93nN1tOyYGA=; h=To:From:Cc:Subject:Date:From; b=Hy0RaqvihaIfuaE4rreTwZjwuVXZpS67ry3ZuhJ5gvzYxdg+kTB+g6pBV7qzBPPF7 obwb9o0Ok7Ge45ywvAvLUIF6FUUUXeHkkN98bqY+zMmVXcXsglAvScz+rXAbMmYeiu yPHdDgH1YtiH8pTHvFVx9pBWK4LrV5PT3kXqy8rA= Received: from [192.168.1.245] (unknown [183.83.249.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: stummala@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 05BA2600EC; Fri, 5 May 2017 13:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1493990471; bh=Uwl4f+uk1QxwaWENow81PkInBmfpZvQW93nN1tOyYGA=; h=To:From:Cc:Subject:Date:From; b=Z9Fl5qNVn0ONs/zYzKyhjLDd7jOWEHVfy4YzDFVh1iPO/XQwckWSYIct5SMlzNzk5 i3pi98U5y2DW0efhHPvS+/w4NuKJ0eC0vOb23Efhq342SO360gAtaGWofZQzc/s+jy f8XDc9mEkCVvvh9yxopmNU3sn57MyHYyTezYv8K4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 05BA2600EC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=stummala@codeaurora.org To: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk From: Sahitya Tummala Cc: linux-kernel@vger.kernel.org, stummala@codeaurora.org Subject: soft lockup in d_invalidate() Message-ID: <41a04a66-cf51-1dbe-5b07-e22b6d534b71@codeaurora.org> Date: Fri, 5 May 2017 18:51:06 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, We are seeing a soft lock up where a RT task is tight looping in d_invalidate(). The corresponding dentries are claimed by a low priority normal task, but this task is scheduled out. The cond_resched() in d_invalidate() is not taking into effect as this RT task is the highest priority task on the CPU. The below patch resolved this soft lockup issue on my system. Can you please tell if there would be any side effects by doing this? d_lru_del(dentry); Here is the call stack of RT task - #0 [fffffffa2b5d78c0] __switch_to at ffffff90b6485eec #1 [fffffffa2b5d78e0] __schedule at ffffff90b7413c44 #2 [fffffffa2b5d7940] preempt_schedule_notrace at ffffff90b7414078 #3 [fffffffa2b5d7960] trace_vbprintk at ffffff90b655c5b4 #4 [fffffffa2b5d79f0] __trace_bprintk at ffffff90b6563194 #5 [fffffffa2b5d7a90] d_invalidate at ffffff90b65f9f58 #6 [fffffffa2b5d7b30] proc_flush_task at ffffff90b66478c0 #7 [fffffffa2b5d7bd0] release_task at ffffff90b64a45a4 #8 [fffffffa2b5d7c40] do_exit at ffffff90b64a638c Here is the call stack of a low priority normal task which claimed the dentries corresponding to above RT task – #0 [fffffffa00e37120] __switch_to at ffffff90b6485eec #1 [fffffffa00e37140] __schedule at ffffff90b7413c44 #2 [fffffffa00e371a0] preempt_schedule_common at ffffff90b7413f48 #3 [fffffffa00e371c0] preempt_schedule at ffffff90b7413f88 #4 [fffffffa00e371d0] _raw_spin_unlock_irqrestore at ffffff90b7418a10 #5 [fffffffa00e371f0] debug_object_active_state at ffffff90b67c91f0 #6 [fffffffa00e37270] __call_rcu.constprop.60 at ffffff90b65133ac #7 [fffffffa00e372b0] call_rcu at ffffff90b65135f0 #8 [fffffffa00e372e0] dentry_free at ffffff90b65f82b8 #9 [fffffffa00e37300] __dentry_kill at ffffff90b65f84a4 #10 [fffffffa00e37350] shrink_dentry_list at ffffff90b65f9390 #11 [fffffffa00e373e0] prune_dcache_sb at ffffff90b65fa5d4 #12 [fffffffa00e37420] super_cache_scan at ffffff90b65e7ac4 #13 [fffffffa00e37480] do_shrink_slab at ffffff90b6599d50 #14 [fffffffa00e37500] shrink_slab at ffffff90b659a7dc #15 [fffffffa00e37580] shrink_zone at ffffff90b659d2f4 #16 [fffffffa00e37610] do_try_to_free_pages at ffffff90b659d620 #17 [fffffffa00e376b0] try_to_free_pages at ffffff90b659d93c #18 [fffffffa00e37740] __alloc_pages_nodemask at ffffff90b6590838 #19 [fffffffa00e37870] new_slab at ffffff90b65cee54 #20 [fffffffa00e378d0] ___slab_alloc at ffffff90b65d0164 #21 [fffffffa00e379f0] __slab_alloc at ffffff90b65d0210 - Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project. diff --git a/fs/dcache.c b/fs/dcache.c index 7b8feb6..3a3b0f37 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1364,7 +1364,7 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) goto out; if (dentry->d_flags & DCACHE_SHRINK_LIST) { - data->found++; + goto out; } else { if (dentry->d_flags & DCACHE_LRU_LIST)