2004-06-23 16:39:13

by Marcus Hartig

[permalink] [raw]
Subject: status of Preemptible Kernel 2.6.7

Hello,

how is now the status of the preemptible feature of the kernel 2.6.7.
Should preempt be used for desktop systems (like in the help menu) or
should it not really?

I have made tests with the alsa-latency-test, where it not really
reduces the latency of the kernel and gives a little bit lower
performance of the whole system.


Regards,
Pl.cc me.

Marcus

--
http://www.marcush.de


2004-06-23 17:38:32

by Timothy Miller

[permalink] [raw]
Subject: Re: status of Preemptible Kernel 2.6.7



Marcus Hartig wrote:
> Hello,
>
> how is now the status of the preemptible feature of the kernel 2.6.7.
> Should preempt be used for desktop systems (like in the help menu) or
> should it not really?
>
> I have made tests with the alsa-latency-test, where it not really
> reduces the latency of the kernel and gives a little bit lower
> performance of the whole system.


I vaguely recall someone recently talking about eliminating preempt by
improving low-latency. See, if everything were ideal, we wouldn't need
preempt, because all drivers would yield the CPU at appropriate times.
Supposedly, preempt introduces some undesirable overhead.

Perhaps we could turn preempt into some kind of watch-dog. If a kernel
thread doesn't behave, it gets killed. :)

2004-06-23 19:01:10

by Robert Love

[permalink] [raw]
Subject: Re: status of Preemptible Kernel 2.6.7

On Wed, 2004-06-23 at 13:57 -0400, Timothy Miller wrote:

> I vaguely recall someone recently talking about eliminating preempt by
> improving low-latency. See, if everything were ideal, we wouldn't need
> preempt, because all drivers would yield the CPU at appropriate times.

If everything held locks for only sane periods of time, we would not
need gross explicit yielding all over the place.

To answer Marcus's question: go for it and use it.

Robert Love


2004-06-23 19:11:17

by Timothy Miller

[permalink] [raw]
Subject: Re: status of Preemptible Kernel 2.6.7



Robert Love wrote:
> On Wed, 2004-06-23 at 13:57 -0400, Timothy Miller wrote:
>
>
>>I vaguely recall someone recently talking about eliminating preempt by
>>improving low-latency. See, if everything were ideal, we wouldn't need
>>preempt, because all drivers would yield the CPU at appropriate times.
>
>
> If everything held locks for only sane periods of time, we would not
> need gross explicit yielding all over the place.
>
> To answer Marcus's question: go for it and use it.


I wasn't talking about locks. I was talking about kernel functions
taking long periods of time, cases where preempt has been useful to
reduce kernel latency.

Holding locks for extended periods is something else entirely.

I presume there are sane cases where a kernel function will need to
execute for a "long time", like when doing PIO disk access or COW, etc.
It would be good to have a way to limit the impact of those functions
in terms of user-perceived latency, just as preempt has done, but
without preempt.

At least, I thought that was the idea.

Now, the thing is, if you have explicit cooperative yields, then a slow
CPU might not yield often enough, and a fast CPU would yield too often.
Preempt has the advantage of using real time so that CPUs can
maximize throughput without affecting latency.


2004-06-23 19:23:33

by Robert Love

[permalink] [raw]
Subject: Re: status of Preemptible Kernel 2.6.7

On Wed, 2004-06-23 at 15:30 -0400, Timothy Miller wrote:

> I wasn't talking about locks. I was talking about kernel functions
> taking long periods of time, cases where preempt has been useful to
> reduce kernel latency.
>
> Holding locks for extended periods is something else entirely.

I know what you were talking about. I was replying that it seems better
overall to me if we work to eliminate long lock hold times (which then
eliminates long non-preemption times) than litter the kernel with
explicit rescheduling statements.

Robert Love


2004-06-23 19:39:40

by Timothy Miller

[permalink] [raw]
Subject: Re: status of Preemptible Kernel 2.6.7



Robert Love wrote:
> On Wed, 2004-06-23 at 15:30 -0400, Timothy Miller wrote:
>
>
>>I wasn't talking about locks. I was talking about kernel functions
>>taking long periods of time, cases where preempt has been useful to
>>reduce kernel latency.
>>
>>Holding locks for extended periods is something else entirely.
>
>
> I know what you were talking about. I was replying that it seems better
> overall to me if we work to eliminate long lock hold times (which then
> eliminates long non-preemption times) than litter the kernel with
> explicit rescheduling statements.

Yes, getting rid of locks does seem to be a more immediately productive
thing to do.

Are there any cases where we claim locks on data, rather than metadata?
That is to say, one would prefer to lock, claim a pointer or reference
or such, and then unlock, rather than to lock, manipulate data, and then
unlock, right?

There might be situations where the data structures involved are larger
(more pointers, flags, etc.), but we can get control of data without
having to hold a lock on it.

Am I making sense? :)

2004-06-24 13:18:55

by Marcus Hartig

[permalink] [raw]
Subject: Re: status of Preemptible Kernel 2.6.7

Robert Love wrote:

> To answer Marcus's question: go for it and use it.

Ok, thanks for an answer. I will try it again with preempt and today I
make some latency tests with 2.6.7.


Regards,

Marcus

--
http://www.marcush.de