From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CE2EC46475 for ; Thu, 25 Oct 2018 11:43:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 519D120831 for ; Thu, 25 Oct 2018 11:43:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 519D120831 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727407AbeJYUQQ (ORCPT ); Thu, 25 Oct 2018 16:16:16 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57100 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727208AbeJYUQQ (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 w9PBdh68146592 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 2nbbwrbyae-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 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 25 Oct 2018 12:43:46 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9PBhjF829556950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Oct 2018 11:43:45 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 427C352054; Thu, 25 Oct 2018 11:43:45 +0000 (GMT) Received: from mschwideX1 (unknown [9.152.212.191]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2300352051; Thu, 25 Oct 2018 11:43:45 +0000 (GMT) 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> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18102511-0028-0000-0000-0000030D1DBF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18102511-0029-0000-0000-000023C93257 Message-Id: <20181025134344.75484f14@mschwideX1> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-25_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=395 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810250103 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.