All of lore.kernel.org
 help / color / mirror / Atom feed
* For smp, is it possible that a timer can be run at the same time on different cpus?
@ 2012-07-10  2:02 rednoah
  2012-07-10  5:10 ` Mulyadi Santosa
  0 siblings, 1 reply; 2+ messages in thread
From: rednoah @ 2012-07-10  2:02 UTC (permalink / raw)
  To: kernelnewbies

Hi all:
  The kernel I use is 2.6.29-rc3 and among the timer_list function there is
"add_timer_on".
For smp, Is it possible for a timer to be run at the same time on different
cpus? suppose the
following sequence:
1. a timer is being run on CPU 0, and the timer callback function use
add_time_on to add itself on CPU 1;
  the expires is set to "jiffies + 0" to make it to be run as quickly as
possible on CPU 1.
2. so there is chance that 2 cpus run the same timer at the same time?

I'm not sure whether the above can be true. Whether there is other way to
make a time run at the same time
on different cpu?  If it can happen, the timer callback function must take
smp safe into consideration.

Regards
Rednoah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120710/0e05e9f8/attachment.html 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* For smp, is it possible that a timer can be run at the same time on different cpus?
  2012-07-10  2:02 For smp, is it possible that a timer can be run at the same time on different cpus? rednoah
@ 2012-07-10  5:10 ` Mulyadi Santosa
  0 siblings, 0 replies; 2+ messages in thread
From: Mulyadi Santosa @ 2012-07-10  5:10 UTC (permalink / raw)
  To: kernelnewbies

Hi.... :)

On Tue, Jul 10, 2012 at 9:02 AM, rednoah <rednoax@gmail.com> wrote:
> Hi all:
>   The kernel I use is 2.6.29-rc3 and among the timer_list function there is
> "add_timer_on".
> For smp, Is it possible for a timer to be run at the same time on different
> cpus? suppose the
> following sequence:
> 1. a timer is being run on CPU 0, and the timer callback function use
> add_time_on to add itself on CPU 1;
>   the expires is set to "jiffies + 0" to make it to be run as quickly as
> possible on CPU 1.
> 2. so there is chance that 2 cpus run the same timer at the same time?

Interesting issue :)

IMHO, even though you ask for "jiffies+" a.k.a current time,
scheduling delay will make it run in the very very near future. This
is plus the fact that I know that timer is running everytime time
interrupt is receieved... so IMHO that very near future is actually
jiffies+1 (current time + (1/HZ))

I might be wrong here though :)


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-10  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10  2:02 For smp, is it possible that a timer can be run at the same time on different cpus? rednoah
2012-07-10  5:10 ` Mulyadi Santosa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.