* [patch] BFS 421: remove global runqueue lock in running tick
@ 2012-06-08 13:37 Hillf Danton
2012-06-08 13:45 ` Chen
0 siblings, 1 reply; 3+ messages in thread
From: Hillf Danton @ 2012-06-08 13:37 UTC (permalink / raw)
To: LKML, Hillf Danton
We simply deschedule current, with no bother grabbing global lock, since IPI,
if triggered by preempt, could not change our result, like no schedule when
preempt enabled.
preempt_enable_no_resched();
if (unlikely(need_resched()))
goto need_resched;
--- a/kernel/sched/bfs.c Wed Jun 6 21:02:50 2012
+++ b/kernel/sched/bfs.c Fri Jun 8 21:17:24 2012
@@ -2784,11 +2784,13 @@ static void task_running_tick(struct rq
} else if (rq->rq_time_slice >= RESCHED_US)
return;
- /* p->time_slice < RESCHED_US. We only modify task_struct under grq lock */
+ /*
+ * With irq disabled, current is descheduled without global lock
+ * held and IPI cared.
+ */
p = rq->curr;
- grq_lock();
- set_tsk_need_resched(p);
- grq_unlock();
+ if (!test_tsk_need_resched(p))
+ set_tsk_need_resched(p);
}
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] BFS 421: remove global runqueue lock in running tick
2012-06-08 13:37 [patch] BFS 421: remove global runqueue lock in running tick Hillf Danton
@ 2012-06-08 13:45 ` Chen
2012-06-08 16:47 ` Heinz Diehl
0 siblings, 1 reply; 3+ messages in thread
From: Chen @ 2012-06-08 13:45 UTC (permalink / raw)
Cc: linux-kernel
Still, you haven't produced any usable patch. LOL
On Fri, Jun 8, 2012 at 9:37 PM, Hillf Danton <dhillf@gmail.com> wrote:
> We simply deschedule current, with no bother grabbing global lock, since IPI,
> if triggered by preempt, could not change our result, like no schedule when
> preempt enabled.
>
> preempt_enable_no_resched();
> if (unlikely(need_resched()))
> goto need_resched;
>
>
> --- a/kernel/sched/bfs.c Wed Jun 6 21:02:50 2012
> +++ b/kernel/sched/bfs.c Fri Jun 8 21:17:24 2012
> @@ -2784,11 +2784,13 @@ static void task_running_tick(struct rq
> } else if (rq->rq_time_slice >= RESCHED_US)
> return;
>
> - /* p->time_slice < RESCHED_US. We only modify task_struct under grq lock */
> + /*
> + * With irq disabled, current is descheduled without global lock
> + * held and IPI cared.
> + */
> p = rq->curr;
> - grq_lock();
> - set_tsk_need_resched(p);
> - grq_unlock();
> + if (!test_tsk_need_resched(p))
> + set_tsk_need_resched(p);
> }
>
>
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] BFS 421: remove global runqueue lock in running tick
2012-06-08 13:45 ` Chen
@ 2012-06-08 16:47 ` Heinz Diehl
0 siblings, 0 replies; 3+ messages in thread
From: Heinz Diehl @ 2012-06-08 16:47 UTC (permalink / raw)
To: linux-kernel
On 08.06.2012, Chen wrote:
> Still, you haven't produced any usable patch. LOL
...and Con Kolivas released BFS 4.22 some days ago..
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-08 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 13:37 [patch] BFS 421: remove global runqueue lock in running tick Hillf Danton
2012-06-08 13:45 ` Chen
2012-06-08 16:47 ` Heinz Diehl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox