All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] RTC: New logic to emulate RTC
@ 2012-03-05  8:25 Zhang, Yang Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Yang Z @ 2012-03-05  8:25 UTC (permalink / raw)
  To: xen-devel; +Cc: Jan Beulich

Current RTC emulation uses periodic timer(2 per second) to emulate RTC clock update. And it will stop CPU staying at deep C-state for long period even when guest is idle. Our experience shows the Pkg C6 residency reduced 6% when running 64 idle guest due to the two periodic timers. After investigation, I found the two periodic timer is used to update RTC clock, check update-ended and check alarm. The following patch achieves the same goal w/o always running the periodic timer.
For rtc clock:  the per domain variable time_offset_seconds is used to record the offset between the domain and wall clock. So we can get the domain rtc directly by calculating time_offset_seconds with wall clock.
For update-ended check: use a timer to emulate it , and the timer runs only when the last update-ended interrupt flag(UF) is cleared. If the UF already set, there is no need to set it again. 
For alarm check: also use a timer to emulate it, and the timer runs only when the flag of alarm interrupt enable bit is set. 

The logic is a little different between the update-ended check and alarm check. For update-ended check ,we use UF(update-ended flag) as the judgment and use AIE(alarm interrupt enable flag) for alarm check. This is because OS may poll the UF bit to check whether the update cycle is finished.(UF bit change from 0 to 1 means the update cycle ended). So we need to run the timer when UF bit is cleared.
--- 
Yang Zhang (5):
	RTC: use offset to caculatet rtc clock
	RTC: fix 12-hour mode
	RTC: Add UIP(update in progress) check logic
	RTC: Add RTC update-ended interrupt support
	RTC: Add alarm support

best regards
yang

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

* Re: [PATCH 0/5] RTC: New logic to emulate RTC
  2012-03-08  1:13 Zhang, Yang Z
@ 2012-03-08  1:39 ` Zhang, Yang Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Yang Z @ 2012-03-08  1:39 UTC (permalink / raw)
  To: xen-devel; +Cc: 'Keir Fraser (keir.xen@gmail.com)'

Umm....we use internal mirror and the service is broken for two days. So I cannot pull the latest update and thought those patches are not in. 
I just got the message that our server is broken, then check it in xen.org and found those patches already are applied.
Also the typo is corrected by keir. Thanks.
Sorry for the redundant mais.

best regards
yang

> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org
> [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of Zhang, Yang Z
> Sent: Thursday, March 08, 2012 9:14 AM
> To: xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH 0/5] RTC: New logic to emulate RTC
> 
> Sorry, due to the bad outlook auto format. The patch format is wrong.:(
> Will resend it under linux.
> 
> best regards
> yang
> 
> 
> > -----Original Message-----
> > From: Zhang, Yang Z
> > Sent: Thursday, March 08, 2012 8:42 AM
> > To: xen-devel@lists.xensource.com
> > Subject: [PATCH 0/5] RTC: New logic to emulate RTC
> >
> > RESEND:
> > Correct a typo in comments.
> >
> > Current RTC emulation uses periodic timer(2 per second) to emulate RTC clock
> > update. And it will stop CPU staying at deep C-state for long period even when
> > guest is idle. Our experience shows the Pkg C6 residency reduced 6% when
> > running 64 idle guest due to the two periodic timers. After investigation, I
> found
> > the two periodic timer is used to update RTC clock, check update-ended and
> > check alarm. The following patch achieves the same goal w/o always running
> the
> > periodic timer.
> > For rtc clock:  the per domain variable time_offset_seconds is used to record
> > the offset between the domain and wall clock. So we can get the domain rtc
> > directly by calculating time_offset_seconds with wall clock.
> > For update-ended check: use a timer to emulate it , and the timer runs only
> > when the last update-ended interrupt flag(UF) is cleared. If the UF already set,
> > there is no need to set it again.
> > For alarm check: also use a timer to emulate it, and the timer runs only when
> the
> > flag of alarm interrupt enable bit is set.
> >
> > The logic is a little different between the update-ended check and alarm check.
> > For update-ended check ,we use UF(update-ended flag) as the judgment and
> > use AIE(alarm interrupt enable flag) for alarm check. This is because OS may poll
> > the UF bit to check whether the update cycle is finished.(UF bit change from 0
> to
> > 1 means the update cycle ended). So we need to run the timer when UF bit is
> > cleared.
> > ---
> > Yang Zhang (5):
> > 	RTC: use offset to caculatet rtc clock
> > 	RTC: fix 12-hour mode
> > 	RTC: Add UIP(update in progress) check logic
> > 	RTC: Add RTC update-ended interrupt support
> > 	RTC: Add alarm support
> >
> > best regards
> > yang
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH 0/5] RTC: New logic to emulate RTC
@ 2012-03-08  1:13 Zhang, Yang Z
  2012-03-08  1:39 ` Zhang, Yang Z
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Yang Z @ 2012-03-08  1:13 UTC (permalink / raw)
  To: xen-devel

