lkml.org 
[lkml]   [2000]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: tasklet race condition
Date
Hello!

> task may be marked TASKLET_STATE_SCHED but disappear from the tasklet
> queue before ever being launched.

Task is marked as SCHEDuled and it is not on this list when
it is already scheduled on another CPU.


> know too much about the locking mechanisms so I'm not likely to get there
> very fast. Does anyone have any comments on this?

It is very simple machine: SCHED flag means that tasklet is scheduled
or about to be scheduled on some CPU. If it is set, the tasklet
is already scheduled and will run soon on some cpu.

If you want to test it, check not only this list but all the lists
for all the CPUs. [It is dangerous! You have to add new spinlock
to make this]

Valid test is to count number of times, when you see change
in sched flag and number of times, which tasklet runs. They
must coincide.


> tasklet never runs, and the other time it only runs once or twice.

Exactly. Doing for (i=0;i<12;i++) mark_bh(xx) you will have
BH running once, rather than 12 times. Tasklets are not different
in this sense, they batch events.



Seems, the confusion is sourced by the fact, that earlier BHs
were pushed by IRQ not depending on CPU. Now IRQs push only tasklets
queued on the _same_ CPU, where IRQ arrived. It results to more
aggressive compression.

Alexey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.658 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site