mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Monitoring file descriptors without switching context
@ 2010-01-11 10:29 Erik Rigtorp
  2010-01-11 10:59 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Rigtorp @ 2010-01-11 10:29 UTC (permalink / raw)
  To: linux-kernel

Hi!

I'm working on a low latency soft real time system. We currently run
on Solaris because it has a lower latency TCP stack and less IPC
overhead. I did some experiments with IPC using pipes on Linux. If i
use non-blocking pipes and do a busy reading loop I can achieve
latencies around 1µs. Using blocking pipes or select()/poll()
latencies increase to about 10µs. In general when I use some blocking
system call latencies increase because my process will be put on a
wait queue and the scheduler will do a context switch. However I have
more cores than I have processes/threads  so I don't mind blocking a
whole core to wait for IO, that way I don't incur a full context
switch when the process waits for IO.

What I really need is some way to have the hardware block and monitor
IO for me. Would it be feasible to implement a special low latency
poll() syscall that uses MONITOR/MWAIT instructions to monitor file
descriptors?

I think in order to utilize new multicore CPUs like the Tileras we
need a better signaling mechanism with lower latency than what we
currently have using the scheduler.

Erik Rigtorp

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

* Re: Monitoring file descriptors without switching context
  2010-01-11 10:29 Monitoring file descriptors without switching context Erik Rigtorp
@ 2010-01-11 10:59 ` Alan Cox
  2010-01-11 11:51   ` Erik Rigtorp
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2010-01-11 10:59 UTC (permalink / raw)
  To: Erik Rigtorp; +Cc: linux-kernel

> What I really need is some way to have the hardware block and monitor
> IO for me. Would it be feasible to implement a special low latency
> poll() syscall that uses MONITOR/MWAIT instructions to monitor file
> descriptors?

The futex locks are probably the lowest level interface you've got for
interlocking between tasks and are very fast. You can also pin tasks to
groups of cpus so you can create an I/O only core for example.

Alan

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

* Re: Monitoring file descriptors without switching context
  2010-01-11 10:59 ` Alan Cox
@ 2010-01-11 11:51   ` Erik Rigtorp
  0 siblings, 0 replies; 3+ messages in thread
From: Erik Rigtorp @ 2010-01-11 11:51 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Mon, Jan 11, 2010 at 11:59, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> What I really need is some way to have the hardware block and monitor
>> IO for me. Would it be feasible to implement a special low latency
>> poll() syscall that uses MONITOR/MWAIT instructions to monitor file
>> descriptors?
>
> The futex locks are probably the lowest level interface you've got for
> interlocking between tasks and are very fast. You can also pin tasks to
> groups of cpus so you can create an I/O only core for example.
>

For core to core signaling the fastest way is to use a memory polling
loop. Cache control instructions allows me to make sure I use L3 for
intra-cpu communication. The problem is that I also need to monitor
file descriptors and if I can make them fast enough that would be
preferable because I'm also signaled when they close.

Erik

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

end of thread, other threads:[~2010-01-11 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-11 10:29 Monitoring file descriptors without switching context Erik Rigtorp
2010-01-11 10:59 ` Alan Cox
2010-01-11 11:51   ` Erik Rigtorp

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

all inboxes | Powered by JetHome®