Sorry, due to the bad outlook auto format. The patch format is wrong.:(
Will resend it under linux.

best regards
yang


> -----Original Message-----
> From: Zhang, Yang Z
> Sent: Thursday, March 08, 2012 8:42 AM
> To: xen-devel@lists.xensource.com
> Subject: [PATCH 0/5] RTC: New logic to emulate RTC
> 
> RESEND:
> Correct a typo in comments.
> 
> Current RTC emulation uses periodic timer(2 per second) to emulate RTC clock
> update. And it will stop CPU staying at deep C-state for long period even when
> guest is idle. Our experience shows the Pkg C6 residency reduced 6% when
> running 64 idle guest due to the two periodic timers. After investigation, I found
> the two periodic timer is used to update RTC clock, check update-ended and
> check alarm. The following patch achieves the same goal w/o always running the
> periodic timer.
> For rtc clock:  the per domain variable time_offset_seconds is used to record
> the offset between the domain and wall clock. So we can get the domain rtc
> directly by calculating time_offset_seconds with wall clock.
> For update-ended check: use a timer to emulate it , and the timer runs only
> when the last update-ended interrupt flag(UF) is cleared. If the UF already set,
> there is no need to set it again.
> For alarm check: also use a timer to emulate it, and the timer runs only when the
> flag of alarm interrupt enable bit is set.
> 
> The logic is a little different between the update-ended check and alarm check.
> For update-ended check ,we use UF(update-ended flag) as the judgment and
> use AIE(alarm interrupt enable flag) for alarm check. This is because OS may poll
> the UF bit to check whether the update cycle is finished.(UF bit change from 0 to
> 1 means the update cycle ended). So we need to run the timer when UF bit is
> cleared.
> ---
> Yang Zhang (5):
> 	RTC: use offset to caculatet rtc clock
> 	RTC: fix 12-hour mode
> 	RTC: Add UIP(update in progress) check logic
> 	RTC: Add RTC update-ended interrupt support
> 	RTC: Add alarm support
> 
> best regards
> yang

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

* [PATCH 0/5] RTC: New logic to emulate RTC
@ 2012-03-08  0:42 Zhang, Yang Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Yang Z @ 2012-03-08  0:42 UTC (permalink / raw)
  To: xen-devel

RESEND:
Correct a typo in comments.

Current RTC emulation uses periodic timer(2 per second) to emulate RTC clock update. And it will stop CPU staying at deep C-state for long period even when guest is idle. Our experience shows the Pkg C6 residency reduced 6% when running 64 idle guest due to the two periodic timers. After investigation, I found the two periodic timer is used to update RTC clock, check update-ended and check alarm. The following patch achieves the same goal w/o always running the periodic timer.
For rtc clock:  the per domain variable time_offset_seconds is used to record the offset between the domain and wall clock. So we can get the domain rtc directly by calculating time_offset_seconds with wall clock.
For update-ended check: use a timer to emulate it , and the timer runs only when the last update-ended interrupt flag(UF) is cleared. If the UF already set, there is no need to set it again. 
For alarm check: also use a timer to emulate it, and the timer runs only when the flag of alarm interrupt enable bit is set. 

The logic is a little different between the update-ended check and alarm check. For update-ended check ,we use UF(update-ended flag) as the judgment and use AIE(alarm interrupt enable flag) for alarm check. This is because OS may poll the UF bit to check whether the update cycle is finished.(UF bit change from 0 to 1 means the update cycle ended). So we need to run the timer when UF bit is cleared.
--- 
Yang Zhang (5):
	RTC: use offset to caculatet rtc clock
	RTC: fix 12-hour mode
	RTC: Add UIP(update in progress) check logic
	RTC: Add RTC update-ended interrupt support
	RTC: Add alarm support

best regards
yang

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

end of thread, other threads:[~2012-03-08  1:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05  8:25 [PATCH 0/5] RTC: New logic to emulate RTC Zhang, Yang Z
2012-03-08  0:42 Zhang, Yang Z
2012-03-08  1:13 Zhang, Yang Z
2012-03-08  1:39 ` Zhang, Yang Z

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.