login
Header Space

 
 

Re: root disk vs. mj disk, also hd.c patch

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Wednesday, August 12, 1992 - 6:56 pm

In article <1992Aug12.011334.17155@ultb.isc.rit.edu> axi0349@ultb.isc.rit.edu (A.X. Ivasyuk ) writes:

By using shared libraries, and the "-N" flag, and stripping the result
you can often make trivial binaries that are much less than 9kB. BUT
they won't demand-load nor share pages, so it's worth it only if the
binary is truly small. Using "-N" on bigger binaries will result in bad
performance and memory waste when running it.


It's not to hd.c but to linux/fs/buffer.c - in the function
grow_buffers(). 0.97.pl1 has code that looks something like this:

        for (i = 0 ; i+size <= 4096 ; i += size) {
                bh = get_unused_buffer_head();
                ....
-               i += size;
        }

As you can see, 'i' is updated twice ('i += size' both inside the
for-loop and as the terminating expression), resulting in using only
half the available space in a page for buffers.  The fix is to remove
the line I have marked with a "-".  The above simple fix results in much
better free memory utilization, and a marked improvement in performance
under some circumstances. 

                Linus
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: root disk vs. mj disk, also hd.c patch, Linus Benedict Torvalds, (Wed Aug 12, 6:56 pm)
speck-geostationary