Tej Parkash
2007-Jun-06 07:58 UTC
[Xen-devel] redundancy with timer function of balloon driver
hi
Code involved in balloon driver for scanning of xenstore has been
implemented by polling with timer and event notification function.
timer written like this:
init_timer(&balloon_timer);
balloon_timer.data = 0;
balloon_timer.function = balloon_alarm;
and other function realted to timer in balloon driver is
mod_timer(&balloon_timer, jiffies + HZ);
but there is no routine i have seen which make the timer activate by adding
add_timer(&balloon_timer) in the balloon driver
so i am assumign that balloon driver works only with event notifiction
in xenstore and the timer code in balloon driver is redundant
please correct me
thanks
TEJ
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Keir Fraser
2007-Jun-06 08:49 UTC
Re: [Xen-devel] redundancy with timer function of balloon driver
On 6/6/07 08:58, "Tej Parkash" <tejparkash.d@gmail.com> wrote:> mod_timer(&balloon_timer, jiffies + HZ); > > but there is no routine i have seen which make the timer activate by adding > > add_timer(&balloon_timer) in the balloon drivermod_timer() activates the timer if it isn''t already active. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2007-Jun-08 16:32 UTC
Re: [Xen-devel] redundancy with timer function of balloon driver
> Code involved in balloon driver for scanning of xenstore has been > implemented by polling with timer and event notification function. > > timer written like this: > > init_timer(&balloon_timer); > balloon_timer.data = 0; > balloon_timer.function = balloon_alarm; > > and other function realted to timer in balloon driver is > > mod_timer(&balloon_timer, jiffies + HZ); > > but there is no routine i have seen which make the timer activate by adding > > add_timer(&balloon_timer) in the balloon driverHi there, From the comments in linux-2.6.18/kernel/timer.c::mod_timer(): * mod_timer is a more efficient way to update the expire field of an * active timer (if the timer is inactive it will be activated) So I guess the mod_timer call is also having the effect of activating the timer without using add_timer. Does this sound right to you? Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel