From: Phillip Susi <psusi@cfl.rr.com>
To: "Török Edvin" <edwintorok@gmail.com>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCH][RFC] Rearranging files to improve disk performanc
Date: Mon, 25 Sep 2006 16:06:36 -0400 [thread overview]
Message-ID: <451836CC.2010003@cfl.rr.com> (raw)
In-Reply-To: <4354d3270609231211r6b9227fdhb88a6dc8822fc803@mail.gmail.com>
This ability is already available at least for ext2/3 in the old defrag
package, which can take a list of files and priorities to assign to
them, and it will pack them in the order given at the start of the disk.
As for your idea, if there is going to be online defrag support in the
kernel ( and yes, this is a form of defragmenting ) I'd rather see the
ability to move files around deterministically rather than just give a
hint and pray, similar to how windows handles online defragmenting.
Török Edvin wrote:
> Hello,
>
> I am trying to implement a feature in the kernel to allow rearranging
> files on the disk in order to improve performance.
> The purpose is to reduce seeks. Before you say:"we don't need
> defragmenting", note that this is _not_ defragmenting.
>
> This is what I want to accomplish:
> - a userspace program determines in what order are files accessed
> (during boot, startup, etc.), and generates a list of files that are
> always accessed
> in a certain order
> - rearranging these files to be one-after-another will improve disk
> performance (it won't have to seek forward/backward)
>
> This is how I suggest to implement it:
> - a userspace program gives a 'hint' to the kernel where certain
> files should be placed
> [it opens the file, sends the kernel a hint, copies the file to a temp
> storage, truncates, and rewrites file: thus the file will end up in a
> new location]
> - when the kernel allocates space for inodes, it first verifies if
> there is a 'hint' for that inode, if there is, it tries to honor it
> - there has to be a way to communicate between kernel/userspace the
> following: userspace->kernel: which file should be placed where,
> kernel->userspace: if it managed to honor userspace hints or not
>
>
> The following questions came up while developing this:
> - what exactly should the 'hint' contain (I chose: inode, device, disk
> location, size)
> - how should the userspace program communicate with the kernel? (I
> chose sysfs for now)
> - if sysfs is going to be used, in which directory should files be put?
> - should the kernel also preallocate space when receiving a hint
> - how should errors be reported? (sysfs?)
> - where is the appropriate place to put this stuff? (fs/relayout.c?)
> - how can the implementation be as generic as possible (have as much
> fs-independent code as possible)
> - what can we do if there isn't enough contigous free disk space
> available for moving the file (risk fragmenting the file?)
> - is somebody else currently trying to implement a similar feature?
>
> The patch below also contains a sample of how the relayout functions
> could be used, in this case for reiserfs. (I intend to have support
> for at least
> ext3, and xfs too, but of course ideal would be if all fs-s would
> support this)
>
>
> I am sending this patch (a draft), and waiting for your feedback on it
> (and on my questions above), before going any further.
>
<snip>
next prev parent reply other threads:[~2006-09-25 20:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-23 19:11 [PATCH][RFC] Rearranging files to improve disk performanc Török Edvin
2006-09-25 20:06 ` Phillip Susi [this message]
2006-09-26 15:52 ` Török Edvin
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=451836CC.2010003@cfl.rr.com \
--to=psusi@cfl.rr.com \
--cc=edwintorok@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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