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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 B400AC433B4 for ; Fri, 23 Apr 2021 14:41:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B05D61422 for ; Fri, 23 Apr 2021 14:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242623AbhDWOmC (ORCPT ); Fri, 23 Apr 2021 10:42:02 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:40274 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230416AbhDWOmB (ORCPT ); Fri, 23 Apr 2021 10:42:01 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 13NEeckv032357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Apr 2021 10:40:39 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 8FF8315C3B0D; Fri, 23 Apr 2021 10:40:38 -0400 (EDT) Date: Fri, 23 Apr 2021 10:40:38 -0400 From: "Theodore Ts'o" To: Jan Kara Cc: Christoph Hellwig , Zhang Yi , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, adilger.kernel@dilger.ca, yukuai3@huawei.com Subject: Re: [RFC PATCH v2 7/7] ext4: fix race between blkdev_releasepage() and ext4_put_super() Message-ID: References: <20210414134737.2366971-1-yi.zhang@huawei.com> <20210414134737.2366971-8-yi.zhang@huawei.com> <20210415145235.GD2069063@infradead.org> <20210420130841.GA3618564@infradead.org> <20210421134634.GT8706@quack2.suse.cz> <20210422090410.GA26221@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210422090410.GA26221@quack2.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Apr 22, 2021 at 11:04:11AM +0200, Jan Kara wrote: > Yes, I understand that. What I was more asking about is: Does it really > matter we leave those buffer heads and journal heads unreclaimed. I > understand it could be triggering premature OOM in theory but is it a > problem in practice? Was there some observed practical case for which this > was added or was it just added due to the theoretical concern? I was doing some research, and found the mail thread which inspired bdev_try_to_free_page(): https://lore.kernel.org/linux-ext4/20081202200647.72cc5807.toshi.okajima@jp.fujitsu.com/ >From what I can tell Toshi Okajima did have a test workload which would trigger blkdev_releasepage(). He didn't specify it in the mail thread as near as I can tell, but he did use it to test the page. Thinking about it, it shouldn't be hard to trigger it via something like: find /mnt -print0 | xargs -0 touch in a memory contrained box with a large file system attached (a bookshelf NAS scenario). Under the right circumstances, I'm pretty sure a premature OOM could be demonstrated. - Ted