[LITMUS^RT] Questions about Litmus
Shuai Zhao
zs673 at york.ac.uk
Tue Dec 8 16:02:48 CET 2015
Hi
I am new to Litmus and I am now trying to implement the MrsP under P-FP.
Currently I have two questions:
1. I've been reading your litmus report (a very long one) and notice you
said
" In our experience, handling suspending and resuming processes is a common
source of errors. A process may suspend and be resumed again almost
immediately thereafter before a context switch can occur (e.g., this is the
case for many page faults, and especially those due to copy-on-write
semantics). In the past, novice developers have commonly disregarded the
possibility of such “quickly resuming” processes, which may result in ready
processes failing to be enqueued in a ready queue (in which case they are
never scheduled again and become “stuck”) or in being wrongly enqueued
twice (which crashes the kernel eventually). Besides migration support (see
Section 3.3.4 below), races related to short suspensions have in our
experience been the most common cause of crashes in LITMUSRT. "
And this is exactly the problem that I am now experiencing.
I tired to implement the MrsP protocol under the P-FP scheduler and
developed a test program in user space to test. However, The program
sometimes stuck because the lock holder is blocked but not rescheduled
(mostly when trying to print by printf).
I wonder, how to prevent such races from happening? Will printf be
problematic in used in Litmus real-time thread with a very short period
(say 1ms).
2. MrsP defines that if a lock holder is preempted, It can migrate to any
processors that has a waiting (spinning) task on it. Yet as I am trying to
implement MrsP under P-FP, there is no support for choosing the most most
suitable cpu among all the cpus the preempted task can migrate to. I wonder
do you have any suggestions for building a mini migration routine for F-PF
or could I use any facilities to achieve this from either Linux or Litmus?
I also notice that the sched_setaffinity is disabled by litmus as it could
introduce unbounded priority inversion. However, I wonder how can I use
this function again in Litmus RT tasks if I do not care the drawback it
carries.
Thank you in advance.
Best wishes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20151208/d5fcd9d1/attachment.html>
More information about the litmus-dev
mailing list