public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Unneeded Code Found??
@ 2004-01-09 23:28 Randy Appleton
  2004-01-15 16:02 ` Bill Davidsen
  2004-01-23 22:10 ` Jens Axboe
  0 siblings, 2 replies; 9+ messages in thread
From: Randy Appleton @ 2004-01-09 23:28 UTC (permalink / raw)
  To: linux-kernel

I think I have found some useless code in the Linux kernel
in the block request functions.
                                                                                         
 
I have modified the __make_request function in ll_rw_blk.c.
Now every request for a block off the hard drive is logged.
                                                                                         
 
The function __make_request has code to attempt to merge the current
block request with some contigious existing request for better
performance. This merge function keeps a one-entry cache pointing to the
last block request made.  An attempt is made to merge the current
request with the last request, and if that is not possible then
a search of the whole queue is done, looking at merger possibililites.
                                                                                         
 
Looking at the data from my logs, I notice that over 50% of all requests
can be merged.  However, a merge only ever happens between the
current request and the previous one.  It never happens between the
current request and any other request that might be in the queue (for
more than 50,000 requests examined).
                                                                                         
 
This is true for several test runs, including "daily usage" and doing
two kernel compiles at the same time.  I have only tested on a
single-CPU machine.
                                                                                         
 
I wonder if the code (and CPU time) used to search the entire request
queue is actually useful.  Would this be a reasonable candidate for code
elimination?

-Much Thanks
-Randy Appleton
rappleto@nmu.edu



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

end of thread, other threads:[~2004-01-25 21:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-09 23:28 Unneeded Code Found?? Randy Appleton
2004-01-15 16:02 ` Bill Davidsen
2004-01-19  0:58   ` Randy Appleton
2004-01-19  0:30     ` Mike Fedyk
2004-01-19  5:54     ` Nick Piggin
2004-01-23 22:23       ` Randy Appleton
2004-01-24  0:00         ` Nick Piggin
2004-01-25 22:36           ` Randy Appleton
2004-01-23 22:10 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox