Re: [PATCH] ext2 statfs improvement for block and inode free count
On Fri, 13 Jul 2007 18:36:54 -0700 Badari Pulavarty [EMAIL PROTECTED] wrote: More statfs() improvements for ext2. ext2 already maintains percpu counters for free blocks and inodes. Derive free block count and inode count by summing up percpu counters, instead of counting up all the groups in the filesystem each time. Signed-off-by: Badari Pulavarty [EMAIL PROTECTED] Acked-by: Andreas Dilger [EMAIL PROTECTED] fs/ext2/super.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6.22/fs/ext2/super.c === --- linux-2.6.22.orig/fs/ext2/super.c 2007-07-13 20:06:38.0 -0700 +++ linux-2.6.22/fs/ext2/super.c 2007-07-13 20:06:51.0 -0700 @@ -1136,12 +1136,12 @@ static int ext2_statfs (struct dentry * buf-f_type = EXT2_SUPER_MAGIC; buf-f_bsize = sb-s_blocksize; buf-f_blocks = le32_to_cpu(es-s_blocks_count) - overhead; - buf-f_bfree = ext2_count_free_blocks(sb); + buf-f_bfree = percpu_counter_sum(sbi-s_freeblocks_counter); buf-f_bavail = buf-f_bfree - le32_to_cpu(es-s_r_blocks_count); if (buf-f_bfree le32_to_cpu(es-s_r_blocks_count)) buf-f_bavail = 0; buf-f_files = le32_to_cpu(es-s_inodes_count); - buf-f_ffree = ext2_count_free_inodes(sb); + buf-f_ffree = percpu_counter_sum(sbi-s_freeinodes_counter); buf-f_namelen = EXT2_NAME_LEN; fsid = le64_to_cpup((void *)es-s_uuid) ^ le64_to_cpup((void *)es-s_uuid + sizeof(u64)); Guys, I have this patch in a stalled state pending some convincing demonstration/argument that it's actually a worthwhile change. How much hurt will it cause on large-numa, and how much benefit do we get for that hurt? - To unsubscribe from this list: send the line unsubscribe linux-ext4 in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
- ext3-lighten-up-resize-transaction-requirements-checkpatch-fixes.patch removed from -mm tree
The patch titled ext3-lighten-up-resize-transaction-requirements-checkpatch-fixes has been removed from the -mm tree. Its filename was ext3-lighten-up-resize-transaction-requirements-checkpatch-fixes.patch This patch was dropped because it was folded into ext3-lighten-up-resize-transaction-requirements.patch -- Subject: ext3-lighten-up-resize-transaction-requirements-checkpatch-fixes From: Andrew Morton [EMAIL PROTECTED] ERROR: do not use assignment in if condition #58: FILE: fs/ext3/resize.c:173: + if ((err = ext3_journal_restart(handle, EXT3_MAX_TRANS_DATA))) ERROR: use tabs not spaces #60: FILE: fs/ext3/resize.c:175: +^I$ ERROR: do not use assignment in if condition #60: FILE: fs/ext3/resize.c:175: + if ((err = ext3_journal_get_write_access(handle, bh))) ERROR: use tabs not spaces #62: FILE: fs/ext3/resize.c:177: $ ERROR: do not use assignment in if condition #87: FILE: fs/ext3/resize.c:233: + if ((err = extend_or_restart_transaction(handle, 1, bh))) ERROR: do not use assignment in if condition #97: FILE: fs/ext3/resize.c:261: + if ((err = extend_or_restart_transaction(handle, 1, bh))) ERROR: do not use assignment in if condition #108: FILE: fs/ext3/resize.c:286: + if ((err = extend_or_restart_transaction(handle, 1, bh))) ERROR: do not use assignment in if condition #119: FILE: fs/ext3/resize.c:298: + if ((err = extend_or_restart_transaction(handle, 2, bh))) Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. Cc: linux-ext4@vger.kernel.org Cc: Andreas Dilger [EMAIL PROTECTED] Cc: Eric Sandeen [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- diff -puN fs/ext3/resize.c~ext3-lighten-up-resize-transaction-requirements-checkpatch-fixes fs/ext3/resize.c --- a/fs/ext3/resize.c~ext3-lighten-up-resize-transaction-requirements-checkpatch-fixes +++ a/fs/ext3/resize.c @@ -170,11 +170,13 @@ static int extend_or_restart_transaction if (err 0) return err; if (err) { - if ((err = ext3_journal_restart(handle, EXT3_MAX_TRANS_DATA))) + err = ext3_journal_restart(handle, EXT3_MAX_TRANS_DATA); + if (err) return err; - if ((err = ext3_journal_get_write_access(handle, bh))) + err = ext3_journal_get_write_access(handle, bh); + if (err) return err; -} + } return 0; } @@ -230,7 +232,8 @@ static int setup_new_group_blocks(struct ext3_debug(update backup group %#04lx (+%d)\n, block, bit); - if ((err = extend_or_restart_transaction(handle, 1, bh))) + err = extend_or_restart_transaction(handle, 1, bh); + if (err) goto exit_bh; gdb = sb_getblk(sb, block); @@ -258,7 +261,8 @@ static int setup_new_group_blocks(struct ext3_debug(clear reserved block %#04lx (+%d)\n, block, bit); - if ((err = extend_or_restart_transaction(handle, 1, bh))) + err = extend_or_restart_transaction(handle, 1, bh); + if (err) goto exit_bh; if (IS_ERR(gdb = bclean(handle, sb, block))) { @@ -283,7 +287,8 @@ static int setup_new_group_blocks(struct ext3_debug(clear inode block %#04lx (+%d)\n, block, bit); - if ((err = extend_or_restart_transaction(handle, 1, bh))) + err = extend_or_restart_transaction(handle, 1, bh); + if (err) goto exit_bh; if (IS_ERR(it = bclean(handle, sb, block))) { @@ -295,7 +300,8 @@ static int setup_new_group_blocks(struct ext3_set_bit(bit, bh-b_data); } - if ((err = extend_or_restart_transaction(handle, 2, bh))) + err = extend_or_restart_transaction(handle, 2, bh); + if (err) goto exit_bh; mark_bitmap_end(input-blocks_count, EXT3_BLOCKS_PER_GROUP(sb), _ Patches currently in -mm which might be from [EMAIL PROTECTED] are origin.patch mm-bdi-init-hooks.patch mm-per-device-dirty-threshold.patch mm-dirty-balancing-for-tasks.patch slab-api-remove-useless-ctor-parameter-and-reorder-parameters.patch oom-change-all_unreclaimable-zone-member-to-flags.patch oom-do-not-take-callback_mutex.patch writeback-dont-propagate-aop_writepage_activate.patch softlockup-add-a-proc-tuning-parameter.patch force-erroneous-inclusions-of-compiler-h-files-to-be-errors.patch driver-for-the-atmel-on-chip-ssc-on-at32ap-and-at91.patch do_sys_poll-simplify-playing-with-on-stack-data.patch pcmcia-compactflash-driver-for-pa-semi-electra-boards.patch add-in-sunos-41x-compatible-mode-for-ufs.patch
ext3 warnings from LTP rename14
Hello, I ran the ltp-full-20070930 tests on 2.6.23-rc9-mph4 (sparc32 SMP), and am seeing the following warnings: EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 cEXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 oEXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 mEXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs warning (device sdb5): ext3_rename: Deleting old file (215845), 2, error=-2 EXT3-fs error (device sdb5): ext3_add_entry: bad entry in directory #215845: rec_len is smaller than minimal - offset=56, inode=8026488, rec_len=0, name_len=0 Aborting journal on device sdb5. EXT3-fs error (device sdb5) in start_transaction: Readonly filesystem Aborting journal on device sdb5. ext3_abort called. The first ones are triggered the rename14 test (code attached), but I cannot reproduce the latter issue so far. Could it be a result of the earlier warnings? An attempt to avoid the warning is also attached. But with that I see: EXT3-fs warning (device sdb4): ext3_unlink: Deleting nonexistent file (305412), 0 Best regards, Martin --- 30 years from now GNU/Linux will be as redundant a term as MERT/UNIX is today. - Martin Habets --- /* * * Copyright (c) International Business Machines Corp., 2002 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* 11/12/2002 Port to LTP [EMAIL PROTECTED] */ /* 06/30/2001 Port to Linux [EMAIL PROTECTED] */ /* * NAME * rename14.c - create and rename files * * CALLS * create, unlink, rename * * ALGORITHM * Creates two processes. One creates and unlinks a file. * The other renames that file. * */ #include stdio.h #include errno.h #include signal.h #include stdlib.h #include unistd.h #include wait.h #include sys/types.h #include sys/stat.h #include fcntl.h /** LTP Port **/ #include test.h #include usctest.h #define FAILED 0 #define PASSED 1 int local_flag = PASSED; char *TCID=rename14;/* Test program identifier.*/ int TST_TOTAL=1;/* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ /**/ #define RUNTIME 45 int kidpid[2]; int parent_pid; int main (argc, argv) int argc; char *argv[]; { int pid; sigset_t set; struct sigaction act, oact; int term(); int al(); void dochild1(); void dochild2(); #ifdef UCLINUX char *msg; /* message returned from parse_opts */ /* Parse standard options given to run the test. */ msg = parse_opts(argc, argv, (option_t *)NULL, NULL); if (msg != (char *)NULL) { tst_brkm(TBROK, NULL, OPTION PARSING ERROR - %s, msg); } maybe_run_child(dochild1, n, 1); maybe_run_child(dochild2, n, 2); #endif sigemptyset(set); act.sa_handler = (void(*)())term; act.sa_mask = set; act.sa_flags = 0; if (sigaction(SIGTERM, act, oact)) { tst_resm(TBROK,Sigaction(SIGTERM)); tst_exit(); } sigemptyset(set); act.sa_handler = (void(*)())al; act.sa_mask = set; act.sa_flags = 0; if (sigaction(SIGALRM, act, 0)) { tst_resm(TBROK,Sigaction(SIGALRM)); tst_exit(); } parent_pid = getpid(); tst_tmpdir();
Re: ext3 warnings from LTP rename14
Eric Sandeen wrote: Martin Habets wrote: Hello, I ran the ltp-full-20070930 tests on 2.6.23-rc9-mph4 (sparc32 SMP), and am seeing the following warnings: This makes me a little nervous about my change ef2b02d3e617cb0400eedf2668f86215e1b0e6af (ext34: ensure do_split leaves enough free space in both blocks) Do you know when this first showed up? Could you test -rc6? You say you can reproduce it; have you checked (fsck'd) the filesystem in between, and is it in good shape? -Eric FWIW, I ran rename14 standalone a few times on 2.6.23.1 with no problems... [EMAIL PROTECTED] ltp-full-20070930]# ./testcases/kernel/syscalls/rename/rename14 rename141 PASS : Test Passed [EMAIL PROTECTED] ltp-full-20070930]# ./testcases/kernel/syscalls/rename/rename14 rename141 PASS : Test Passed [EMAIL PROTECTED] ltp-full-20070930]# ./testcases/kernel/syscalls/rename/rename14 rename141 PASS : Test Passed [EMAIL PROTECTED] ~]# uname -a Linux bear-05.lab.msp.redhat.com 2.6.23.1 #1 SMP Mon Oct 15 15:28:08 CDT 2007 i686 athlon i386 GNU/Linux -Eric - To unsubscribe from this list: send the line unsubscribe linux-ext4 in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] ext4 update
On Wed, 17 Oct 2007, Theodore Ts'o wrote: Hi Linus, Please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git for_linus It has a number random cleanups and bug fixes, and two new features. The first is uninitialized block groups, which allows fast mke2fs operations plus as well as speeding up e2fsck by allowing it to skip parts of the inode tables that haven't been used yet. nice feature, is there any work on a tool to go through a well-used filesystem and mark unused block groups as uninitialized? (I would guess that such a tool may want to move files to make this so) David Lang A checksum has been added to block group descriptors so we can tell detect corruption in that data structure, since we are depending on it being accurate so we know what portion of the inode table is really in use. The second feature is flexible block groups, which allows inode tables and block/inode bitmaps to be grouped together outside of the block group that they administer, to allow contiguous regions of data blocks to span multiple block groups, which helps for large files significantly bigger than the size of a block group (i.e., 32 gigabytes on a 4k block filesystem). All of these patches have been baking in -mm for a while. Regards, - Ted Andreas Dilger (1): Ext4: Uninitialized Block Groups Aneesh Kumar K.V (8): ext4: Fix sparse warnings ext4: Convert bg_block_bitmap to bg_block_bitmap_lo ext4: Convert bg_inode_bitmap and bg_inode_table ext4: Convert s_blocks_count to s_blocks_count_lo ext4: Convert s_r_blocks_count and s_free_blocks_count ext4: Convert ext4_extent.ee_start to ext4_extent.ee_start_lo ext4: Convert ext4_extent_idx.ei_leaf to ext4_extent_idx.ei_leaf_lo ext4: sparse fixes Coly Li (1): ext4: Remove (partial, never completed) fragment support Eric Sandeen (3): ext4: remove #ifdef CONFIG_EXT4_INDEX ext4: fix setup_new_group_blocks locking ext4: lighten up resize transaction requirements Jan Kara (1): jbd2: fix commit code to properly abort journal Jose R. Santos (2): JBD2: debug code cleanup. ext4: FLEX_BG Kernel support v2. Mingming Cao (6): JBD: JBD slab allocation cleanups JBD2: jbd2 slab allocation cleanups JBD: replace jbd_kmalloc with kmalloc directly JBD2: replace jbd_kmalloc with kmalloc directly. JBD2/Ext4: Convert kmalloc to kzalloc in jbd2/ext4 jbd2: JBD_XXX to JBD2_XXX naming cleanup fs/Kconfig |1 + fs/ext4/balloc.c| 112 - fs/ext4/dir.c |7 -- fs/ext4/extents.c | 14 ++-- fs/ext4/fsync.c |2 +- fs/ext4/group.h | 27 +++ fs/ext4/ialloc.c| 151 +++ fs/ext4/inode.c | 18 ++ fs/ext4/namei.c | 20 - fs/ext4/resize.c| 59 +++- fs/ext4/super.c | 97 + fs/ext4/xattr.c |7 +- fs/jbd/commit.c |6 +- fs/jbd/journal.c| 99 ++ fs/jbd/transaction.c| 12 ++-- fs/jbd2/commit.c| 16 ++-- fs/jbd2/journal.c | 128 - fs/jbd2/recovery.c |2 +- fs/jbd2/revoke.c|4 +- fs/jbd2/transaction.c | 19 +++--- include/linux/ext4_fs.h | 103 ++ include/linux/ext4_fs_extents.h |4 +- include/linux/ext4_fs_i.h |5 -- include/linux/ext4_fs_sb.h |3 - include/linux/ext4_jbd2.h |6 +- include/linux/jbd.h | 17 +++-- include/linux/jbd2.h| 49 +++-- include/linux/poison.h |3 +- 28 files changed, 527 insertions(+), 464 deletions(-) create mode 100644 fs/ext4/group.h - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ - To unsubscribe from this list: send the line unsubscribe linux-ext4 in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL] ext4 update
Hi Linus, Please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git for_linus It has a number random cleanups and bug fixes, and two new features. The first is uninitialized block groups, which allows fast mke2fs operations plus as well as speeding up e2fsck by allowing it to skip parts of the inode tables that haven't been used yet. A checksum has been added to block group descriptors so we can tell detect corruption in that data structure, since we are depending on it being accurate so we know what portion of the inode table is really in use. The second feature is flexible block groups, which allows inode tables and block/inode bitmaps to be grouped together outside of the block group that they administer, to allow contiguous regions of data blocks to span multiple block groups, which helps for large files significantly bigger than the size of a block group (i.e., 32 gigabytes on a 4k block filesystem). All of these patches have been baking in -mm for a while. Regards, - Ted Andreas Dilger (1): Ext4: Uninitialized Block Groups Aneesh Kumar K.V (8): ext4: Fix sparse warnings ext4: Convert bg_block_bitmap to bg_block_bitmap_lo ext4: Convert bg_inode_bitmap and bg_inode_table ext4: Convert s_blocks_count to s_blocks_count_lo ext4: Convert s_r_blocks_count and s_free_blocks_count ext4: Convert ext4_extent.ee_start to ext4_extent.ee_start_lo ext4: Convert ext4_extent_idx.ei_leaf to ext4_extent_idx.ei_leaf_lo ext4: sparse fixes Coly Li (1): ext4: Remove (partial, never completed) fragment support Eric Sandeen (3): ext4: remove #ifdef CONFIG_EXT4_INDEX ext4: fix setup_new_group_blocks locking ext4: lighten up resize transaction requirements Jan Kara (1): jbd2: fix commit code to properly abort journal Jose R. Santos (2): JBD2: debug code cleanup. ext4: FLEX_BG Kernel support v2. Mingming Cao (6): JBD: JBD slab allocation cleanups JBD2: jbd2 slab allocation cleanups JBD: replace jbd_kmalloc with kmalloc directly JBD2: replace jbd_kmalloc with kmalloc directly. JBD2/Ext4: Convert kmalloc to kzalloc in jbd2/ext4 jbd2: JBD_XXX to JBD2_XXX naming cleanup fs/Kconfig |1 + fs/ext4/balloc.c| 112 - fs/ext4/dir.c |7 -- fs/ext4/extents.c | 14 ++-- fs/ext4/fsync.c |2 +- fs/ext4/group.h | 27 +++ fs/ext4/ialloc.c| 151 +++ fs/ext4/inode.c | 18 ++ fs/ext4/namei.c | 20 - fs/ext4/resize.c| 59 +++- fs/ext4/super.c | 97 + fs/ext4/xattr.c |7 +- fs/jbd/commit.c |6 +- fs/jbd/journal.c| 99 ++ fs/jbd/transaction.c| 12 ++-- fs/jbd2/commit.c| 16 ++-- fs/jbd2/journal.c | 128 - fs/jbd2/recovery.c |2 +- fs/jbd2/revoke.c|4 +- fs/jbd2/transaction.c | 19 +++--- include/linux/ext4_fs.h | 103 ++ include/linux/ext4_fs_extents.h |4 +- include/linux/ext4_fs_i.h |5 -- include/linux/ext4_fs_sb.h |3 - include/linux/ext4_jbd2.h |6 +- include/linux/jbd.h | 17 +++-- include/linux/jbd2.h| 49 +++-- include/linux/poison.h |3 +- 28 files changed, 527 insertions(+), 464 deletions(-) create mode 100644 fs/ext4/group.h - To unsubscribe from this list: send the line unsubscribe linux-ext4 in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html