Re: POSIX Message Queue Priority Scheduling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> Yeah - I was looking at that code and was having a hard time
> following
> it.  It appears to me that if the queue is full, it goes into this
> wq_sleep(), but then never comes back to post - however it has to
> come
> back at some point when it wakes.  The wq_sleep() function calls
> wq_add
> which appears to add in priority order, however it uses static_prio
> of
> the task_struct.
> Looking at task_struct, there are four priorities defined --
> 	int prio, static_prio, normal_prio;
> 	unsigned int rt_priority;
> What I'd like to know is the details of what each of those mean.  It
> seems that if the static_prio of each thread is the same, even if the
> rt_priority is different, they would wake in FIFO order (since all
> static_prios are equal).  Some searching doesn't quite answer the
> question fully.  Does the message queue implementation ignore the
> fact
> that some threads are RT threads?  It sure seems to...

Did a lot more digging and found the following, which I'll post here
for reference.

prio - holds the actual priority in use (after priority boosting/RT
considerations/etc.) of the process or thread

static_prio - holds the static priority (based on niceness) of the
process or thread

normal_prio - holds the dynamic priority of the process or thread.  In
the testing I did this always equaled prio, but this isn't necessarily
always the case

rt_priority - holds the user-specified RT priority of the thread and
plays into the prio value if using a RT scheduler (such as SCHED_FIFO

I made a simple change to the ipc/mqueue.c:wq_add() routine.  I changed
static_prio to prio in the if statement comparing priorities.  This was
all it took.

I'm working on getting that change into mainline, but hopefully this
thread on this list will be of help to someone else.

Thanks all!��.n��������+%������w��{.n�����{��w��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f

[Index of Archives]     [Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux ARM Kernel]     [Linux OMAP]     [Linux SCSI]

  Powered by Linux