Re: [(RT RFC) PATCH v2 1/9] allow rt-mutex lock-stealing to include lateral priority

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Monday, March 3, 2008 - 8:13 am

/me finally has time to catch up on some email.

On Mon, 25 Feb 2008, Gregory Haskins wrote:


Interesting. I thought about this when I first implemented it. My thought
was on fairness, and having some worry about starvation. But if you have
two processes of the same RT priority, then you must account for it.

But..., this can cause confusion with having two tasks of the same RT
priority bound to two different CPUS.

  CPU0                            CPU1
 -----                         ---------
RT task blocks on L1
Owner releases L1
RT task pending owner of L1
                               Same prio RT task grabs L1
                               (steals from other RT task)
RT task wakes up to find
  L1 stolen and goes
  back to sleep.
                               Releases L1 giving
RT task becomes pending owner
                               Grabs L1 again and steals it again.
RT wakes up to find
  L1 stolen and goes back
  to sleep.


See the issue. The RT task on CPU0 may experience huge latencies.
Remember, RT is worried about latencies over performance.
If we can not ***guarantee*** a bounded latency, then, I don't care
how good the perfomance is, it is not good enough for RT.


That said, here's the compromise.

Non-RT tasks care more about overall perfomance than worst case latencies.
So.... See imbedded:



We either do this or we don't. No config option.


This instead:


	if (rt_task(current) ?
		(current->prio >= pendingowner->prio) :
		(current->prio > pendingowner->prio))


For RT tasks we keep the FIFO order. This keeps it deterministic.
But for non RT tasks, that still can steal locks, we just simply let them
steal if at a higher priority.

And just use that as the condition. No need to add another inline
function (doesn't make it any more readable).

Actually, this is the only change I see in this patch that is needed.
The rest is simply passing parameters and adding extra unneeded options.

-- Steve




--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[(RT RFC) PATCH v2 0/9] adaptive real-time locks, Gregory Haskins, (Mon Feb 25, 9:00 am)
[(RT RFC) PATCH v2 3/9] rearrange rt_spin_lock sleep, Gregory Haskins, (Mon Feb 25, 9:00 am)
[(RT RFC) PATCH v2 4/9] optimize rt lock wakeup, Gregory Haskins, (Mon Feb 25, 9:00 am)
[(RT RFC) PATCH v2 5/9] adaptive real-time lock support, Gregory Haskins, (Mon Feb 25, 9:01 am)
[(RT RFC) PATCH v2 7/9] adaptive mutexes, Gregory Haskins, (Mon Feb 25, 9:01 am)
[(RT RFC) PATCH v2 8/9] adjust pi_lock usage in wakeup, Gregory Haskins, (Mon Feb 25, 9:01 am)
Re: [(RT RFC) PATCH v2 7/9] adaptive mutexes, Pavel Machek, (Mon Feb 25, 3:09 pm)
Re: [(RT RFC) PATCH v2 6/9] add a loop counter based timeo ..., Sven-Thorsten Dietrich, (Mon Feb 25, 3:39 pm)
Re: [(RT RFC) PATCH v2 2/9] sysctl for runtime-control of ..., Sven-Thorsten Dietrich, (Mon Feb 25, 3:57 pm)
Re: [(RT RFC) PATCH v2 2/9] sysctl for runtime-control of ..., Sven-Thorsten Dietrich, (Mon Feb 25, 4:40 pm)
Re: [(RT RFC) PATCH v2 3/9] rearrange rt_spin_lock sleep, Gregory Haskins, (Mon Feb 25, 5:45 pm)
Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support, Gregory Haskins, (Mon Feb 25, 5:48 pm)
Re: [(RT RFC) PATCH v2 7/9] adaptive mutexes, Gregory Haskins, (Mon Feb 25, 5:52 pm)
Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support, Gregory Haskins, (Tue Feb 26, 8:03 am)
Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support, Gregory Haskins, (Tue Feb 26, 11:01 am)
Re: [(RT RFC) PATCH v2 1/9] allow rt-mutex lock-stealing t ..., Steven Rostedt, (Mon Mar 3, 8:13 am)
Re: [(RT RFC) PATCH v2 4/9] optimize rt lock wakeup, Steven Rostedt, (Mon Mar 3, 8:37 am)
Re: [(RT RFC) PATCH v2 4/9] optimize rt lock wakeup, Gregory Haskins, (Mon Mar 3, 8:41 am)