Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383379

Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access in enqueue_task_dl()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access in enqueue_task_dl()
Date 2016-04-20 15:20 +0200
Message-ID <rq0cW-8rY-39@gated-at.bofh.it> (permalink)
References (2 earlier) <rnRx7-408-9@gated-at.bofh.it> <ro1d8-3iG-5@gated-at.bofh.it> <ro1wt-3Ok-1@gated-at.bofh.it> <rpZqz-7Qn-41@gated-at.bofh.it> <rq03g-8ot-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 20, 2016 at 09:00:32PM +0800, Xunlei Pang wrote:

> > But what happens? How is it changed when it is blocked?
> 
> The top waiter's policy can be changed by other tasks through sched_setattr() syscall during it was blocked.
> I created another thread doing the following thing:
>      while (1) {
>         change the waiter to cfs
>         do something
>         change the waiter to deadline
>     }

Indeed; so why didn't you say that? That is the single most important
thing in the Changelog -- the _actual_ problem, and you left it out.

I'm not quite sure how to go fix that best, but copying the state is not
right. That precludes being able to change the state.

There's two (obvious but) rather ugly solutions:

 - delay the __sched_setscheduler() call until such a time that the task
   is no longer the top waiter.

 - deboost + __sched_setscheduler() + boost

Both have a different set of problems, but both keep the p->pi_task
pointer and its state 'stable'.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 14:30 +0200
  Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Xunlei Pang <xpang@redhat.com> - 2016-04-20 15:10 +0200
    Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 15:20 +0200
      Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Xunlei Pang <xpang@redhat.com> - 2016-04-20 15:50 +0200

csiph-web