linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikita Danilov <Nikita@Namesys.COM>
To: Linus Torvalds <Torvalds@Transmeta.COM>
Cc: Reiserfs developers mail-list <Reiserfs-Dev@Namesys.COM>,
	"Linux kernel developer's mailing list" 
	<linux-kernel@vger.kernel.org>
Subject: [PATCH]: reiserfs: G-blockalloc-for-disk-90%full.patch
Date: Thu, 30 Aug 2001 18:29:47 +0400	[thread overview]
Message-ID: <15246.19931.916062.854564@gargle.gargle.HOWL> (raw)

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++) {

                 reply	other threads:[~2001-08-30 14:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15246.19931.916062.854564@gargle.gargle.HOWL \
    --to=nikita@namesys.com \
    --cc=Reiserfs-Dev@Namesys.COM \
    --cc=Torvalds@Transmeta.COM \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).