Re: Blocking read() policy?
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 07/21/05
- Previous message: Todd Knarr: "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: Thu, 21 Jul 2005 17:59:17 +0200
Robert Redelmeier wrote:
>
> Kasper Dupont <kasperd@daimi.au.dk> wrote:
> > No, that is not a good enough reason to preempt the process.
>
> Wasting resources polling isn't bad?
Sure, but making the kernel more complicated for no
good reason is worse.
>
> > Detecting this situation would be very complicated, just counting
> > system calls would lead to false positives. The very limited
> > value of this feature does not justify the hughe complexity it
> > would require to implement this correctly in the kernel.
>
> What's tough about keeping a rolling list of RDTSC words for
> stupid syscalls (read() null returns) and calling the scheduler
> if too few cycles have elapsed since the Yth previous?
You will be wasting memory on the the list, you will
be wasting CPU time on keeping it updated and
performing the checks. You will not know what the
right values for number of calls and time should be.
You will end up with false positives blocking
processes that shouldn't have been blocked.
And depending on the exact implementation those false
positives will lead to very poor performance or even
deadlocks.
>
> > Exactly. Any program behaving the way you describe is
> > buggy. The correct solution to any such problem is to fix
> > the bug in the application.
>
> Ideally, yes.
>
> > As long as it doesn't hurt the integrity of the system,
> > the kernel shouldn't worry about buggy programs.
>
> Yes, this is one approach. But does not lead to
> system optimization.
What is better? The current approach where only buggy
applications waste resources, or your approach where
the kernel will waste resources even when all
applications are well behaved?
>
> >> But I haven't seen anyone suggest it.
> > For good reasons.
>
> I was referring to "fixing pgms", not rescheduling.
Do you know any widely used application with such a
bug?
-- Kasper Dupont -- der bruger for meget tid på usenet. Note to self: Don't try to allocate 256000 pages with GFP_KERNEL on x86.
- Previous message: Todd Knarr: "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
|