Re: [PATCH 3/3] More comments about block allocation/reservation code

"Randy.Dunlap" <[email protected]> Wed, 23 Aug 2006 14:54:30 -0700
Newsgroups gmane.comp.file-systems.ext2.devel
Organization YPO4
Message-ID <[email protected]>
On Wed, 23 Aug 2006 14:23:20 -0700 Mingming Cao wrote:

> > > @@ -931,7 +1080,8 @@ static int alloc_new_reservation(struct 
> > >  		if ((my_rsv->rsv_alloc_hit >
> > >  		     (my_rsv->rsv_end - my_rsv->rsv_start + 1) / 2)) {
> > >  			/*
> > > -			 * if we previously allocation hit ration is greater than half
> > > +			 * if we previously allocation hit ration is
> > 
> > eh?
> > 
> 
> This is just for wrap up at 80 characters ...

No, there's some sentence construction there that I don't get.
See comments at end of email.


> How about the patch below?:)

Closer.  :)
A few more below.


> Add more comments in block allocation/reservation code (in ext3/balloc.c)
> 
> Signed-Off-By: Mingming Cao <[email protected]>
> 
> ---
> 
>  linux-2.6.18-rc4-ming/fs/ext3/balloc.c |  286 ++++++++++++++++++++++++++++-----
>  1 files changed, 244 insertions(+), 42 deletions(-)
> 
> diff -puN fs/ext3/balloc.c~ext3-balloc.c-comment-fix fs/ext3/balloc.c
> --- linux-2.6.18-rc4/fs/ext3/balloc.c~ext3-balloc.c-comment-fix	2006-08-23 11:56:04.000000000 -0700
> +++ linux-2.6.18-rc4-ming/fs/ext3/balloc.c	2006-08-23 14:19:55.079944630 -0700
> +/**
> + * __rsv_window_dump() -- Dump the filesystem block allocation reservation map
> + * @rb_root:		root of per-filesystem reservation rb tree
> + * @verbose:		verbose mode
> + * @fn:			function which wishes to dump the reservation map
> + *
> + * If verbose is turned on, it will print the whole block reservation
> + * windows(start, end).	Otherwise, it will only print out the "bad" windows,
> + * those windows overlap with their immediate neighbors.

those windows that overlap...

>   */
>  #if 1
>  static void __rsv_window_dump(struct rb_root *root, int verbose,
> @@ -255,11 +309,39 @@ static void rsv_window_remove(struct sup
>  	rb_erase(&rsv->rsv_node, &EXT3_SB(sb)->s_rsv_window_root);
>  }
>  
> +/*
> + * rsv_is_empty() -- Check if the reservation window is allocated.
> + * @rsv:		given reservation window to check
> + *
> + * returns 1 if the end block is EXT3_RESERVE_WINDOW_NOT_ALLOCATED.
> + */
>  static inline int rsv_is_empty(struct ext3_reserve_window *rsv)
>  {
>  	/* a valid reservation end block could not be 0 */
>  	return (rsv->_rsv_end == EXT3_RESERVE_WINDOW_NOT_ALLOCATED);

Parentheses not needed, not CodingStyle.

>  }
> +
> @@ -308,7 +403,14 @@ void ext3_discard_reservation(struct ino
>  	}
>  }
>  
> -/* Free given blocks, update quota and i_blocks field */
> +/**
> + * ext3_free_blocks_sb() -- Free given blocks and update quota
> + * @handle		handle to this transaction

      @handle:

> + * @sb:			super block
> + * @block:		start physcial block to free
> + * @count:		number of blocks to free
> + * @pdquot_freed_blocks:pointer to quota

Add space after ':'

> + */
>  void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
>  			 ext3_fsblk_t block, unsigned long count,
>  			 unsigned long *pdquot_freed_blocks)
> @@ -931,7 +1079,8 @@ static int alloc_new_reservation(struct 
>  		if ((my_rsv->rsv_alloc_hit >
>  		     (my_rsv->rsv_end - my_rsv->rsv_start + 1) / 2)) {
>  			/*
> -			 * if we previously allocation hit ration is greater than half
> +			 * if we previously allocation hit ration is
> +			 * greater than half
>  			 * we double the size of reservation window next time
>  			 * otherwise keep the same
>  			 */

Is this close to what that means?

			/*
			 * If a previous allocation hit ratio is
			 * greater than 1/2, then we double the size
			 * of the reservation window the next time,
			 * otherwise we keep the same size window.
			 */

Note:  I don't know what "allocation hit ratio" means or if it
makes any sense.


---
~Randy

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642