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=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 E7784C433DB for ; Thu, 21 Jan 2021 13:23:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7563D206F7 for ; Thu, 21 Jan 2021 13:23:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7563D206F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EABC06B0010; Thu, 21 Jan 2021 08:23:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E82A36B0012; Thu, 21 Jan 2021 08:23:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D48E86B0022; Thu, 21 Jan 2021 08:23:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id BC7296B0010 for ; Thu, 21 Jan 2021 08:23:27 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7F50B181AEF3F for ; Thu, 21 Jan 2021 13:23:27 +0000 (UTC) X-FDA: 77729848854.23.nut44_6311c2427563 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 4BBDD37609 for ; Thu, 21 Jan 2021 13:23:27 +0000 (UTC) X-HE-Tag: nut44_6311c2427563 X-Filterd-Recvd-Size: 4504 Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 13:23:26 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10LDEw0A095496; Thu, 21 Jan 2021 13:23:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2020-01-29; bh=ql0wC9LxRsGgSrOHu3fRQsna06B8LdR/VErJMQR/XfM=; b=JVod1dEdB5Z5+ycpndwCZHxyDUxY9WQL3XSTTZ+5wrAhWMOZCFaciabNZYgMoUUhgNZz SQ3NFYPq1BPWMjAgygYYSSLakocigr5f8SAz/kSqoHYt4veUYuBNasCKKQzX+LtYjTGa IRV7mav+nTjZBVW4X246ZbHtUvx9oAj7TgXNAvw+KhR/C03KDPhxZfdS4n/Ox8Gnen15 bfX0gwQ6KcipvqE0w/kloUhJOnXpSLJ4e8lOXhYV7LAevEYx7pPVVMj6HR4nH9SIvuR7 MMXEV9iyLT8wV2VjuKcJOT8dJb8NMM8jHwjh+O2d+Vm4spaxhkiMfTsJQ7sj5JcDe4IU hg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 3668qrfa03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Jan 2021 13:23:25 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10LDFjEK106643; Thu, 21 Jan 2021 13:21:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3030.oracle.com with ESMTP id 3668rexrcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Jan 2021 13:21:25 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 10LDKZJH123118; Thu, 21 Jan 2021 13:21:24 GMT Received: from gmananth-linux.oraclecorp.com (dhcp-10-166-171-141.vpn.oracle.com [10.166.171.141]) by userp3030.oracle.com with ESMTP id 3668rexq88-6; Thu, 21 Jan 2021 13:21:24 +0000 From: Gautham Ananthakrishna To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: viro@zeniv.linux.org.uk, matthew.wilcox@oracle.com, khlebnikov@yandex-team.ru, gautham.ananthakrishna@oracle.com Subject: [PATCH RFC 5/6] dcache: push releasing dentry lock into sweep_negative Date: Thu, 21 Jan 2021 18:49:44 +0530 Message-Id: <1611235185-1685-6-git-send-email-gautham.ananthakrishna@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1611235185-1685-1-git-send-email-gautham.ananthakrishna@oracle.com> References: <1611235185-1685-1-git-send-email-gautham.ananthakrishna@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9870 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101210072 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Konstantin Khlebnikov Release the dentry lock inside the sweep_negative() function. This is in preparation for a follow up patch and doesn't change runtime behavior. Signed-off-by: Konstantin Khlebnikov Signed-off-by: Gautham Ananthakrisha --- fs/dcache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 492a42f..22c990b 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -638,13 +638,14 @@ static inline struct dentry *lock_parent(struct dentry *dentry) * Must be called at dput of negative dentry. */ static void sweep_negative(struct dentry *dentry) + __releases(dentry->d_lock) { struct dentry *parent; if (!d_is_tail_negative(dentry)) { parent = lock_parent(dentry); if (!parent) - return; + goto out; if (!d_count(dentry) && d_is_negative(dentry) && !d_is_tail_negative(dentry)) { @@ -654,6 +655,8 @@ static void sweep_negative(struct dentry *dentry) spin_unlock(&parent->d_lock); } +out: + spin_unlock(&dentry->d_lock); } /* @@ -922,7 +925,8 @@ void dput(struct dentry *dentry) if (likely(retain_dentry(dentry))) { if (d_is_negative(dentry)) sweep_negative(dentry); - spin_unlock(&dentry->d_lock); + else + spin_unlock(&dentry->d_lock); return; } -- 1.8.3.1