ReiserFS patches (cut CPU usage by writing more than 4k at a time, other misc.)
Subsystems (3)
Hello!
These patches were tested by me and Umka.
Please resend/forward to Linus.
Bye,
Oleg
Hello!
These two changesets contain fixes for reiserfs. They fix issue with handling of displacing_large_files allocator option and a problem with remounting from readwrite to readwrite mode if FS holds some deleted but not yet closed files.
You can pull these from bk://thebsh.namesys.com/bk/reiser3-linux-2.5
Diffstats:
fs/reiserfs/inode.c | 2 +- include/linux/reiserfs_fs.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
super.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-)
Plain text patches:
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.587 -> 1.588
# fs/reiserfs/inode.c 1.66 -> 1.67
# include/linux/reiserfs_fs.h 1.41 -> 1.42
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/10 [email protected] 1.588
# reiserfs: Take into account file information even when not doing preallocation. Fixes a bug with displacing_large_files option # --------------------------------------------
#
fs/reiserfs/inode.c +1 -1
@@ -490,7 +490,7 @@return reiserfs_new_unf_blocknrs2 (th, inode, allocated_block_nr, path, block); }#endif -return reiserfs_new_unf_blocknrs (th, allocated_block_nr, path, block); +return reiserfs_new_unf_blocknrs (th, inode, allocated_block_nr, path, block); } int reiserfs_get_block (struct inode * inode, sector_t block,
include/linux/reiserfs_fs.h +2 -1
@@ -2076,13 +2076,14 @@ }extern inline int reiserfs_new_unf_blocknrs (struct reiserfs_transaction_handle *th, +struct inode *inode,b_blocknr_t *new_blocknrs,struct path * path,long block) {reiserfs_blocknr_hint_t hint = { th: th, path: path, - inode:NULL , + inode: inode, block: block, formatted_node:0 , preallocate:0
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.588 -> 1.589
# fs/reiserfs/super.c 1.52 -> 1.53
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/10 [email protected] 1.589
# reiserfs: Fix a problem with delayed unlinks and remounting RW filesystem RW. # --------------------------------------------
#
fs/reiserfs/super.c +5 -1
@@ -716,7 +716,7 @@ }if (*mount_flags &MS_RDONLY ) { -/* remount rean-only */ +/* remount read-only */ if (s->s_flags &MS_RDONLY )/* it is read-only already */ return 0 ;
@@ -732,6 +732,10 @@journal_mark_dirty (&th, s,SB_BUFFER_WITH_SB (s)); s->s_dirt =0 ; }else { +/* remount read-write */ +if (!(s->s_flags &MS_RDONLY )) +return 0 ;/* We are read-write already */ +REISERFS_SB (s)->s_mount_state =sb_umount_state (rs) ; s->s_flags &= ~MS_RDONLY ;/* now it is safe to call journal_begin */ journal_begin (&th, s,10 ) ;
Hello!
These three changesets implement reiserfs_file_write. Also third one exports generic_osync_inode,block_commit_write and remove_suid because these are now needed for reiserfs.
There was no reiserfs_file_write in the 2.4 port of reiserfs (and Hans was very unhappy about it).
With current 'one block at a time' algorithm, writes past the end of a file are slow because each new file block is separately added into the tree causing shifting of other items which is CPU expensive.
With this new implementation if you write into file with big enough chunks, it uses half as much CPU. Also this version is more SMP friendly than the current one.
You can pull these from bk://thebsh.namesys.com/bk/reiser3-linux-2.5
Diffstats:
do_balan.c | 105 +++++++++++++++++++++++++++--------------------------- inode.c | 48 ++++++++++++++++++++---- tail_conversion.c | 5 +- 3 files changed, 95 insertions(+), 63 deletions(-)
fs/reiserfs/bitmap.c | 21 fs/reiserfs/file.c | 1080 ++++++++++++++++++++++++++++++++++++++++- fs/reiserfs/inode.c | 4 fs/reiserfs/super.c | 1 include/linux/reiserfs_fs.h | 1 include/linux/reiserfs_fs_sb.h | 1 6 files changed, 1104 insertions(+), 4 deletions(-)
kernel/ksyms.c | 3 +++ mm/filemap.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
Plain text patches:
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.589 -> 1.590
# fs/reiserfs/do_balan.c 1.15 -> 1.16
# fs/reiserfs/inode.c 1.67 -> 1.68
# fs/reiserfs/tail_conversion.c 1.23 -> 1.24
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/10 [email protected] 1.590
# reiserfs: Implement insertion of more than one unformatted pointer insertion at a time. Considerably speedup hole creation. # --------------------------------------------
#
fs/reiserfs/do_balan.c +53 -52
226 lines not on this page · raw message
fs/reiserfs/inode.c +40 -8
77 lines not on this page · raw message
fs/reiserfs/tail_conversion.c +2 -3
@@ -30,7 +30,7 @@key of unfm pointer to be pasted */ int n_blk_size, n_retval;/* returned value for reiserfs_insert_item and clones */ -struct unfm_nodeinfo unfm_ptr;/* Handle on an unformatted node +unp_t unfm_ptr;/* Handle on an unformatted node that will be inserted in the tree. */
@@ -59,8 +59,7 @@ p_le_ih =PATH_PITEM_HEAD (path); - unfm_ptr.unfm_nodenum =cpu_to_le32 (unbh->b_blocknr); - unfm_ptr.unfm_freespace =0 ;// ??? + unfm_ptr =cpu_to_le32 (unbh->b_blocknr);if (is_statdata_le_ih (p_le_ih) ) {/* Insert new indirect item. */
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.658 -> 1.659 # fs/reiserfs/file.c 1.18 -> 1.19 # fs/reiserfs/inode.c 1.68 -> 1.69 # fs/reiserfs/super.c 1.53 -> 1.54
# include/linux/reiserfs_fs_sb.h 1.19 -> 1.20
# fs/reiserfs/bitmap.c 1.23 -> 1.24
# include/linux/reiserfs_fs.h 1.43 -> 1.44
#
# The following is the BitKeeper ChangeSet Log # --------------------------------------------
# 02/10/01 [email protected] 1.659
# reiserfs_file_write() implemenation. Ported from 2.4 # -------------------------------------------- #
fs/reiserfs/bitmap.c +20 -1
@@ -9,6 +9,7 @@#include <linux/errno.h> #include <linux/buffer_head.h> #include <linux/kernel.h> +#include <linux/pagemap.h> #include <linux/reiserfs_fs.h> #include <linux/reiserfs_fs_sb.h> #include <linux/reiserfs_fs_i.h>
@@ -734,7 +735,7 @@int rest = amount_needed;int nr_allocated; -while (rest >0 ) { +while (rest >0 && start <= finish) { nr_allocated =scan_bitmap (hint->th, &start, finish,1 , rest + prealloc_size, !hint->formatted_node, hint->block);
@@ -880,7 +881,9 @@if ( !blocks )return ; +spin_lock (&REISERFS_SB (sb)->bitmap_lock);REISERFS_SB (sb)->reserved_blocks += blocks; +spin_unlock (&REISERFS_SB (sb)->bitmap_lock); }/* Unreserve @blocks amount of blocks in fs pointed by @sb */
@@ -897,6 +900,22 @@if ( !blocks )return ; +spin_lock (&REISERFS_SB (sb)->bitmap_lock);REISERFS_SB (sb)->reserved_blocks -= blocks; +spin_unlock (&REISERFS_SB (sb)->bitmap_lock);RFALSE (REISERFS_SB (sb)->reserved_blocks <0 ,"amount of blocks reserved became zero?" ); +} + +/* This function estimates how much pages we will be able to write to FS +used for reiserfs_file_write() purposes for now. */ +int reiserfs_can_fit_pages (struct super_block *sb/* superblock of filesystem +to estimate space */ ) +{ +unsigned long space; + +spin_lock (&REISERFS_SB (sb)->bitmap_lock); + space = (SB_FREE_BLOCKS (sb) -REISERFS_SB (sb)->reserved_blocks) / (PAGE_CACHE_SIZE /sb->s_blocksize); +spin_unlock (&REISERFS_SB (sb)->bitmap_lock); + +return space; }
fs/reiserfs/file.c +1079 -1
1,094 lines not on this page · raw message
fs/reiserfs/inode.c +2 -2
@@ -895,7 +895,7 @@copy_key (INODE_PKEY (inode), &(ih->ih_key)); - inode->i_blksize =PAGE_SIZE ; + inode->i_blksize =PAGE_SIZE *32 ;INIT_LIST_HEAD (&(REISERFS_I (inode)->i_prealloc_list ));REISERFS_I (inode)->i_flags =0 ;
@@ -1580,7 +1580,7 @@ }// these do not go to on-disk stat data inode->i_ino =le32_to_cpu (ih.ih_key.k_objectid); - inode->i_blksize =PAGE_SIZE ; + inode->i_blksize =PAGE_SIZE *32 ;// store in in-core inode the key of stat data and version all // object items will have (directory items will have old offset
fs/reiserfs/super.c +1 -0
@@ -1317,6 +1317,7 @@reiserfs_proc_register ( s,"oidmap" , reiserfs_oidmap_in_proc );reiserfs_proc_register ( s,"journal" , reiserfs_journal_in_proc );init_waitqueue_head (&(sbi->s_wait)); + sbi->bitmap_lock =SPIN_LOCK_UNLOCKED ;return (0 );
include/linux/reiserfs_fs.h +1 -0
@@ -2111,6 +2111,7 @@#endif void reiserfs_claim_blocks_to_be_allocated (struct super_block *sb,int blocks);void reiserfs_release_claimed_blocks (struct super_block *sb,int blocks); +int reiserfs_can_fit_pages (struct super_block *sb);/* hashes.c */ __u32 keyed_hash (const signed char *msg,int len);
include/linux/reiserfs_fs_sb.h +1 -0
@@ -397,6 +397,7 @@reiserfs_proc_info_data_t s_proc_info_data;struct proc_dir_entry *procdir;int reserved_blocks;/* amount of blocks reserved for further allocations */ +spinlock_t bitmap_lock;/* this lock on now only used to protect reserved_blocks variable */ };/* Definitions of reiserfs on-disk properties: */
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.659 -> 1.660 # kernel/ksyms.c 1.138 -> 1.139 # mm/filemap.c 1.145 -> 1.146
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/30 [email protected] 1.660
# export generic_osync_inode,block_commit_write, remove_suid # -------------------------------------------- # diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c --- a/kernel/ksyms.c Mon Sep 30 15:33:09 2002 +++ b/kernel/ksyms.c Mon Sep 30 15:33:09 2002 @@ -223,6 +223,7 @@ EXPORT_SYMBOL(generic_cont_expand); EXPORT_SYMBOL(cont_prepare_write); EXPORT_SYMBOL(generic_commit_write); +EXPORT_SYMBOL(block_commit_write); EXPORT_SYMBOL(block_truncate_page); EXPORT_SYMBOL(generic_block_bmap); EXPORT_SYMBOL(generic_file_read); @@ -565,6 +566,8 @@ EXPORT_SYMBOL(is_bad_inode); EXPORT_SYMBOL(event); EXPORT_SYMBOL(__inode_dir_notify); +EXPORT_SYMBOL(generic_osync_inode); +EXPORT_SYMBOL(remove_suid);
#ifdef CONFIG_UID16
EXPORT_SYMBOL(overflowuid);
mm/filemap.c +1 -1
@@ -1590,7 +1590,7 @@return page; } -inline void remove_suid (struct dentry *dentry) +void remove_suid (struct dentry *dentry) {struct iattr newattrs;struct inode *inode = dentry->d_inode;
Hello!
These three changesets replace recently added lock_kernels with reiserfs wrappers (that would eventually evolve into real separate locks), includes more C99 designated initialisers cleanups (this time from Art Haas) and updates some reiserfs help entries.
You can pull these from bk://thebsh.namesys.com/bk/reiser3-linux-2.5
Diffstats:
journal.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
dir.c | 6 +++--- inode.c | 14 +++++++------- namei.c | 18 +++++++++--------- super.c | 30 +++++++++++++++--------------- 4 files changed, 34 insertions(+), 34 deletions(-)
Config.help | 33 ++++++++++++--------------------- 1 files changed, 12 insertions(+), 21 deletions(-)
Plain text patches:
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.660 -> 1.661
# fs/reiserfs/journal.c 1.56 -> 1.57
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/30 [email protected] 1.661
# reiserfs: lock_kernel is replaced with per superblock lock (kind of) # --------------------------------------------
#
fs/reiserfs/journal.c +2 -3
@@ -1806,8 +1806,7 @@struct reiserfs_journal_list *jl ; -/* FIXMEL: is this needed? */ -lock_kernel (); +reiserfs_write_lock (ct->p_s_sb); jl =SB_JOURNAL_LIST (ct->p_s_sb) + ct->jindex ;
@@ -1818,7 +1817,7 @@kupdate_one_transaction (ct->p_s_sb, jl) ; }reiserfs_kfree (ct->self,sizeof (struct reiserfs_journal_commit_task ), ct->p_s_sb) ; -unlock_kernel (); +reiserfs_write_unlock (ct->p_s_sb); } static void setup_commit_task_arg(struct reiserfs_journal_commit_task *ct,
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.661 -> 1.662 # fs/reiserfs/inode.c 1.69 -> 1.70 # fs/reiserfs/super.c 1.54 -> 1.55 # fs/reiserfs/dir.c 1.17 -> 1.18 # fs/reiserfs/namei.c 1.42 -> 1.43
#
# The following is the BitKeeper ChangeSet Log # --------------------------------------------
# 02/10/01 [email protected] 1.662
# reiserfs: C99 designated initializers, by Art Haas # -------------------------------------------- #
fs/reiserfs/dir.c +3 -3
@@ -18,9 +18,9 @@int reiserfs_dir_fsync (struct file *filp,struct dentry *dentry,int datasync) ;struct file_operations reiserfs_dir_operations = { - read: generic_read_dir, - readdir: reiserfs_readdir, - fsync: reiserfs_dir_fsync, + .read = generic_read_dir, + .readdir = reiserfs_readdir, + .fsync = reiserfs_dir_fsync, };int reiserfs_dir_fsync (struct file *filp,struct dentry *dentry,int datasync) {
fs/reiserfs/inode.c +7 -7
@@ -2139,11 +2139,11 @@ }struct address_space_operations reiserfs_address_space_operations = { - writepage: reiserfs_writepage, - readpage: reiserfs_readpage, - releasepage: reiserfs_releasepage, - sync_page: block_sync_page, - prepare_write: reiserfs_prepare_write, - commit_write: reiserfs_commit_write, - bmap: reiserfs_aop_bmap + .writepage = reiserfs_writepage, + .readpage = reiserfs_readpage, + .releasepage = reiserfs_releasepage, + .sync_page = block_sync_page, + .prepare_write = reiserfs_prepare_write, + .commit_write = reiserfs_commit_write, + .bmap = reiserfs_aop_bmap } ;
fs/reiserfs/namei.c +9 -9
@@ -1301,14 +1301,14 @@*/ struct inode_operations reiserfs_dir_inode_operations = {//&reiserfs_dir_operations, /* default_file_ops */ - create: reiserfs_create, - lookup: reiserfs_lookup, - link: reiserfs_link, - unlink: reiserfs_unlink, - symlink: reiserfs_symlink, - mkdir: reiserfs_mkdir, - rmdir: reiserfs_rmdir, - mknod: reiserfs_mknod, - rename: reiserfs_rename, + .create = reiserfs_create, + .lookup = reiserfs_lookup, + .link = reiserfs_link, + .unlink = reiserfs_unlink, + .symlink = reiserfs_symlink, + .mkdir = reiserfs_mkdir, + .rmdir = reiserfs_rmdir, + .mknod = reiserfs_mknod, + .rename = reiserfs_rename, };
fs/reiserfs/super.c +15 -15
@@ -474,25 +474,25 @@struct super_operations reiserfs_sops = { - alloc_inode: reiserfs_alloc_inode, - destroy_inode: reiserfs_destroy_inode, - write_inode: reiserfs_write_inode, - dirty_inode: reiserfs_dirty_inode, - delete_inode: reiserfs_delete_inode, - put_super: reiserfs_put_super, - write_super: reiserfs_write_super, - write_super_lockfs: reiserfs_write_super_lockfs, - unlockfs: reiserfs_unlockfs, - statfs: reiserfs_statfs, - remount_fs: reiserfs_remount, + .alloc_inode = reiserfs_alloc_inode, + .destroy_inode = reiserfs_destroy_inode, + .write_inode = reiserfs_write_inode, + .dirty_inode = reiserfs_dirty_inode, + .delete_inode = reiserfs_delete_inode, + .put_super = reiserfs_put_super, + .write_super = reiserfs_write_super, + .write_super_lockfs = reiserfs_write_super_lockfs, + .unlockfs = reiserfs_unlockfs, + .statfs = reiserfs_statfs, + .remount_fs = reiserfs_remount, };static struct export_operations reiserfs_export_ops = { - encode_fh: reiserfs_encode_fh, - decode_fh: reiserfs_decode_fh, - get_parent: reiserfs_get_parent, - get_dentry: reiserfs_get_dentry, + .encode_fh = reiserfs_encode_fh, + .decode_fh = reiserfs_decode_fh, + .get_parent = reiserfs_get_parent, + .get_dentry = reiserfs_get_dentry, } ;/* this struct is used in reiserfs_getopt () for containing the value for those
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.662 -> 1.663
# fs/Config.help 1.16 -> 1.17
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/01 [email protected] 1.663
# Update reiserfs config help entries.
# --------------------------------------------
#
fs/Config.help +12 -21
@@ -37,27 +37,18 @@ CONFIG_REISERFS_FS Stores not just filenames but the files themselves in a balanced - tree. Uses journaling. + tree. Uses journalling. Balanced trees are more efficient than traditional file system architectural foundations. In general, ReiserFS is as fast as ext2, but is very efficient with - large directories and small files. Additional patches are needed - for NFS and quotas, please see <http://www.reiserfs.org/> for links. + large directories and small files. It is much faster for writes, + and slightly slower for reads than ext2. It is much faster than + ext3. It will be obsoleted by Reiser4 in not too long, so keep + an eye on our website for when Reiser4 ships. - It is more easily extended to have features currently found in - database and keyword search systems than block allocation based file - systems are. The next version will be so extended, and will support - plugins consistent with our motto ``It takes more than a license to - make source code open.'' - - Read <http://www.reiserfs.org/> to learn more about reiserfs. - - Sponsored by Threshold Networks, Emusic.com, and Bigstorage.com. - - If you like it, you can pay us to add new features to it that you - need, buy a support contract, or pay us to port it to another OS. + Read <http://www.namesys.com> to learn more about reiserfs. CONFIG_REISERFS_CHECK If you set this to Y, then ReiserFS will perform every check it can
@@ -71,12 +62,12 @@ everyone should say N. CONFIG_REISERFS_PROC_INFO - Create under /proc/fs/reiserfs a hierarchy of files, displaying - various ReiserFS statistics and internal data at the expense of - making your kernel or module slightly larger (+8 KB). This also - increases the amount of kernel memory required for each mount. - Almost everyone but ReiserFS developers and people fine-tuning - reiserfs or tracing problems should say N. + Create under /proc/fs/reiserfs hierarchy of files, displaying + various ReiserFS statistics and internal data on the expense of + making your kernel or module slightly larger (+8 KB). This also + increases amount of kernel memory required for each mount. Almost + everyone but ReiserFS developers and people fine-tuning reiserfs or + tracing problems should say N. CONFIG_EXT2_FS This is the de facto standard Linux file system (method to organize