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 C6276C07E95 for ; Sat, 3 Jul 2021 03:36:11 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C3BB613E5 for ; Sat, 3 Jul 2021 03:36:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C3BB613E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mit.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GGyKP0nxhz305y for ; Sat, 3 Jul 2021 13:36:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=mit.edu (client-ip=18.9.28.11; helo=outgoing.mit.edu; envelope-from=tytso@mit.edu; receiver=) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GGyJy5zGsz2ymQ for ; Sat, 3 Jul 2021 13:35:44 +1000 (AEST) 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 1633ZBda007796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Jul 2021 23:35:12 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id D29EF15C3CE6; Fri, 2 Jul 2021 23:35:11 -0400 (EDT) Date: Fri, 2 Jul 2021 23:35:11 -0400 From: "Theodore Ts'o" To: Zhang Yi Subject: Re: [powerpc][5.13.0-next-20210701] Kernel crash while running ltp(chdir01) tests Message-ID: References: <26ACA75D-E13D-405B-9BFC-691B5FB64243@linux.vnet.ibm.com> <4cc87ab3-aaa6-ed87-b690-5e5b99de8380@huawei.com> <03f734bd-f36e-f55b-0448-485b8a0d5b75@huawei.com> <36778615-86fd-9a19-9bc9-f93a6f2d5817@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36778615-86fd-9a19-9bc9-f93a6f2d5817@huawei.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sachin Sant , Jan Kara , Guoqing Jiang , "linux-fsdevel@vger.kernel.org" , Ext4 Developers List , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sat, Jul 03, 2021 at 11:05:07AM +0800, Zhang Yi wrote: > > Originally, I want to add this shrinker as a optional feature for jbd2 because > only ext4 use it now and I'm not sure does ocfs2 needs this feature. So I export > jbd2_journal_[un]register_shrinker(), ext4 could invoke them individually. The reason why bdev_try_to_free_page() callback was needed for ext4 --- namely so there was a way to release checkpointed buffers under memory pressure --- also exists for ocfs2. It was probably true that in most deployments of ocfs2, they weren't running with super-tight memory availability, so it may not have been necessary the same way that it might be necessary, say, if ext4 was being used on a Rasberry Pi. :-) > And one more thing we to could do is rename the 'j_jh_shrink_count' to something > like 'j_checkpoint_jh_count' because we always init it no matter we register the > shrinker or not later. That makes sense. In fact, unless I'm mistaken, I don't think it's legal to call percpu_counter_{inc,dec} if the shrinker isn't initialized. So for ocfs2, if we didn't initialize percpu_counter, when __jbd2_journal_insert_checkpoint() tries to call percpu_counter_inc(), I believe things would potentially go *boom* on some implementations of the percpu counter (e.g., on Power and ARM). So not only would it not hurt to register the shrinker for ocfs2, I think it's required. So yeah, let's rename it to something like j_checkpoint_jh_count, and then let's inline jbd2_journal_[un]register_shrinker() in journal_init_common() and jbd2_journal_unregister_shrinker(). What do you think? - Ted