Re: Kernel-bound applications?

Richard Gooch (Richard.Gooch@atnf.CSIRO.AU)
Thu, 23 Jul 1998 12:23:11 +1000


Kirk Petersen writes:
> > I am trying to write a list of common applications that are
> > performance-bound by the kernel. Note that this is distinct from
> > applications that are bound by the _hardware_ (e.g. standard
> > Ethernet cannot be made to transfer data faster than 10 Mbps),
> > including the CPU (e.g. floating point code).
>
> I'm working on a couple methods of optimizing local X Windows
> communications. On my machine, it takes something like 100-300
> useconds to do reads/writes over a Unix domain socket whereas
> copying data via a shared, mmap()ed file (using file locking to
> synchronize) takes about 30 useconds.
>
> So, I'm looking at ways of speeding up Unix domain sockets (I'm also
> looking at writing an shared memory xtrans driver, but that is
> probably less practical and off-topic). It seems to me that
> the slow down comes from the buffers that are allocated every
> time a read or write is called. But I haven't done enough testing
> to be sure of this.

Two things you might like to consider (they aren't necessarily
easy;-):

- direct copying from writing process to reading process. This would
require you to read the page tables of the reading process so you can
copy_from_user() to the physical pages of the reading process. You'll
need to pin down the reading process pages

- when user buffers are page aligned and at least one page in size, do
page flipping.

Both these techniques require page table accesses, which will have
some overhead. You might also need to consider cache issues.
Do it and benchmark it :-)

Regards,

Richard....

-
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.altern.org/andrebalsa/doc/lkml-faq.html