From: Theodore Ts'o <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Dave Jones <davej@redhat.com>,
"gnehzuil.liu" <gnehzuil.liu@gmail.com>,
Zheng Liu <wenqing.lz@taobao.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: use percpu counter for extent cache count
Date: Sat, 2 Mar 2013 10:26:44 -0500 [thread overview]
Message-ID: <20130302152644.GA22941@thunk.org> (raw)
In-Reply-To: <5130ED3A.30003@redhat.com>
On Fri, Mar 01, 2013 at 12:02:34PM -0600, Eric Sandeen wrote:
>
> I was mostly keying off what quota felt was best, I guess.
> I'm not wedded to either approach, it was just a thought.
> So you can take it or leave it. :)
I'll take it, but for the record, there's a reason why I label patches
with "I haven't tested this yet" disclaimers.
For future reference, calling percpu_counter_init() and
percpu_counter_destroy() is not optional --- without them, in your
original patch, the kernel will crash them the first time an ext4 file
system mount is attempted.
No worries though, no harm done --- but it's better if people don't
rely on me to catch bugs before they go into the tree. :-)
- Ted
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 373d46c..1ae5860 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -783,6 +783,7 @@ static void ext4_put_super(struct super_block *sb)
percpu_counter_destroy(&sbi->s_freeinodes_counter);
percpu_counter_destroy(&sbi->s_dirs_counter);
percpu_counter_destroy(&sbi->s_dirtyclusters_counter);
+ percpu_counter_destroy(&sbi->s_extent_cache_cnt);
brelse(sbi->s_sbh);
#ifdef CONFIG_QUOTA
for (i = 0; i < MAXQUOTAS; i++)
@@ -3688,6 +3689,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (!err) {
err = percpu_counter_init(&sbi->s_dirtyclusters_counter, 0);
}
+ if (!err) {
+ err = percpu_counter_init(&sbi->s_extent_cache_cnt, 0);
+ }
if (err) {
ext4_msg(sb, KERN_ERR, "insufficient memory");
goto failed_mount3;
@@ -3993,6 +3997,7 @@ failed_mount3:
percpu_counter_destroy(&sbi->s_freeinodes_counter);
percpu_counter_destroy(&sbi->s_dirs_counter);
percpu_counter_destroy(&sbi->s_dirtyclusters_counter);
+ percpu_counter_destroy(&sbi->s_extent_cache_cnt);
if (sbi->s_mmp_tsk)
kthread_stop(sbi->s_mmp_tsk);
failed_mount2:
next prev parent reply other threads:[~2013-03-02 15:26 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-26 20:39 [GIT PULL] ext4 updates for 3.9 Theodore Ts'o
2013-02-27 12:47 ` Markus Trippelsdorf
2013-02-27 15:34 ` Theodore Ts'o
2013-02-27 15:44 ` Markus Trippelsdorf
2013-02-27 17:01 ` Markus Trippelsdorf
2013-02-27 17:10 ` gnehzuil.liu
2013-02-27 17:22 ` Markus Trippelsdorf
2013-02-27 17:38 ` gnehzuil.liu
2013-02-27 17:45 ` Markus Trippelsdorf
2013-02-27 17:52 ` Linus Torvalds
2013-02-27 18:49 ` Theodore Ts'o
2013-02-27 18:56 ` Markus Trippelsdorf
2013-02-27 19:19 ` Dave Jones
2013-02-27 19:27 ` Zheng Liu
2013-02-27 19:29 ` Theodore Ts'o
2013-02-27 20:12 ` [GIT PULL URGENT] ext4 regression fix " Linus Torvalds
2013-02-27 20:15 ` Theodore Ts'o
2013-02-27 20:23 ` Linus Torvalds
2013-02-27 20:41 ` Borislav Petkov
2013-03-01 3:30 ` Dave Jones
2013-03-01 4:00 ` Theodore Ts'o
2013-03-01 5:00 ` [PATCH] ext4: optimize ext4_es_shrink() Theodore Ts'o
2013-03-01 16:11 ` Dave Jones
2013-03-01 16:26 ` Theodore Ts'o
2013-03-01 16:40 ` Dave Jones
2013-03-01 16:40 ` Eric Sandeen
2013-03-01 16:42 ` [PATCH] ext4: use percpu counter for extent cache count Eric Sandeen
2013-03-01 18:00 ` Theodore Ts'o
2013-03-01 18:02 ` Eric Sandeen
2013-03-02 15:26 ` Theodore Ts'o [this message]
2013-03-03 16:39 ` Zheng Liu
2013-03-04 16:11 ` Eric Sandeen
2013-03-02 19:54 ` [GIT PULL URGENT] ext4 regression fix for 3.9 Linus Torvalds
2013-03-02 23:15 ` Theodore Ts'o
2013-02-27 20:14 ` Theodore Ts'o
2013-02-27 20:58 ` [GIT PULL] ext4 updates " Dmitry Monakhov
2013-02-27 21:30 ` Theodore Ts'o
2013-03-01 15:41 ` Eric Sandeen
2013-02-28 13:18 ` Dave Chinner
2013-02-27 18:57 ` Dave Jones
2013-02-27 19:04 ` Theodore Ts'o
2013-02-27 19:11 ` Dave Jones
2013-02-27 19:19 ` Theodore Ts'o
2013-02-27 18:59 ` Zheng Liu
2013-02-27 19:06 ` Borislav Petkov
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=20130302152644.GA22941@thunk.org \
--to=tytso@mit.edu \
--cc=davej@redhat.com \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=wenqing.lz@taobao.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).