Info

struct rt_mutex {

spinlock_t wait_lock; struct plist_head wait_list; struct task_struct *owner;

The mutex owner is denoted by owner, and wait_lock provides the actual protection. All waiting processes are enqueued on wait_list. The decisive change in contrast to regular mutexes is that the tasks on the waiter lists are sorted by priority. Whenever the waiter list changes, the kernel can consequently adjust the priority of the owner up or down. This requires an interface to the scheduler that is provided by the function rt_mutex_setprio. The function updates the dynamic priority task_struct->prio, but leaves the normal priority task_struct->normal_priority untouched. If you are confused by these terms, it might be a good idea to refresh yourself with the discussion of the scheduler in Chapter 2.

Besides, the kernel provides several standard functions (rt_mutex_init, rt_mutex_lock, rt_mutex_unlock, rt_mutex_trylock) that work exactly as for regular mutexes and thus need not be discussed any further.

Continue reading here: Info

Was this article helpful?

0 0