reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Smart fibration plugin ext_4321
@ 2016-12-25  0:59 Dušan Čolić
  2016-12-25  8:51 ` Dušan Čolić
  2016-12-26 18:47 ` Edward Shishkin
  0 siblings, 2 replies; 15+ messages in thread
From: Dušan Čolić @ 2016-12-25  0:59 UTC (permalink / raw)
  To: reiserfs-devel

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

Fibration is a great way to decrease fragmentation and increase throughput.
Currently there are 4 fibration plugins, lex, dot.o, ext_1 and ext_3
and they all have their upsides and downsides.

Proposed fibration plugin combines them all so that it combines files
with same extensions for 1, 2. 3 and 4 character extension  in groups
and sorts them in same fiber group.

With this fibration plugin all eg. xvid files would be in same group
in folder on disk sorted alphabetically so that we will avoid putting
small files between them and in that way reduce fragmentation. That
group (xvid 4 character extensions) would be among last groups under
one directory so that all small files would be written before it.

Problem with the attached patch is that currently every fibre value is
defined as u64  (eg. static __u64 fibre_ext_3) but if I understood
correctly comments in kassign.c and fibration.c fibration part of the
key is only 7 bits long.
If that is true how did fibre_ext_3 worked?

Thanks

Dushan

[-- Attachment #2: fibration_ext_4321.patch --]
[-- Type: application/octet-stream, Size: 2032 bytes --]

Signed-off-by:Dushan Tcholich <dusanc@gmail.com>

--- linux-4.8.15-gentoo/fs/reiser4/plugin/fibration.c	2016-12-24 18:22:09.679645971 +0100
+++ linux/fs/reiser4/plugin/fibration.c	2016-12-25 01:31:43.700383624 +0100
@@ -81,6 +81,25 @@ static __u64 fibre_ext_3(const struct in
 		return FIBRE_NO(0);
 }
 
+/*
+* ext.4321 fibration: try to separate files with different 1, 2, 3 and 4-character
+* extensions from each other.
+*/
+
+static __u64 fibre_ext_4321(const struct inode *dir, const char *name, int len)
+{
+	if (len > 5 && name[len - 5] == '.')
+		return FIBRE_NO(name[len - 4] + name[len - 3] + name[len - 2] + name[len - 1] + 768);
+	else if (len > 4 && name[len - 4] == '.')
+		return FIBRE_NO(name[len - 3] + name[len - 2] + name[len - 1] + 384);
+	else if (len > 3 && name[len - 3] == '.')
+		return FIBRE_NO(name[len - 2] + name[len - 1] + 128);
+	else if (len > 2 && name[len - 2] == '.')
+		return FIBRE_NO(name[len - 1]);
+	else
+		return FIBRE_NO(0);
+} 
+
 static int change_fibration(struct inode *inode,
 			    reiser4_plugin * plugin,
 			    pset_member memb)
@@ -161,7 +180,18 @@ fibration_plugin fibration_plugins[LAST_
 			.linkage = {NULL, NULL}
 		},
 		.fibre = fibre_ext_3
-	}
+	},
+        [FIBRATION_EXT_4321] = {
+                .h = {
+                        .type_id = REISER4_FIBRATION_PLUGIN_TYPE,
+                        .id = FIBRATION_EXT_4321,
+                        .pops = &fibration_plugin_ops,
+                        .label = "ext-4321",
+                        .desc = "fibrate file by 4, 3, 2 and 1 character extension",
+                        .linkage = {NULL, NULL}
+                },
+                .fibre = fibre_ext_4321
+        }
 };
 
 /*
--- linux-4.8.15-gentoo/fs/reiser4/plugin/fibration.h	2016-12-24 18:22:09.683646147 +0100
+++ linux/fs/reiser4/plugin/fibration.h	2016-12-25 01:19:12.975390151 +0100
@@ -20,6 +20,7 @@ typedef enum {
 	FIBRATION_DOT_O,
 	FIBRATION_EXT_1,
 	FIBRATION_EXT_3,
+	FIBRATION_EXT_4321,
 	LAST_FIBRATION_ID
 } reiser4_fibration_id;
 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-01-07 19:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-25  0:59 [RFC] Smart fibration plugin ext_4321 Dušan Čolić
2016-12-25  8:51 ` Dušan Čolić
2016-12-26 18:47 ` Edward Shishkin
2016-12-26 21:13   ` Dušan Čolić
2017-01-06 13:44     ` Edward Shishkin
2017-01-06 15:34       ` Dušan Čolić
2017-01-06 19:58         ` Edward Shishkin
2017-01-06 23:09           ` Dušan Čolić
2017-01-06 23:05             ` Edward Shishkin
2017-01-07  8:15               ` Dušan Čolić
2017-01-07  7:58                 ` Edward Shishkin
2017-01-07 17:10                   ` Dušan Čolić
2017-01-07 17:56                     ` Edward Shishkin
2017-01-07 19:26                       ` Dušan Čolić
2017-01-07 19:06                         ` Edward Shishkin

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