From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57078 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727125AbeJYUQQ (ORCPT ); Thu, 25 Oct 2018 16:16:16 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9PBdlc6146848 for ; Thu, 25 Oct 2018 07:43:50 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nbbwrbyab-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 25 Oct 2018 07:43:50 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Oct 2018 12:43:48 +0100 Date: Thu, 25 Oct 2018 13:43:44 +0200 From: Martin Schwidefsky To: Al Viro Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: dcache endless loop in d_invalidate In-Reply-To: <20181016131528.6aac4876@mschwideX1> References: <20181016131528.6aac4876@mschwideX1> MIME-Version: 1.0 Message-Id: <20181025134344.75484f14@mschwideX1> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 16 Oct 2018 13:15:28 +0200 Martin Schwidefsky wrote: > In short, this if-statement in select_collect: > > if (dentry->d_flags & DCACHE_SHRINK_LIST) { > data->found++; > } > > with assumption that "somebody else" will do the shrinking seems broken. > > Do you agree? If I am not mistaken this problem should be fixed by upstream commit 4fb4887140 "restore cond_resched() in shrink_dcache_parent()" which goes on top of ff17fa561a "d_invalidate(): unhash immediately" Due to the cond_resched() the task that set DCACHE_SHRINK_LIST for the remaining two dcache entries will be scheduled eventually. This will allow the task waiting for the deletion of these dcache entries to continue, although some CPU cycles may get wasted. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.