Re: Blocking read() policy?
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 07/23/05
- Next message: Kasper Dupont: "Re: Blocking read() policy?"
- Previous message: Robert Redelmeier: "Re: Blocking read() policy?"
- In reply to: Robert Redelmeier: "Re: Blocking read() policy?"
- Next in thread: Robert Redelmeier: "Re: Blocking read() policy?"
- Reply: Robert Redelmeier: "Re: Blocking read() policy?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 23 Jul 2005 21:10:45 +0200
Robert Redelmeier wrote:
>
> Kasper Dupont <kasperd@daimi.au.dk> wrote:
> >
> > It doesn't require any particular advanced scheduler. The
> > scheduler have supported blocking for as long as I have
> > been using Linux and probably a lot longer than that.
>
> Yes, blocking has been supported for eons.
> However, immediate unblocking has not.
That feature has existed since linux-0.96a.
>
> The scheduler is the very heart of the OS. It sets much of
> the performance characteristics. It should use all availabe
> data in making rescheduling decisions. Including syscall
> frequency and types.
Quite the contrary. The scheduler should be kept
as simple as possible. Then you can build good
stuff on top of it. What happens in the read
system call is just something that happens on top
of the scheduler. The scheduler shouldn't worry
about the exact details of it, exactly like it
shouldn't worry about exact details of application
design.
>
> For a different example, a process that makes very few syscalls
> is probably doing a crunch of some kind. Those need CPU clocks
> but not low latency. They could be schedules for longer slices
> less frequently. Especially if pgms demanding short latency
> could get immediate service after unblocking interrupts.
It is correct, that a CPU intensive process would
usually perform better with long slices. But the
right way to detect that is by realizing how
rarely it sleeps.
Once concrete algorithm, which AFAIR is described
in a book by Tanenbaum does the following: Each
time a process use a full time slice, the length
of the time slices for that process is doubled.
This repeats until it blocks at which point it
starts over with the shortest possible time slice.
However the CPU is always given to a process in
the queue with the shortest time slices, only
when they have all blocked or used up their slice
you go to the next queue. (Probably I didn't
remember all the details, but I guess you get the
overall idea).
Of course the latency requirements means there is
a limit to how long the slices will get. At least
on a single CPU system. On a dual CPU system you
could be lucky and not need both CPUs at once for
processes with small CPU requirements.
>
> Think of a case where data is arriving at a more
> or less constant rate. An app more concerned with bandwidth
> than latency would be better if the kernel accumulated bigger
> buffers rather than rescheduling every packet.
Often such applications are really limited by the
network bandwidth and not the CPU. Those situations
that need both large amounts of CPU time and
communication, are better dealt with in user mode
than in kernel mode.
-- Kasper Dupont -- der bruger for meget tid på usenet. Note to self: Don't try to allocate 256000 pages with GFP_KERNEL on x86.
- Next message: Kasper Dupont: "Re: Blocking read() policy?"
- Previous message: Robert Redelmeier: "Re: Blocking read() policy?"
- In reply to: Robert Redelmeier: "Re: Blocking read() policy?"
- Next in thread: Robert Redelmeier: "Re: Blocking read() policy?"
- Reply: Robert Redelmeier: "Re: Blocking read() policy?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|