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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 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 9F763C43603 for ; Mon, 16 Dec 2019 18:57:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 522242067C for ; Mon, 16 Dec 2019 18:57:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="QmU/A5u1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 522242067C 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 D3C268E0011; Mon, 16 Dec 2019 13:57:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CECED8E0003; Mon, 16 Dec 2019 13:57:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDBB08E0011; Mon, 16 Dec 2019 13:57:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id A63568E0003 for ; Mon, 16 Dec 2019 13:57:05 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 57D9B40F1 for ; Mon, 16 Dec 2019 18:57:05 +0000 (UTC) X-FDA: 76271912010.25.pet81_5aee3421c4200 X-HE-Tag: pet81_5aee3421c4200 X-Filterd-Recvd-Size: 7404 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Dec 2019 18:57:04 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBGIsESc100272; Mon, 16 Dec 2019 18:57:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type; s=corp-2019-08-05; bh=IAQFKGTHjuk3eEqT8Ck2Sxz/E/v7yiRjR2XC/PNMBDo=; b=QmU/A5u1Zx5zHLmpPaaTIH2iTfRS2KDu3j1E48fkTxZF4f9UkbBj6gp+p1R/C4yvMTu8 Eq2somo0PfmIc7SynQBNLPk4PBmz/WIUTKPMeYaMJBLsFQa/lLePBQVbHKMAAOezFr0k y1RRjknj77do6lEcOPHFs6KMIJzgfQ7zSAycfChSBaGuYSiZWd4F+yeYAJ0P2egeWsVU akhXZFGCgbI/GQuEkXELGQxJNzfBoKmcmafXU+yBeQgPtXqv9eXJWTcHx5xipMKftMMw SXYPoqT0EkrGjp96Nw0yOAyQ78W1q/MwNvbQzunkIICbw6J1A79UnWKcZmTHO2Wn7w+9 Ug== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2wvrcr1gc2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2019 18:57:02 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBGIrxXM172561; Mon, 16 Dec 2019 18:57:02 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2ww9vptnhp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2019 18:57:02 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xBGIv1nh021398; Mon, 16 Dec 2019 18:57:01 GMT Received: from Junxiaos-MacBook-Pro.local (/10.11.16.208) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Dec 2019 10:56:58 -0800 Subject: Re: [PATCH] vfs: stop shrinker while fs is freezed To: Dave Chinner , "Darrick J. Wong" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-mm@kvack.org References: <20191213222440.11519-1-junxiao.bi@oracle.com> <20191214004012.GC99868@magnolia> <20191216041128.GK19213@dread.disaster.area> From: Junxiao Bi Message-ID: <18e4b8ca-13d6-4c37-7248-006a0bab19d7@oracle.com> Date: Mon, 16 Dec 2019 10:56:53 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191216041128.GK19213@dread.disaster.area> Content-Type: multipart/alternative; boundary="------------B7DC14F48C68B4F3E71AC29F" Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9473 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912160160 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9473 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912160160 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: This is a multi-part message in MIME format. --------------B7DC14F48C68B4F3E71AC29F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 12/15/19 8:11 PM, Dave Chinner wrote: >>> diff --git a/fs/super.c b/fs/super.c >>> index cfadab2cbf35..adc18652302b 100644 >>> --- a/fs/super.c >>> +++ b/fs/super.c >>> @@ -80,6 +80,11 @@ static unsigned long super_cache_scan(struct shrinker *shrink, >>> if (!trylock_super(sb)) >>> return SHRINK_STOP; >>> >>> + if (sb->s_writers.frozen != SB_UNFROZEN) { >>> + up_read(&sb->s_umount); >>> + return SHRINK_STOP; >>> + } >> Whatever happened to "let's just fsfreeze the filesystems shortly before >> freezing the system? Did someone find a reason why that wouldn't work? >> >> Also, uh, doesn't this disable memory reclaim for frozen filesystems? >> >> Maybe we all need to go review the xfs io-less inode reclaim series so >> we can stop running transactions in reclaim... I can't merge any of it >> until the mm changes go upstream. > IO-less reclaim doesn't prevent ->destroy_inode from having to run > transactions. e.g. this is the path through which unlink does inode > freeing. Background inode inactivation is the patchset that > addresses this problem...:) Sound backgroup inode inactivation is only for xfs? I suppose this is a generic issue, other fs will also suffer this? Thanks, Junxiao. > > Cheers, > > Dave. --------------B7DC14F48C68B4F3E71AC29F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit


On 12/15/19 8:11 PM, Dave Chinner wrote:
diff --git a/fs/super.c b/fs/super.c
index cfadab2cbf35..adc18652302b 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -80,6 +80,11 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
 	if (!trylock_super(sb))
 		return SHRINK_STOP;
 
+	if (sb->s_writers.frozen != SB_UNFROZEN) {
+		up_read(&sb->s_umount);
+		return SHRINK_STOP;
+	}
Whatever happened to "let's just fsfreeze the filesystems shortly before
freezing the system?  Did someone find a reason why that wouldn't work?

Also, uh, doesn't this disable memory reclaim for frozen filesystems?

Maybe we all need to go review the xfs io-less inode reclaim series so
we can stop running transactions in reclaim... I can't merge any of it
until the mm changes go upstream.
IO-less reclaim doesn't prevent ->destroy_inode from having to run
transactions. e.g. this is the path through which unlink does inode
freeing. Background inode inactivation is the patchset that
addresses this problem... :)

Sound backgroup inode inactivation is only for xfs? I suppose this is a generic issue, other fs will also suffer this?

Thanks,

Junxiao.


Cheers,

Dave.
--------------B7DC14F48C68B4F3E71AC29F--