Re: Considerations on sched APIs under RT patch

Thomas Gleixner
2010-04-27T13:19:13Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1030 bytes --]

On Tue, 20 Apr 2010, Primiano Tucci wrote:

> Hi Peter,
> thank you for your reply.
>
> On Tue, Apr 20, 2010 at 11:20 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, 2010-04-19 at 22:48 +0200, Primiano Tucci wrote:
> >
> >> Yesterday days I found a strange behavior of the scheduler API's using
> >> the RT patch, in particular the pthread_setaffinity_np (that stands on
> >> sched_setaffinity).
> >
> >> I think the main problem is that sched_setaffinity makes use of a
> >> rwlock, but rwlocks are pre-emptible with the RT patch.
> >
> > It does? where?
> >
> > sys_sched_setaffinity()
> >  sched_setaffinity()
> >    set_cpus_allowed_ptr()
>
>
> I see
>
> long sched_setaffinity(pid_t pid, const struct cpumask *in_mask) {
> cpumask_var_t cpus_allowed, new_mask;
> struct task_struct *p;
> int retval;
>
> get_online_cpus();
> --> read_lock(&tasklist_lock);

You must be looking at some older version of -rt. The current
2.6.33-rt series does not take tasklist_lock in sched_setaffinity().

Thanks,

tglx