From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752833AbcGFChM (ORCPT ); Tue, 5 Jul 2016 22:37:12 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:47454 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbcGFChI (ORCPT ); Tue, 5 Jul 2016 22:37:08 -0400 Subject: Re: [PATCH v2] fs/dcache.c: avoid soft-lockup in dput() To: Boqun Feng References: <1466564475-30417-1-git-send-email-fangwei1@huawei.com> <20160622065128.GB28443@insomnia> CC: , , , , , , , From: Wei Fang Message-ID: <577C6EA9.6050703@huawei.com> Date: Wed, 6 Jul 2016 10:36:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160622065128.GB28443@insomnia> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.236.214] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.577C6ECB.0117,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c4f899ca5ad66ac1aa59dccbfdfb197d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Boqun, >> diff --git a/fs/dcache.c b/fs/dcache.c >> index d5ecc6e..074fc1c 100644 >> --- a/fs/dcache.c >> +++ b/fs/dcache.c >> @@ -578,7 +578,7 @@ static struct dentry *dentry_kill(struct dentry *dentry) >> >> failed: >> spin_unlock(&dentry->d_lock); >> - cpu_relax(); >> + cond_resched(); > > Is it better to put the cond_resched() in the caller(i.e. dput()), right > before "goto repeat"? Because it's obviously a loop there, which makes > the purpose of cond_resched() more straightforward. Agreed, that's more reasonable. I'll send v3 soon. Thanks, Wei