Re: Can current macro be accessed from interrupt context?

From: Leonidas .
Date: Fri Oct 23 2009 - 05:34:20 EST


> There is no fixed association between your tasks and the CPUs they are
> running on.  It is possible for two of your threads to be executed on
> the same CPU (one after the other), or for one thread to migrate between
> CPUs.

Yes, you are right. I had not thought about thread migration etc and was
painting a rather simple picture of things.

>
> The task that was interrupted is probably some entirely different task
> (the X server, the shell, your mail reader, some kernel thread, or
> any of the other tasks running on your system).
>
> It is possible for your interrupt handler to be called for some device
> request that belongs to one of your tasks that is currently running on
> another CPU, so you won't be able to manage that data without locking.
>

Yes, this is pretty much points towards using per-cpu data.
Seems like my thought experiment will lead to an early demise.

Thanks for the explanation.


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