[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1425188128.2345.2.camel@gmail.com>
Date: Sun, 01 Mar 2015 06:35:28 +0100
From: Mike Galbraith <umgwanakikbuti@...il.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Maarten Lankhorst <maarten.lankhorst@...onical.com>
Subject: Re: [PATCH 3/3] locking: rtmutex: set state back to running on error
On Fri, 2015-02-27 at 17:57 +0100, Sebastian Andrzej Siewior wrote:
> The "usual" path is:
> - rt_mutex_slowlock()
> - set_current_state()
> - task_blocks_on_rt_mutex() (ret 0)
> - __rt_mutex_slowlock()
> - sleep or not but do return with __set_current_state(TASK_RUNNING)
> - back to caller.
>
> In the early error case where task_blocks_on_rt_mutex() return -EDEADLK
> we never change the task's state back to RUNNING. I assume this is
> intended. Without this change after ww_mutex using rt_mutex the selftest
> passes but later I get plenty of
> | bad: scheduling from the idle thread!
> backtraces.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
> kernel/locking/rtmutex.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
> index 6d7d72ffa619..c4d07f254bb4 100644
> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -1305,6 +1305,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
> }
>
> if (unlikely(ret)) {
> + set_current_state(TASK_RUNNING);
> if (rt_mutex_has_waiters(lock))
> remove_waiter(lock, &waiter);
> /* ww_mutex need the error reported */
This may want a Fixes: afffc6c1 tag, and should use the double
underscore variant methinks.
-Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists