Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp302150pxb; Thu, 21 Jan 2021 07:29:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHy9jwCzXJwOqUdQzCSzxNUwHV6mf/FfZGoj8i0bJm2NOkF72AcsikIojKgKvirGMvAXYT X-Received: by 2002:aa7:ccc6:: with SMTP id y6mr11421193edt.226.1611242965484; Thu, 21 Jan 2021 07:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611242965; cv=none; d=google.com; s=arc-20160816; b=fix6woQrlljpxDvI0/pd3HmPQE7qwckbES/M36LmWCQ+Kr5Zc93C/wqcphDxpuuWU3 kQGN+s2JYe52kUY8hrelIr/DY4b/tXdXCi5pvmTgr0ePDCVfqGskjgFm69nw+mv6oLek dVW2lwipR5XH51MufHjE/wHGHyAVccuKEHT+j9P57DYLQzqYXzUtyF5THKmmxPjrnn+u SULeCm+rFuOWuVIPV3rzG6I6NTlaRgKM8YDw34rk7mBF0n4g1fV4wFV+gEMZb4lZ/+6b rJHMefSwfB/R4qIXzXzwX+FfX/lU12qydnVSyZDY0updgh7oiQqUokPV48w3rcGiURQ0 QO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=ql0wC9LxRsGgSrOHu3fRQsna06B8LdR/VErJMQR/XfM=; b=qqdFirhqV/0oGATe6zjMPyqKjb07SxbuijsAaWanTlYjL6GxQC3AdEnHzkBBTxXtmy Au81gqaa8scgV+9pQpp52VJglEaaic8d8umgAyzZQkZUO70r6zTwS/0LAfsXXrP82Eu1 GUDrRmtKb+6nEWw14i5yLgVS0vjOSw2S+uqSPMnmsGTNxf5KZvHvC2G5+MD9RM0IUFGu gfYo/8AjdvWmkp2c8CbipKvJMIgd2NizoGmSiwicfc5FxIoTigw68DCQpik4iNflVJ5v z4lMSvVP4hh1fF8d+XycTndMJPz4Aqej0a1lqdw/zfWY8JGsz/gHWanV958uwU2EyWkF Ofaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=JVod1dEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m15si1884577eje.225.2021.01.21.07.29.00; Thu, 21 Jan 2021 07:29:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=JVod1dEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731663AbhAUP1n (ORCPT + 99 others); Thu, 21 Jan 2021 10:27:43 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:48510 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731583AbhAUNYI (ORCPT ); Thu, 21 Jan 2021 08:24:08 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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