FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Masters Of The Universe

 
 
LinkBack Thread Tools
 
Old 02-12-2009, 01:50 AM
Scott James Remnant
 
Default boot-time async readahead...

On Thu, 2009-02-12 at 00:57 +0000, Daniel J Blueman wrote:

> By modifying the boot-time readahead to be at lower I/O and processor
> priority than the boot scripts and asynchronous, I see a 20% reduction
> in overall boot time (from installing bootchart) on my desktop: 41s
> down to 33s.
>
This is generally a benefit on SSD or very high speed rotary disks, but
a drawback on low speed rotary disks or machines with low memory.

Scott
--
Scott James Remnant
scott@canonical.com
--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 
Old 02-12-2009, 01:55 AM
Surfaz Gemon Meme
 
Default boot-time async readahead...

2009/2/12 Daniel J Blueman <daniel.blueman@gmail.com>


and prebuilt a jaunty/intrepid x86-64 package (sorry, no ia32 h/w) at:

http://quora.org/hive/readahead_0.20050517.0220-1ubuntu5_amd64.deb



I'm interested in feedback and what performance benefit others see, to

see if it's worthwhile we get this reviewed and uploaded.


Upload .debdiff or .diff.gz file for make a i386 package.

--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 
Old 02-12-2009, 04:44 AM
John Moser
 
Default boot-time async readahead...

On 2/11/09, Daniel J Blueman <daniel.blueman@gmail.com> wrote:
> By modifying the boot-time readahead to be at lower I/O and processor
> priority than the boot scripts and asynchronous, I see a 20% reduction
> in overall boot time (from installing bootchart) on my desktop: 41s
> down to 33s.


A while back I pointed out that the file list for read-ahead was
sorted by block rather than boot sequence; and that by leaving it
sorted by boot sequence (i.e. first read == first need) and
parallelling it you would necessarily have exactly two states: 1)
waiting for a file readahead is trying to read anyway; 2) readahead is
ahead of you because the rest of the boot process has spent some time
CPU bound and not touching I/O. Also, it's likely as soon as you
enter state (2) that you stay there-- which is to say, almost
immediately.

I showed some modest gains paralleling readahead with the rest of the
boot process, and not block-sorting. Nobody cares. The theory that
seeking all over the disk is slower (it is) and thus should never be
done in any case, and thus we should give readahead its own process to
make sure nothing causes a disk seek, and thus we should also sort
readahead's file list by physical position on the disk, and thus we
also assume there's no such thing as fragmentation, just happens to be
favored.

--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 
Old 02-12-2009, 07:18 AM
Martin Pitt
 
Default boot-time async readahead...

Daniel J Blueman [2009-02-12 0:57 +0000]:
> I've produced a complete and tested debdiff at:
> http://quora.org/hive/readahead-list_0.20050517.0220-1ubuntu5.diff.gz

To spare anyone else the fun with discovering the double gzip'ing and
diffing, that's the real debdiff.

Thanks Daniel, will try it out

Martin

--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
diff -u readahead-list-0.20050517.0220/debian/changelog readahead-list-0.20050517.0220/debian/changelog
--- readahead-list-0.20050517.0220/debian/changelog
+++ readahead-list-0.20050517.0220/debian/changelog
@@ -1,3 +1,10 @@
+readahead-list (1:0.20050517.0220-1ubuntu5) intrepid; urgency=low
+
+ * Perform readahead asynchronously, after setting background
+ process and I/O priorities.
+
+ -- Daniel J Blueman <daniel.blueman@gmail.com> Wed, 12 Feb 2009 23:30:11 +0000
+
readahead-list (1:0.20050517.0220-1ubuntu4) intrepid; urgency=low

