linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: reiserfs: G-blockalloc-for-disk-90%full.patch
@ 2001-08-30 14:29 Nikita Danilov
  0 siblings, 0 replies; only message in thread
From: Nikita Danilov @ 2001-08-30 14:29 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Reiserfs developers mail-list, Linux kernel developer's mailing list

Hello, Linus,

   This patch improves behavior of reiserfs block allocator when free
   space is low. By default reiserfs uses so called "border algorithm"
   that reserves first 10% of disk for "formatted nodes" that is,
   nodes of reiserfs tree. With this patch this distinction is dropped
   when free space goes below 10% of total disk space. This has been
   found to improve performance.

This patch is against 2.4.10-pre2.
Please apply.

Nikita.
diff -rup linux/fs/reiserfs/bitmap.c linux.patched/fs/reiserfs/bitmap.c
--- linux/fs/reiserfs/bitmap.c	Wed May  2 14:04:15 2001
+++ linux.patched/fs/reiserfs/bitmap.c	Thu Aug 30 17:19:09 2001
@@ -499,6 +499,7 @@ int reiserfs_new_unf_blocknrs2 (struct r
   unsigned long border = 0;
   unsigned long bstart = 0;
   unsigned long hash_in, hash_out;
+  unsigned long saved_search_start=search_start;
   int allocated[PREALLOCATION_SIZE];
   int blks;
 
@@ -604,7 +605,15 @@ int reiserfs_new_unf_blocknrs2 (struct r
   ** and should probably be removed
   */
   if ( search_start < border ) search_start=border; 
-  
+
+  /* If the disk free space is already below 10% we should 
+  ** start looking for the free blocks from the beginning 
+  ** of the partition, before the border line.
+  */
+  if ( SB_FREE_BLOCKS(th->t_super) <= (SB_BLOCK_COUNT(th->t_super) / 10) ) {
+    search_start=saved_search_start;
+  }
+
   *free_blocknrs = 0;
   blks = PREALLOCATION_SIZE-1;
   for (blks_gotten=0; blks_gotten<PREALLOCATION_SIZE; blks_gotten++) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-30 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30 14:29 [PATCH]: reiserfs: G-blockalloc-for-disk-90%full.patch Nikita Danilov

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).