Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2044898pxv; Fri, 2 Jul 2021 20:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR9gk1zbSI30qxANYVTzRLzrk7jpuACL1airVDKgJC84w08KcPiaoFSClTiGlESnLZtlZS X-Received: by 2002:a05:6402:1776:: with SMTP id da22mr2960360edb.133.1625283476530; Fri, 02 Jul 2021 20:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625283476; cv=none; d=google.com; s=arc-20160816; b=Tgn7REmpOxuVPE3tYL7lONPe/zKmUOEm8+k70xs3X++hJxEPmPS2I21wwV3nr/0yPV EAZVFKnhAfh4N/7pCtWCzRlezQvXZXNDBW5GdFljtN9/2VhEKVBFFmFafw3XjfohCUbe X8CPABEbrECSJgW/Y2DQ7QJntD/3a17ZYp38uRMJNf74+Reo0hH/jErnrFw17wrKq5qx o1BNMtUnSnFBWPru4bwJc58B85zpvfnrQhNcaAKvfoP2xrFzlz/aGPGgUBKBBRgnmj5a yZmyTx/PUz9rUZOaOCdvBOPKS7vuPicrWnYn+4Vrrw6hmg8oAraS5UVEQU6vxHszDe25 wPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=IGxk7gqy//dwTVB8nb5fi4sHElxva3II8jh60op5JvE=; b=jmHXR9VMEC3kK16GFWsCtzGaqGQaSAx6HWE+M4zy4FRHuLJn+9z2aLNrFvyz+gWeMf p+hkYCb/SNWHA1IXCj7Y9gfjl0rxoiDjiSYrffBlc0Ryq7vhrWIopPEkxsbmy+q6PVPF gf503MCfJ0NreZ4bXJXnLQJiH130ecZlRaVCM+AZCWKoEGX8vLXM7+7zLfv8p33DBLuT QTWT1cy5QW8wbpxF9kyHdAxNaBN52aVZglPDc7JxvetmtHiozg5vn61b4my6D8rw7jYT V4WISK+J3K8eAQYG0Up65uteSZRRvmrLzBzafw33VnQPzKnfb2S69z7+iPiC0QHI1OcC f6Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si4787117edv.567.2021.07.02.20.37.30; Fri, 02 Jul 2021 20:37:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbhGCDiY (ORCPT + 99 others); Fri, 2 Jul 2021 23:38:24 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:41602 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230051AbhGCDiY (ORCPT ); Fri, 2 Jul 2021 23:38:24 -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 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 Cc: Jan Kara , linuxppc-dev@lists.ozlabs.org, Guoqing Jiang , Sachin Sant , Ext4 Developers List , "linux-fsdevel@vger.kernel.org" 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> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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