Re: Xterm Hangs - Possible scheduler defect?

From: Ingo Oeser (ioe-lkml_at_axxeo.de)
Date: 02/25/05

  • Next message: Christian Borntraeger: "Re: Invalid module format in Fedora core2"
    To: Chris Friesen <cfriesen@nortel.com>
    Date:	Fri, 25 Feb 2005 16:39:50 +0100
    
    

    Chris Friesen wrote:
    > Ingo Oeser wrote:
    > > Stupid applications can starve other applications for a while, but not
    > > forever, because the kernel is still running and deciding.
    >
    > Not so.
    >
    >
    >
    > task 1: sched_rr, priority 1, takes mutex
    > task 2: sched_rr, priority 2, cpu hog, infinite loop
    > task 3: sched_rr, priority 99, tries to get mutex
    >
    > And now tasks 1 and 3 are starved forever. Arguably bad application
    > design, but it demonstrates a case where applications can starve other
    > applications.

    You are right.
     
    In "If a SCHED_RR process has been running for a time period equal to or
    longer than the time quantum, it will be put at the end of the list for
    its priority" I missed the "for its priority" part.

    You would need to change the priority of task 1 until it releases the
    mutex. Ideally the owner gets the maximum priority of
    his and all the waiters on it, until it releases his mutex, where he regains
    its old priority after release of mutex. But this priority elevation happens
    only, if he is runnable. If not, he gets his old priority back, until he is
    runnable.

    But then again you just need to grab a mutex shared with a high priority
    task and consume CPU.

    Since this behavior is not defined in POSIX AFAIK, you just have
    to write your applications properly or use SCHED_OTHER for CPU hogging.

    Regards

    Ingo Oeser

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Christian Borntraeger: "Re: Invalid module format in Fedora core2"

    Relevant Pages

    • Re: How do I get a non-root process to be able to change scheduling policy?
      ... have this SCHED_FIFO response more 'fast' than others. ... These are applications where timing is ... part of the purpose of the application. ... does not dynamically adjust the priority based on behavior. ...
      (comp.os.linux.development.system)
    • Re: How do I get a non-root process to be able to change scheduling policy?
      ... have "real time" requirements. ... These are applications where timing is ... part of the purpose of the application. ... does not dynamically adjust the priority based on behavior. ...
      (comp.os.linux.development.system)
    • Re: Wireless Multimedia (WMM) question
      ... applications get automatically higher priority in the network or these ... If for using the advantages of WMM, ... The QoS part is right out of 802.11e. ...
      (alt.internet.wireless)
    • Re: Changing priority of threads from another application
      ... if the third-party applications are ... Unfortunately these apps are pretty greedy and are preventing the system ... I would like to change the priority of one of these apps and all its ... where myHandle is set from the structure as follows ...
      (microsoft.public.windowsce.app.development)
    • [PATCH] Document futex PI design
      ... +Unbounded Priority Inversion ... +to use a resource that a lower priority process has (a mutex for example), ... +waiter - A waiter is a struct that is stored on the stack of a blocked ... +The mutex structure contains a pointer to the owner of the mutex. ...
      (Linux-Kernel)