From: "Theodore Ts'o" <tytso@mit.edu>
To: Zhang Yi <yi.zhang@huawei.com>
Cc: Jan Kara <jack@suse.cz>,
linuxppc-dev@lists.ozlabs.org,
Guoqing Jiang <guoqing.jiang@linux.dev>,
Sachin Sant <sachinp@linux.vnet.ibm.com>,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [powerpc][5.13.0-next-20210701] Kernel crash while running ltp(chdir01) tests
Date: Fri, 2 Jul 2021 23:35:11 -0400 [thread overview]
Message-ID: <YN/a70ucYXu0DqGf@mit.edu> (raw)
In-Reply-To: <36778615-86fd-9a19-9bc9-f93a6f2d5817@huawei.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: "Theodore Ts'o" <tytso@mit.edu>
To: Zhang Yi <yi.zhang@huawei.com>
Cc: Sachin Sant <sachinp@linux.vnet.ibm.com>, Jan Kara <jack@suse.cz>,
Guoqing Jiang <guoqing.jiang@linux.dev>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [powerpc][5.13.0-next-20210701] Kernel crash while running ltp(chdir01) tests
Date: Fri, 2 Jul 2021 23:35:11 -0400 [thread overview]
Message-ID: <YN/a70ucYXu0DqGf@mit.edu> (raw)
In-Reply-To: <36778615-86fd-9a19-9bc9-f93a6f2d5817@huawei.com>
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
next prev parent reply other threads:[~2021-07-03 3:35 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 8:51 [powerpc][5.13.0-next-20210701] Kernel crash while running ltp(chdir01) tests Sachin Sant
2021-07-02 8:51 ` Sachin Sant
2021-07-02 9:38 ` Guoqing Jiang
2021-07-02 9:38 ` Guoqing Jiang
2021-07-02 13:13 ` Theodore Ts'o
2021-07-02 13:13 ` Theodore Ts'o
2021-07-02 13:23 ` Zhang Yi
2021-07-02 13:23 ` Zhang Yi
2021-07-02 13:52 ` Zhang Yi
2021-07-02 13:52 ` Zhang Yi
2021-07-02 16:11 ` Theodore Ts'o
2021-07-02 16:11 ` Theodore Ts'o
2021-07-02 22:11 ` Theodore Ts'o
2021-07-02 22:11 ` Theodore Ts'o
2021-07-03 3:37 ` Zhang Yi
2021-07-03 3:37 ` Zhang Yi
2021-07-03 3:52 ` Theodore Ts'o
2021-07-03 3:52 ` Theodore Ts'o
2021-07-03 3:05 ` Zhang Yi
2021-07-03 3:05 ` Zhang Yi
2021-07-03 3:35 ` Theodore Ts'o [this message]
2021-07-03 3:35 ` Theodore Ts'o
2021-07-03 4:55 ` Zhang Yi
2021-07-03 4:55 ` Zhang Yi
2021-07-04 14:04 ` Theodore Ts'o
2021-07-04 14:04 ` Theodore Ts'o
2021-07-05 2:17 ` Zhang Yi
2021-07-05 2:17 ` Zhang Yi
2021-07-05 14:50 ` [PATCH -v2] ext4: inline jbd2_journal_[un]register_shrinker() Theodore Ts'o
2021-07-05 18:29 ` Jon Hunter
2021-07-06 1:38 ` Zhang Yi
2021-07-05 9:58 ` [powerpc][5.13.0-next-20210701] Kernel crash while running ltp(chdir01) tests Jan Kara
2021-07-05 9:58 ` Jan Kara
2021-07-05 11:27 ` Sachin Sant
2021-07-05 11:27 ` Sachin Sant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YN/a70ucYXu0DqGf@mit.edu \
--to=tytso@mit.edu \
--cc=guoqing.jiang@linux.dev \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sachinp@linux.vnet.ibm.com \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.