diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-17 16:30:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-17 16:30:34 -0400 |
commit | 592fe8980688e7cba46897685d014c7fb3018a67 (patch) | |
tree | da0df053994838535a6d260eaacf32c84e2619ef /fs | |
parent | d44c6d4fa9b3d9b4f6d8d1751d9cbc50ed53cffe (diff) | |
parent | 57f73c2c89a5d3b2ed87201c8100d1fa989a1a65 (diff) |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 regression fixes from Ted Ts'o:
"This fixes a scalability problem reported by Andi Kleen and Tim Chen;
they were quite secretive about the precise nature of their workload,
but they later admitted that it only showed up when they were using a
large sparse file, so the amount of data I/O that was needed was close
to zero.
I'm not sure how realistic this is and it's only a regression if you
consider changes made since 2.6.39 to be a "regression" vis-a-vis the
policy regarding post-merge window bug fixes, but Linus agreed it was
worth fixing, so I'm including it in this pull request.
This also fixes the journalled quota mount options, which I
accidentally broke while I was cleaning up the mount option handling."
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: fix handling of journalled quota options
ext4: address scalability issue by removing extent cache statistics
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4.h | 3 | ||||
-rw-r--r-- | fs/ext4/extents.c | 4 | ||||
-rw-r--r-- | fs/ext4/super.c | 48 |
3 files changed, 15 insertions, 40 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index ab2594a30f86..0e01e90add8b 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1203,9 +1203,6 @@ struct ext4_sb_info { | |||
1203 | unsigned long s_ext_blocks; | 1203 | unsigned long s_ext_blocks; |
1204 | unsigned long s_ext_extents; | 1204 | unsigned long s_ext_extents; |
1205 | #endif | 1205 | #endif |
1206 | /* ext4 extent cache stats */ | ||
1207 | unsigned long extent_cache_hits; | ||
1208 | unsigned long extent_cache_misses; | ||
1209 | 1206 | ||
1210 | /* for buddy allocator */ | 1207 | /* for buddy allocator */ |
1211 | struct ext4_group_info ***s_group_info; | 1208 | struct ext4_group_info ***s_group_info; |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 1d418387ffb0..abcdeab67f52 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2066,10 +2066,6 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block, | |||
2066 | ret = 1; | 2066 | ret = 1; |
2067 | } | 2067 | } |
2068 | errout: | 2068 | errout: |
2069 | if (!ret) | ||
2070 | sbi->extent_cache_misses++; | ||
2071 | else | ||
2072 | sbi->extent_cache_hits++; | ||
2073 | trace_ext4_ext_in_cache(inode, block, ret); | 2069 | trace_ext4_ext_in_cache(inode, block, ret); |
2074 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); | 2070 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); |
2075 | return ret; | 2071 | return ret; |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ceebaf853beb..6da193564e43 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1305,20 +1305,20 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args) | |||
1305 | ext4_msg(sb, KERN_ERR, | 1305 | ext4_msg(sb, KERN_ERR, |
1306 | "Cannot change journaled " | 1306 | "Cannot change journaled " |
1307 | "quota options when quota turned on"); | 1307 | "quota options when quota turned on"); |
1308 | return 0; | 1308 | return -1; |
1309 | } | 1309 | } |
1310 | qname = match_strdup(args); | 1310 | qname = match_strdup(args); |
1311 | if (!qname) { | 1311 | if (!qname) { |
1312 | ext4_msg(sb, KERN_ERR, | 1312 | ext4_msg(sb, KERN_ERR, |
1313 | "Not enough memory for storing quotafile name"); | 1313 | "Not enough memory for storing quotafile name"); |
1314 | return 0; | 1314 | return -1; |
1315 | } | 1315 | } |
1316 | if (sbi->s_qf_names[qtype] && | 1316 | if (sbi->s_qf_names[qtype] && |
1317 | strcmp(sbi->s_qf_names[qtype], qname)) { | 1317 | strcmp(sbi->s_qf_names[qtype], qname)) { |
1318 | ext4_msg(sb, KERN_ERR, | 1318 | ext4_msg(sb, KERN_ERR, |
1319 | "%s quota file already specified", QTYPE2NAME(qtype)); | 1319 | "%s quota file already specified", QTYPE2NAME(qtype)); |
1320 | kfree(qname); | 1320 | kfree(qname); |
1321 | return 0; | 1321 | return -1; |
1322 | } | 1322 | } |
1323 | sbi->s_qf_names[qtype] = qname; | 1323 | sbi->s_qf_names[qtype] = qname; |
1324 | if (strchr(sbi->s_qf_names[qtype], '/')) { | 1324 | if (strchr(sbi->s_qf_names[qtype], '/')) { |
@@ -1326,7 +1326,7 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args) | |||
1326 | "quotafile must be on filesystem root"); | 1326 | "quotafile must be on filesystem root"); |
1327 | kfree(sbi->s_qf_names[qtype]); | 1327 | kfree(sbi->s_qf_names[qtype]); |
1328 | sbi->s_qf_names[qtype] = NULL; | 1328 | sbi->s_qf_names[qtype] = NULL; |
1329 | return 0; | 1329 | return -1; |
1330 | } | 1330 | } |
1331 | set_opt(sb, QUOTA); | 1331 | set_opt(sb, QUOTA); |
1332 | return 1; | 1332 | return 1; |
@@ -1341,7 +1341,7 @@ static int clear_qf_name(struct super_block *sb, int qtype) | |||
1341 | sbi->s_qf_names[qtype]) { | 1341 | sbi->s_qf_names[qtype]) { |
1342 | ext4_msg(sb, KERN_ERR, "Cannot change journaled quota options" | 1342 | ext4_msg(sb, KERN_ERR, "Cannot change journaled quota options" |
1343 | " when quota turned on"); | 1343 | " when quota turned on"); |
1344 | return 0; | 1344 | return -1; |
1345 | } | 1345 | } |
1346 | /* | 1346 | /* |
1347 | * The space will be released later when all options are confirmed | 1347 | * The space will be released later when all options are confirmed |
@@ -1450,6 +1450,16 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, | |||
1450 | const struct mount_opts *m; | 1450 | const struct mount_opts *m; |
1451 | int arg = 0; | 1451 | int arg = 0; |
1452 | 1452 | ||
1453 | #ifdef CONFIG_QUOTA | ||
1454 | if (token == Opt_usrjquota) | ||
1455 | return set_qf_name(sb, USRQUOTA, &args[0]); | ||
1456 | else if (token == Opt_grpjquota) | ||
1457 | return set_qf_name(sb, GRPQUOTA, &args[0]); | ||
1458 | else if (token == Opt_offusrjquota) | ||
1459 | return clear_qf_name(sb, USRQUOTA); | ||
1460 | else if (token == Opt_offgrpjquota) | ||
1461 | return clear_qf_name(sb, GRPQUOTA); | ||
1462 | #endif | ||
1453 | if (args->from && match_int(args, &arg)) | 1463 | if (args->from && match_int(args, &arg)) |
1454 | return -1; | 1464 | return -1; |
1455 | switch (token) { | 1465 | switch (token) { |
@@ -1549,18 +1559,6 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, | |||
1549 | sbi->s_mount_opt |= m->mount_opt; | 1559 | sbi->s_mount_opt |= m->mount_opt; |
1550 | } | 1560 | } |
1551 | #ifdef CONFIG_QUOTA | 1561 | #ifdef CONFIG_QUOTA |
1552 | } else if (token == Opt_usrjquota) { | ||
1553 | if (!set_qf_name(sb, USRQUOTA, &args[0])) | ||
1554 | return -1; | ||
1555 | } else if (token == Opt_grpjquota) { | ||
1556 | if (!set_qf_name(sb, GRPQUOTA, &args[0])) | ||
1557 | return -1; | ||
1558 | } else if (token == Opt_offusrjquota) { | ||
1559 | if (!clear_qf_name(sb, USRQUOTA)) | ||
1560 | return -1; | ||
1561 | } else if (token == Opt_offgrpjquota) { | ||
1562 | if (!clear_qf_name(sb, GRPQUOTA)) | ||
1563 | return -1; | ||
1564 | } else if (m->flags & MOPT_QFMT) { | 1562 | } else if (m->flags & MOPT_QFMT) { |
1565 | if (sb_any_quota_loaded(sb) && | 1563 | if (sb_any_quota_loaded(sb) && |
1566 | sbi->s_jquota_fmt != m->mount_opt) { | 1564 | sbi->s_jquota_fmt != m->mount_opt) { |
@@ -2366,18 +2364,6 @@ static ssize_t lifetime_write_kbytes_show(struct ext4_attr *a, | |||
2366 | EXT4_SB(sb)->s_sectors_written_start) >> 1))); | 2364 | EXT4_SB(sb)->s_sectors_written_start) >> 1))); |
2367 | } | 2365 | } |
2368 | 2366 | ||
2369 | static ssize_t extent_cache_hits_show(struct ext4_attr *a, | ||
2370 | struct ext4_sb_info *sbi, char *buf) | ||
2371 | { | ||
2372 | return snprintf(buf, PAGE_SIZE, "%lu\n", sbi->extent_cache_hits); | ||
2373 | } | ||
2374 | |||
2375 | static ssize_t extent_cache_misses_show(struct ext4_attr *a, | ||
2376 | struct ext4_sb_info *sbi, char *buf) | ||
2377 | { | ||
2378 | return snprintf(buf, PAGE_SIZE, "%lu\n", sbi->extent_cache_misses); | ||
2379 | } | ||
2380 | |||
2381 | static ssize_t inode_readahead_blks_store(struct ext4_attr *a, | 2367 | static ssize_t inode_readahead_blks_store(struct ext4_attr *a, |
2382 | struct ext4_sb_info *sbi, | 2368 | struct ext4_sb_info *sbi, |
2383 | const char *buf, size_t count) | 2369 | const char *buf, size_t count) |
@@ -2435,8 +2421,6 @@ static struct ext4_attr ext4_attr_##name = __ATTR(name, mode, show, store) | |||
2435 | EXT4_RO_ATTR(delayed_allocation_blocks); | 2421 | EXT4_RO_ATTR(delayed_allocation_blocks); |
2436 | EXT4_RO_ATTR(session_write_kbytes); | 2422 | EXT4_RO_ATTR(session_write_kbytes); |
2437 | EXT4_RO_ATTR(lifetime_write_kbytes); | 2423 | EXT4_RO_ATTR(lifetime_write_kbytes); |
2438 | EXT4_RO_ATTR(extent_cache_hits); | ||
2439 | EXT4_RO_ATTR(extent_cache_misses); | ||
2440 | EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, sbi_ui_show, | 2424 | EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, sbi_ui_show, |
2441 | inode_readahead_blks_store, s_inode_readahead_blks); | 2425 | inode_readahead_blks_store, s_inode_readahead_blks); |
2442 | EXT4_RW_ATTR_SBI_UI(inode_goal, s_inode_goal); | 2426 | EXT4_RW_ATTR_SBI_UI(inode_goal, s_inode_goal); |
@@ -2452,8 +2436,6 @@ static struct attribute *ext4_attrs[] = { | |||
2452 | ATTR_LIST(delayed_allocation_blocks), | 2436 | ATTR_LIST(delayed_allocation_blocks), |
2453 | ATTR_LIST(session_write_kbytes), | 2437 | ATTR_LIST(session_write_kbytes), |
2454 | ATTR_LIST(lifetime_write_kbytes), | 2438 | ATTR_LIST(lifetime_write_kbytes), |
2455 | ATTR_LIST(extent_cache_hits), | ||
2456 | ATTR_LIST(extent_cache_misses), | ||
2457 | ATTR_LIST(inode_readahead_blks), | 2439 | ATTR_LIST(inode_readahead_blks), |
2458 | ATTR_LIST(inode_goal), | 2440 | ATTR_LIST(inode_goal), |
2459 | ATTR_LIST(mb_stats), | 2441 | ATTR_LIST(mb_stats), |