Message ID | 20221111220614.991928-5-stephen.s.brennan@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp993452wru; Fri, 11 Nov 2022 14:19:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf64YL3eIRcXdciqWIVm6zm9+AlhOpdxZe+RgKHWjsvDplhiylPyivlgfCkdtwnzMWDuOk7l X-Received: by 2002:a62:8745:0:b0:562:e790:dfe0 with SMTP id i66-20020a628745000000b00562e790dfe0mr4636433pfe.16.1668205158794; Fri, 11 Nov 2022 14:19:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668205158; cv=pass; d=google.com; s=arc-20160816; b=tI5RJWoOnfTomLUwWeM9s9gIH6HKJOpQGmGzLdraJQHyoCWAkk50ywR+CNQ1uveeUQ RYJeINiCLgOSwM3Gp7WDBn0jUPG/LesONOMsp7/vKt9XBhDcSi26l1jtTwJxDoD4f4Qs Jxl69681aBjQCN1kVvugoYTBIdWDRw/H3REoduz/wq/NWwMguQvm670YT9Ale4Dz1ee7 T2CKtjhNX17hVc3rJnO12nc3Tj5FGg1WPstFKvdgSgonj3U98TG0kQ8AKb/UXePtQqdg lGzPVs8DtzgragHALuI0GTzPAVVEP512OnWGGvIacaVDXHuU05tIPuj1oWB1KKN+QKW4 gkag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=wFpbesVg/nz+VUPlEsYVZunVsPHTHm38szTsgXmNXsM=; b=XmM45t8PMfZ0IsKagl+3fqFpmmVyT2hOGfpst65FzyHAqPrW8PLAOqqgpmda0DvpPi 4q/BD3/PuuEY4pklA3hUFriI6AbCOScY85ZpX2eWNhQezFjlNtHt8ujBWlAEX00qwK/M tDXmYZvCjseK331IMO3AIixpmIslprjRe0NWSsVrYwiKY0N2pfC/nXl1eCUcvoHm9hkc 1UxItutPNGpucwY51/6vva33v4Xvw5WFKVaHKs7yEri1FHQH3qRFJ0stem8KMillXDJi Yrt3UHhk01pV1da64oiGeIXLS+Iw/G1btfxUmdfYjuxzHTTkSm+RmAmrxZF2Z4icHSmL L4Hg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=uI6iNXcD; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Y6IhWhV4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w24-20020a63c118000000b0042b4defce13si3552107pgf.344.2022.11.11.14.19.04; Fri, 11 Nov 2022 14:19:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=uI6iNXcD; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Y6IhWhV4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233363AbiKKWHk (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Fri, 11 Nov 2022 17:07:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234569AbiKKWHO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 11 Nov 2022 17:07:14 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 102F143AE7; Fri, 11 Nov 2022 14:06:49 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2ABLomDe025514; Fri, 11 Nov 2022 22:06:46 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 : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=wFpbesVg/nz+VUPlEsYVZunVsPHTHm38szTsgXmNXsM=; b=uI6iNXcDWkuLhWogJxLHE1C00OPbOEcLun9h8zI+fB2i13GcLTnIGN7JtckcyF9fv6kf U+hAcM60wFaIbq9nrXGlk/JtPZgAmbXrg8Ky0Ttj6HhUVh920sfwbaH/O4tsxA1n/HOi GfPxREClNjQpdurOlY+ZZXC5oPvFwQXsmVI1CYi0HT8NqudUqL8FGQwXgP0e4rTh5euQ unKG6Yn/TwOSgesdhyrmr2en9hJSza8DARMxkw2KvRa9/CERbkF/A+O5g4BPlx+lQUKJ cWeCMDX9c6cVMe7BybYzuiB0xdvJerrDX3Kdk5D96Cg8jCE4NDHG6tZsd4em+7azjeB4 4w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ksxnrr13k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Nov 2022 22:06:44 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ABLUOuw022311; Fri, 11 Nov 2022 22:06:27 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2172.outbound.protection.outlook.com [104.47.73.172]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kpcytsv08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Nov 2022 22:06:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XedXquWRNvlCDD3RbEvWfsRLtKWe0KNkc0Rr1Ml7msi0V2K1q7PI4pdlAkU2JTBM/Lrjo6u0zoRThHwMYJeT7SADwxwtKElgdo7CgDj2tO/B9pCBuhC6gXRaw9EoXLUOUrgn7Ks91MgHyE0ul2bS1uyH1wtPmExLjoDyKDQ3PLpY8KbzZ/VADzyAYlXppyY447+5IsdklujEOe2b34R6Dk2DIris0LXCkvHN4JBqLHGH88BEakr+nps+WSNMw3eUEthfv2kzicmxvQVegA6ev08hXjuAoD56Bym4ar5/T9e7QG+PNELIaXmaKi1Pg9mlAPnjqLlBbN6BLE9LDSv5AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wFpbesVg/nz+VUPlEsYVZunVsPHTHm38szTsgXmNXsM=; b=HjKV+eRQdteUnBBSJBAq66EGI+v+7bWSMfpRCd1Ma4OMYImZKyRy513y3Ct28jUOsEf2b1uJmJ4v11P75gc+1C4rzyBXPdrb3+Lg7OkbisaxMSEE7UWXK7h511TPDBtJ4GejbPoAJAbzOIhMy4vcF8h/MlMq8sB7pA80KTpFzpYbeFdPV+tsSlO+yUH3Brq1vto8JaLuAP+WJSyUdWDaXQH3TL5RwcVXF4n8WTSNsIFvjBma2eJtLSyemYZsqPIhCMoyvjheK1BSjAfzDVliuD7PuF8/cphCFG8IvwsXQ2DGf5Yh383E4NoR7W5z0T+s9yZ0eO6o5Xt4a7FM3/53xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wFpbesVg/nz+VUPlEsYVZunVsPHTHm38szTsgXmNXsM=; b=Y6IhWhV4vbAkwE0Rt6X3WF79fyRbDy4IlSGQT4huzx/SK1OHDFptI5YuQKy6kyCjxYdDq5kDhi0QWQh7KfbzpdGvLm8ddOLWX9zFCOdw6PzRcr2DG7PoPd43NwMhZvqnw4cnqpZAfEwb7kbSM+4xLEwUu8dDMnGRRUYkhk6rouI= Received: from CH2PR10MB4166.namprd10.prod.outlook.com (2603:10b6:610:78::20) by PH0PR10MB4535.namprd10.prod.outlook.com (2603:10b6:510:31::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.14; Fri, 11 Nov 2022 22:06:25 +0000 Received: from CH2PR10MB4166.namprd10.prod.outlook.com ([fe80::c544:e51b:19a0:35b2]) by CH2PR10MB4166.namprd10.prod.outlook.com ([fe80::c544:e51b:19a0:35b2%7]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 22:06:25 +0000 From: Stephen Brennan <stephen.s.brennan@oracle.com> To: Jan Kara <jack@suse.cz> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>, Stephen Brennan <stephen.s.brennan@oracle.com>, Amir Goldstein <amir73il@gmail.com> Subject: [PATCH v4 4/5] fsnotify: allow sleepable child flag update Date: Fri, 11 Nov 2022 14:06:13 -0800 Message-Id: <20221111220614.991928-5-stephen.s.brennan@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221111220614.991928-1-stephen.s.brennan@oracle.com> References: <20221028001016.332663-1-stephen.s.brennan@oracle.com> <20221111220614.991928-1-stephen.s.brennan@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN7PR04CA0112.namprd04.prod.outlook.com (2603:10b6:806:122::27) To CH2PR10MB4166.namprd10.prod.outlook.com (2603:10b6:610:78::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR10MB4166:EE_|PH0PR10MB4535:EE_ X-MS-Office365-Filtering-Correlation-Id: 3825e25f-5399-4873-5e03-08dac430f989 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1TMMcGcBWb/3ISOWaUqoHEjv4qQ4WhU9iIzyM+VJc84dDnkIbNXh+4tE5I2jwOhJ2OiAmFbTiOyn0vtqurGeNWhTgkYwEPNry0t24zDUzT3muwJv5p53xx3RE0SVYvvdp5QXisUaSkPghkCjxsvQn+sCYur4f13GFdk6Gil48lFo28i+XCi/dv+h/8dMMrsKt5rVmCHpXYAmdMK/dJ0lhmxziKCCtNr5h+9OG6Mb/4fYDnbwicgGBSozmW1gy49cKl/71/4oayhyA4bqkDvBhXk6DduicRKbPqB5GrTAYVqopgCvXv6lYddLjzfLaXXULoxenmHThUaSwgCCEfGRhIH+2Chyq3xTM8LRZ0xKf+3+XE21KGNdauvDzeVchikZtCTFWMFo0CRsfSILNrToUhn8rpLLXPEUIlqL2u/+8z/8H3ieQDTU1zBN3C7XuP92juGZTGlsKmjU2Xhwy144zsM2Qh4krATmWhvyj7tbiRdziPe8qFZAFPM7fI3FgO0poDmPjg4XpRo116irww/OORDA8T5UmqtUe0u5PA74bwwvWPv8qqu4bWY63aU1P1/EbVDJat50ezz18VnxuEZ+hg5uPVGFpgBqTQArbTyaQNQWJaSCXePIBinIYCufNUkwIH0vwm8Cbp8lKE+mBW+7GGTz/WRPflgVvVN0TFpVRpkZzw8nEY/xzTv5X/xWTicZx+0foLZ1JTDYMVG642GiJA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR10MB4166.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(39860400002)(346002)(396003)(376002)(366004)(451199015)(86362001)(83380400001)(103116003)(38100700002)(66946007)(2906002)(15650500001)(8936002)(5660300002)(4326008)(8676002)(66476007)(41300700001)(186003)(6506007)(26005)(1076003)(66556008)(6512007)(6666004)(54906003)(2616005)(6916009)(316002)(6486002)(478600001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kWLlrnwiUJLxpQDIrVy3XIAn+/7A6Iax/+lCF17mfd+p9pJI96eYyme3NChba9Wed/fyF0sylJHQDPxbHPy2CpA5fPm4Tm8eHad1ZCuB9S838x8y07pbcU42PRxjzl/P4lNWlrRf/YekSuABIDskcD1K1sYfIajJn6ymhgVckTf/UAyEmozFnkH9mOHugJSW/fWp8Psg6XitGQ0hmPMxFCNUdET56XmDo9ucJy67/r6G4RIFqhJA1AQzMjzRiLsW/vHyu0558y0lDVdpaH+4FhztGDnieGT218o5vSGpEI6UyQuPy+kNiEDGbtH+DP7bDiDGq72aoxcyc5Btb2CyPWY0fP1bjha9WvsgoNIwzF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bFoE3QXBVIiv6uHy0OzBbG9vvjfYgAdWBUHXc1DYaI3/ZNv0ZUOKFFISEUReOdIAWiYsEofIU8HmX1WEt2wQ7bmrZJomNGnR/iFh9FSMVy5LCoxFw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3825e25f-5399-4873-5e03-08dac430f989 X-MS-Exchange-CrossTenant-AuthSource: CH2PR10MB4166.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 22:06:25.1912 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qVJXA8GYCDGzp61qLhOXARA8bg23L3qTtnMlEXIqE0zrcy9xkKpe5aXKUl0xBxHRYWDY7mJt1UoU3R4Vl5m6/NYurnFPci8lQe4/dNo5sOk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4535 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-11_11,2022-11-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211110149 X-Proofpoint-GUID: F6UNK_18169HMcm9l9SOvn3s6v2wHvvi X-Proofpoint-ORIG-GUID: F6UNK_18169HMcm9l9SOvn3s6v2wHvvi X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746998715860817796?= X-GMAIL-MSGID: =?utf-8?q?1749239892528793560?= |
Series |
fsnotify: fix softlockups iterating over d_subdirs
|
|
Commit Message
Stephen Brennan
Nov. 11, 2022, 10:06 p.m. UTC
With very large d_subdirs lists, iteration can take a long time. Since
iteration needs to hold alias->d_lock, this can trigger soft lockups.
It would be best to make this iteration sleepable. We can drop
alias->d_lock and sleep, by taking a reference to the current child.
However, we need to be careful, since it's possible for the child's
list pointers to be modified once we drop alias->d_lock. The following
are the only cases where the list pointers are modified:
1. dentry_unlist() in fs/dcache.c
This is a helper of dentry_kill(). This function is quite careful to
check the reference count of the dentry once it has taken the
requisite locks, and bail out if a new reference was taken. So we
can be safe that, assuming we found the dentry and took a reference
before dropping alias->d_lock, any concurrent dentry_kill() should
bail out and leave our list pointers untouched.
2. __d_move() in fs/dcache.c
If the child was moved to a new parent, then we can detect this by
testing d_parent and retrying the iteration.
3. Initialization code in d_alloc() family
We are safe from this code, since we cannot encounter a dentry until
it has been initialized.
4. Cursor code in fs/libfs.c for dcache_readdir()
Dentries with DCACHE_DENTRY_CURSOR should be skipped before sleeping,
since we could awaken to find they have skipped over a portion of the
child list.
Given these considerations, we can carefully write a loop that iterates
over d_subdirs and is capable of going to sleep periodically.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
---
Notes:
v4:
- I've updated this patch so it should be safe even without the
inode locked, by handling cursors and d_move() races.
- Moved comments to lower indentation
- I didn't keep Amir's R-b since this was a fair bit of change.
v3:
- removed if statements around dput()
v2:
- added a check for child->d_parent != alias and retry logic
fs/notify/fsnotify.c | 46 ++++++++++++++++++++++++++++++++++++++++----
1 file changed, 42 insertions(+), 4 deletions(-)
Comments
On Sat, Nov 12, 2022 at 12:06 AM Stephen Brennan <stephen.s.brennan@oracle.com> wrote: > > With very large d_subdirs lists, iteration can take a long time. Since > iteration needs to hold alias->d_lock, this can trigger soft lockups. > It would be best to make this iteration sleepable. We can drop > alias->d_lock and sleep, by taking a reference to the current child. > However, we need to be careful, since it's possible for the child's > list pointers to be modified once we drop alias->d_lock. The following > are the only cases where the list pointers are modified: > > 1. dentry_unlist() in fs/dcache.c > > This is a helper of dentry_kill(). This function is quite careful to > check the reference count of the dentry once it has taken the > requisite locks, and bail out if a new reference was taken. So we > can be safe that, assuming we found the dentry and took a reference > before dropping alias->d_lock, any concurrent dentry_kill() should > bail out and leave our list pointers untouched. > > 2. __d_move() in fs/dcache.c > > If the child was moved to a new parent, then we can detect this by > testing d_parent and retrying the iteration. > > 3. Initialization code in d_alloc() family > > We are safe from this code, since we cannot encounter a dentry until > it has been initialized. > > 4. Cursor code in fs/libfs.c for dcache_readdir() > > Dentries with DCACHE_DENTRY_CURSOR should be skipped before sleeping, > since we could awaken to find they have skipped over a portion of the > child list. > > Given these considerations, we can carefully write a loop that iterates > over d_subdirs and is capable of going to sleep periodically. > > Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com> > --- > > Notes: > v4: > - I've updated this patch so it should be safe even without the > inode locked, by handling cursors and d_move() races. > - Moved comments to lower indentation > - I didn't keep Amir's R-b since this was a fair bit of change. > v3: > - removed if statements around dput() > v2: > - added a check for child->d_parent != alias and retry logic > > fs/notify/fsnotify.c | 46 ++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 42 insertions(+), 4 deletions(-) > > diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c > index 409d479cbbc6..0ba61211456c 100644 > --- a/fs/notify/fsnotify.c > +++ b/fs/notify/fsnotify.c > @@ -105,7 +105,7 @@ void fsnotify_sb_delete(struct super_block *sb) > */ > void fsnotify_update_children_dentry_flags(struct inode *inode, bool watched) > { > - struct dentry *alias, *child; > + struct dentry *alias, *child, *last_ref = NULL; > > if (!S_ISDIR(inode->i_mode)) > return; > @@ -116,12 +116,49 @@ void fsnotify_update_children_dentry_flags(struct inode *inode, bool watched) > return; > > /* > - * run all of the children of the original inode and fix their > - * d_flags to indicate parental interest (their parent is the > - * original inode) > + * These lists can get very long, so we may need to sleep during > + * iteration. Normally this would be impossible without a cursor, > + * but since we have the inode locked exclusive, we're guaranteed Not exactly true for v4 patchset order, but I do prefer that we make it true. > + * that the directory won't be modified, so whichever dentry we > + * pick to sleep on won't get moved. So, start a manual iteration > + * over d_subdirs which will allow us to sleep. > */ > spin_lock(&alias->d_lock); > +retry: Better if we can avoid this retry by inode lock. Note that it is enough to take inode_lock_shared() to protect this code. It means that tasks doing remove+add parent watch may iterate d_subdirs in parallel, but maybe that's even better then having them iterate d_subdirs sequentially? > list_for_each_entry(child, &alias->d_subdirs, d_child) { > + /* > + * We need to hold a reference while we sleep. But we cannot > + * sleep holding a reference to a cursor, or we risk skipping > + * through the list. > + * > + * When we wake, dput() could free the dentry, invalidating the > + * list pointers. We can't look at the list pointers until we > + * re-lock the parent, and we can't dput() once we have the > + * parent locked. So the solution is to hold onto our reference > + * and free it the *next* time we drop alias->d_lock: either at > + * the end of the function, or at the time of the next sleep. > + */ My usual nit picking: you could concat this explanation to the comment outside the loop. It won't make it any less clear, maybe even more clear in the wider context of how the children are safely iterated. Thanks, Amir.
Hi, Stephen Brennan, we made report upon v1 patch https://lore.kernel.org/all/202210271500.731e3808-yujie.liu@intel.com/ now we noticed similar issue still on v4. FYI. Greeting, FYI, we noticed WARNING:possible_recursive_locking_detected due to commit (built with gcc-11): commit: 5482581c7c96a8fe60bb29c181e86cdc9889b068 ("[PATCH v4 4/5] fsnotify: allow sleepable child flag update") url: https://github.com/intel-lab-lkp/linux/commits/Stephen-Brennan/fsnotify-clear-PARENT_WATCHED-flags-lazily/20221112-070656 base: https://git.kernel.org/cgit/linux/kernel/git/jack/linux-fs.git fsnotify patch subject: [PATCH v4 4/5] fsnotify: allow sleepable child flag update in testcase: boot on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace): If you fix the issue, kindly add following tag | Reported-by: kernel test robot <oliver.sang@intel.com> | Link: https://lore.kernel.org/oe-lkp/202211151309.1fdf8fd0-oliver.sang@intel.com [ 16.419535][ T369] WARNING: possible recursive locking detected [ 16.420080][ T369] 6.0.0-rc4-00068-g5482581c7c96 #1 Not tainted [ 16.420595][ T369] -------------------------------------------- [ 16.421105][ T369] dnsmasq/369 is trying to acquire lock: [ 16.421578][ T369] bfaa3858 (&dentry->d_lock){+.+.}-{2:2}, at: lockref_get (??:?) [ 16.422251][ T369] [ 16.422251][ T369] but task is already holding lock: [ 16.422868][ T369] bf804d60 (&dentry->d_lock){+.+.}-{2:2}, at: fsnotify_update_children_dentry_flags (??:?) [ 16.423733][ T369] [ 16.423733][ T369] other info that might help us debug this: [ 16.424438][ T369] Possible unsafe locking scenario: [ 16.424438][ T369] [ 16.425082][ T369] CPU0 [ 16.425376][ T369] ---- [ 16.425660][ T369] lock(&dentry->d_lock); [ 16.426052][ T369] lock(&dentry->d_lock); [ 16.426439][ T369] [ 16.426439][ T369] *** DEADLOCK *** [ 16.426439][ T369] [ 16.427109][ T369] May be due to missing lock nesting notation [ 16.427109][ T369] [ 16.427808][ T369] 2 locks held by dnsmasq/369: [ 16.428219][ T369] #0: 409474b0 (&group->mark_mutex){+.+.}-{3:3}, at: inotify_update_watch (inotify_user.c:?) [ 16.429047][ T369] #1: bf804d60 (&dentry->d_lock){+.+.}-{2:2}, at: fsnotify_update_children_dentry_flags (??:?) [ 16.430016][ T369] [ 16.430016][ T369] stack backtrace: [ 16.430538][ T369] CPU: 1 PID: 369 Comm: dnsmasq Not tainted 6.0.0-rc4-00068-g5482581c7c96 #1 [ 16.431276][ T369] Call Trace: [ 16.431560][ T369] ? dump_stack_lvl (??:?) [ 16.431990][ T369] ? dump_stack (??:?) [ 16.432347][ T369] ? validate_chain.cold (lockdep.c:?) [ 16.432791][ T369] ? __lock_acquire (lockdep.c:?) [ 16.433233][ T369] ? lock_acquire (??:?) [ 16.433651][ T369] ? lockref_get (??:?) [ 16.434034][ T369] ? __lock_release (lockdep.c:?) [ 16.434454][ T369] ? fsnotify_update_children_dentry_flags (??:?) [ 16.435069][ T369] ? _raw_spin_lock (??:?) [ 16.435465][ T369] ? lockref_get (??:?) [ 16.435832][ T369] ? lockref_get (??:?) [ 16.436190][ T369] ? fsnotify_update_children_dentry_flags (??:?) [ 16.436753][ T369] ? fsnotify_recalc_mask (??:?) [ 16.437229][ T369] ? fsnotify_add_mark_locked (??:?) [ 16.437716][ T369] ? inotify_new_watch (inotify_user.c:?) [ 16.438166][ T369] ? inotify_update_watch (inotify_user.c:?) [ 16.438627][ T369] ? __ia32_sys_inotify_add_watch (??:?) [ 16.439183][ T369] ? do_int80_syscall_32 (??:?) [ 16.439640][ T369] ? entry_INT80_32 (entry_32.o:?) LKP: ttyS0: 641: Kernel tests: Boot OK! LKP: ttyS0: 641: HOSTNAME vm-snb, MAC 52:54:00:12:34:56, kernel 6.0.0-rc4-00068-g5482581c7c96 1 LKP: ttyS0: 641: /lkp/lkp/src/bin/run-lkp /lkp/jobs/scheduled/vm-meta-42/boot-1-openwrt-i386-generic-20190428.cgz-5482581c7c96a8fe60bb29c181e86cdc9889b068-20221115-34610-11px8cv-40.yaml [ 18.633802][ T655] mkdir: can't create directory '/sys/kernel/debug': Operation not permitted [ 18.633802][ T655] mount: mounting debug on /sys/kernel/debug failed: No such file or directory [ 21.139501][ T856] process 856 (wait) attempted a POSIX timer syscall while CONFIG_POSIX_TIMERS is not set [ 32.651080][ T957] rsync (957) used greatest stack depth: 6208 bytes left LKP: ttyS0: 641: LKP: rebooting forcely [ 42.464678][ T641] sysrq: Emergency Sync [ 42.465117][ T641] sysrq: Resetting Kboot worker: lkp-worker53 Elapsed time: 60 kvm=( qemu-system-x86_64 -enable-kvm -cpu SandyBridge -kernel $kernel -initrd initrd-vm-meta-42.cgz -m 16384 -smp 2 -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::32032-:22 -boot order=nc -no-reboot -device i6300esb -watchdog-action debug -rtc base=localtime -serial stdio -display none -monitor null ) append=( ip=::::vm-meta-42::dhcp root=/dev/ram0 RESULT_ROOT=/result/boot/1/vm-snb/openwrt-i386-generic-20190428.cgz/i386-randconfig-a011-20210930/gcc-11/5482581c7c96a8fe60bb29c181e86cdc9889b068/73 BOOT_IMAGE=/pkg/linux/i386-randconfig-a011-20210930/gcc-11/5482581c7c96a8fe60bb29c181e86cdc9889b068/vmlinuz-6.0.0-rc4-00068-g5482581c7c96 branch=linux-review/Stephen-Brennan/fsnotify-clear-PARENT_WATCHED-flags-lazily/20221112-070656 job=/job-script user=lkp ARCH=i386 kconfig=i386-randconfig-a011-20210930 commit=5482581c7c96a8fe60bb29c181e86cdc9889b068 vmalloc=256M initramfs_async=0 page_owner=on initcall_debug max_uptime=600 result_service=tmpfs selinux=0 debug apic=debug To reproduce: # build kernel cd linux cp config-6.0.0-rc4-00068-g5482581c7c96 .config make HOSTCC=gcc-11 CC=gcc-11 ARCH=i386 olddefconfig prepare modules_prepare bzImage modules make HOSTCC=gcc-11 CC=gcc-11 ARCH=i386 INSTALL_MOD_PATH=<mod-install-dir> modules_install cd <mod-install-dir> find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz git clone https://github.com/intel/lkp-tests.git cd lkp-tests bin/lkp qemu -k <bzImage> -m modules.cgz job-script # job-script is attached in this email # if come across any failure that blocks the test, # please remove ~/.lkp and /lkp dir to run from a clean state.
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 409d479cbbc6..0ba61211456c 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -105,7 +105,7 @@ void fsnotify_sb_delete(struct super_block *sb) */ void fsnotify_update_children_dentry_flags(struct inode *inode, bool watched) { - struct dentry *alias, *child; + struct dentry *alias, *child, *last_ref = NULL; if (!S_ISDIR(inode->i_mode)) return; @@ -116,12 +116,49 @@ void fsnotify_update_children_dentry_flags(struct inode *inode, bool watched) return; /* - * run all of the children of the original inode and fix their - * d_flags to indicate parental interest (their parent is the - * original inode) + * These lists can get very long, so we may need to sleep during + * iteration. Normally this would be impossible without a cursor, + * but since we have the inode locked exclusive, we're guaranteed + * that the directory won't be modified, so whichever dentry we + * pick to sleep on won't get moved. So, start a manual iteration + * over d_subdirs which will allow us to sleep. */ spin_lock(&alias->d_lock); +retry: list_for_each_entry(child, &alias->d_subdirs, d_child) { + /* + * We need to hold a reference while we sleep. But we cannot + * sleep holding a reference to a cursor, or we risk skipping + * through the list. + * + * When we wake, dput() could free the dentry, invalidating the + * list pointers. We can't look at the list pointers until we + * re-lock the parent, and we can't dput() once we have the + * parent locked. So the solution is to hold onto our reference + * and free it the *next* time we drop alias->d_lock: either at + * the end of the function, or at the time of the next sleep. + */ + if (child->d_flags & DCACHE_DENTRY_CURSOR) + continue; + if (need_resched()) { + dget(child); + spin_unlock(&alias->d_lock); + dput(last_ref); + last_ref = child; + cond_resched(); + spin_lock(&alias->d_lock); + /* Check for races with __d_move() */ + if (child->d_parent != alias) + goto retry; + } + + /* + * This check is after the cond_resched() for a reason: it is + * safe to sleep holding a negative dentry reference. If the + * directory contained many negative dentries, and we skipped + * them checking need_resched(), we may never end up sleeping + * where necessary, and could trigger a soft lockup. + */ if (!child->d_inode) continue; @@ -133,6 +170,7 @@ void fsnotify_update_children_dentry_flags(struct inode *inode, bool watched) spin_unlock(&child->d_lock); } spin_unlock(&alias->d_lock); + dput(last_ref); dput(alias); }