* Regenerate boot.list using an installation of 20081026, excluding
only in patch2:
unchanged:
--- readahead-list-0.20050517.0220.orig/debian/patches/60-scheduling.patch
+++ readahead-list-0.20050517.0220/debian/patches/60-scheduling.patch
@@ -0,0 +1,51 @@
+--- readahead-list-0.20050517.0220/src/readahead-list.c-orig 2009-02-11 23:22:38.865366713 +0000
++++ readahead-list-0.20050517.0220/src/readahead-list.c 2009-02-12 00:28:33.584366942 +0000
+@@ -24,6 +24,7 @@
+ #include <unistd.h>
+ #include <getopt.h>
+ #include <sys/syscall.h>
++#include <sys/syscall.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+@@ -172,8 +173,6 @@
+ }
+
+ close(fd);
+- /* be nice to other processes now */
+- sched_yield();
+ #undef __FUNCTION__
+ }
+
+@@ -362,10 +361,31 @@
+ if(flag_version || flag_help) {
+ exit(0);
+ }
++
++ // initialisation complete; background to allow boot-scripts to continue
++ pid_t pid = fork();
++ if (pid == -1) {
++ fprintf(stderr, "failed to fork: %d
", errno);
++ exit(1);
++ } else if (pid) {
++ // parent process exits, child finishes work
++ exit(0);
++ }
++
++ // ensure we don't compete for resources with boot scripts
++ // but utilise cpu during I/O wait and vice-versa
++ nice(3);
++#ifdef __NR_ioprio_set
++ syscall(__NR_ioprio_set, 1 /* IOPRIO_WHO_PROCESS, */, getpid(), 3 /* IOPRIO_CLASS_IDLE */);
++#else
++ ioprio_set(IOPRIO_WHO_PROCESS, getpid(), IOPRIO_CLASS_IDLE);
++#endif
++
+ // now do the work
+ for (i=optind; i<argc; i++) {
+ process_files(argv[i]);
+ }
++
+ if (flag_sort)
+ process_sorted_files();
+ return 0;
--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 
Old 02-12-2009, 01:46 PM
Scott James Remnant
 
Default boot-time async readahead...

On Thu, 2009-02-12 at 00:44 -0500, John Moser wrote:

> On 2/11/09, Daniel J Blueman <daniel.blueman@gmail.com> wrote:
> > By modifying the boot-time readahead to be at lower I/O and processor
> > priority than the boot scripts and asynchronous, I see a 20% reduction
> > in overall boot time (from installing bootchart) on my desktop: 41s
> > down to 33s.
>
>
> A while back I pointed out that the file list for read-ahead was
> sorted by block rather than boot sequence; and that by leaving it
> sorted by boot sequence (i.e. first read == first need) and
> parallelling it you would necessarily have exactly two states: 1)
> waiting for a file readahead is trying to read anyway; 2) readahead is
> ahead of you because the rest of the boot process has spent some time
> CPU bound and not touching I/O. Also, it's likely as soon as you
> enter state (2) that you stay there-- which is to say, almost
> immediately.
>
Not true at all.

Remember that in the rotary disk case, it's not just I/O wait that kills
you, but it's also the seek time of the disk.

If the readahead list is sorted in need order, and run alongside other
I/O activity, the disk is seeking all over the place.

When sorted by block order, and run in one pass, the seek time should be
eliminated.

Again, this all depends on _your_ disk.

Nobody other than Martin is following up with bootcharts[0] -- and his
shows that parallel is a little worse then sync.

The archives of ubuntu-devel will show my own investigation on this at
the time. In summary:

Sync is *always* better than no readahead at all.
Parallel is *sometimes* better than no readahead, but in various cases
is actually _worse_.
When Parallel is not worse then no readahead, it is better than sync.

Since the out-of-the-box has to work for everyone, I chose sync.


If you have a very fast rotary disk (which Martin doesn't ) or SSD,
you definitely want parallel. But I'd then also recommend using
sreadahead instead of readahead-list.

I have some packages of sreadahead pending upload; but they require a
kernel patch.

Scott

[0] though I should follow up with Martin OOB, because there's something
very wrong with his machine
--
Scott James Remnant
scott@canonical.com
--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 
Old 02-13-2009, 09:29 PM
Phillip Susi
 
Default boot-time async readahead...

Scott James Remnant wrote:
> Sync is *always* better than no readahead at all.
> Parallel is *sometimes* better than no readahead, but in various cases
> is actually _worse_.
> When Parallel is not worse then no readahead, it is better than sync.
>
> Since the out-of-the-box has to work for everyone, I chose sync.

You may be able to get the best of both worlds. Take the readahead list
sorted in order of access. Split the list in half. Sort each
individual half by block address. Now do a sync readahead of the first
list, and async readahead of the second. Set the io priority of the
async readahead to a very high value so that should a startup process
request a block that has not yet been read ahead, it will not cause a
seek, but instead will just wait for readahead to get there in the right
order.

Also it sure would be nice to defrag the disk so the files are placed in
the order they are accessed.


--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 

Thread Tools




All times are GMT. The time now is 02:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org