Re: Is 2.3.7 only better for SMP?

Ingo Molnar (mingo@chiara.csoma.elte.hu)
Tue, 22 Jun 1999 12:22:18 +0200 (CEST)


On Mon, 21 Jun 1999, Jim Nance wrote:

> Hi All,
> Just a quick question about 2.3.7. Are the improvements only going to
> help SMP machines, or are they good for uniprocessor machines too?

the 2.3.7 pagecache changes give so much more than just raw SMP
performance:

- write()s do not have to copy data twice anymore. Until now, every
write() first copied data from user-space into the 'buffer-cache', then
copied those changes into the 'page-cache' as well. With 2.3.7 only the
page-cache is used for caching file data. This is what other OSs
sometimes call a 'unified page cache'. [note that read() was already
'unified' since the 2.0 kernel - this is why this problem only showed up
for certain, write intensive applications like Squid] This has two
benefits: the obvious performance win, but more importantly, we dont do
'double buffering' anymore, which reduces memory pressure alot. I have
(some time ago) benchmarked Squid with a memory-intensive workload, and
saw a 30% speedup just due to no double-buffering.

- fsync() got much faster. Now that the page cache is used for caching
file data exclusively, it's much easier to find all cached pages
belonging to a file. Former kernels had to do costy buffer-cache lookups
for every _possible_ cached page/buffer - this was quite an overhead for
large files.

- bmap() overhead is completely eliminated for cached read()/write().
Until now, every IO and every write() had to call an fs-specific
'bmap()' function, which parsed file metadata to find out the
logical->physical block mapping of data blocks. This is now cached in
per-page structures and speeds up write() and read() noticeably. It
also possibly enables us to free filesystem metadata much more
aggressively even if data contents remain cached.

- 'partial page' IO and cached IO got better. We do the right thing
for everything, if on a 1k filesystem, one block within a page is
dirtied, we do not read-in the rest of the page. If it's read
afterwards then we do not read-back the already dirtied block. These
sorts of 'partial page' properties got much more 'right' with the new
pagecache.

there are a couple of other improvements as well. In short, the pagecache
simply got perfect, we just have to fix a couple of bugs :)

> PS: Im running 2.3.7 on a uniprocessor right now. I have not killed my
> file system yet :-)

i'd suggest trying pre2-2.3.8, Linus has fixed a couple of bad bugs which
could corrupt file data and cause oopses.

-- mingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/