xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen:rtds: Update last_start whenever cur_budget is updated
@ 2016-10-26 19:06 Meng Xu
  2016-10-27  9:14 ` Dario Faggioli
  0 siblings, 1 reply; 6+ messages in thread
From: Meng Xu @ 2016-10-26 19:06 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Dagaen Golomb, George Dunlap, Haoran Li, Dario Faggioli,
	Linh Thi Xuan Phan, Meng Xu, Meng Xu, Tianyang Chen

We keep last_start updated whenever cur_budget is updated.
This avoids subtle bugs in case burn_budget() will be called
in other places in the future.

Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
---
Cc: Dario Faggioli <dario.faggioli@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Linh Thi Xuan Phan <linhphan@cis.upenn.edu>
Cc: Haoran Li <lihaoran@wustl.edu>
Cc: Meng Xu <xumengpanda@gmail.com>
Cc: Dagaen Golomb <dgolomb@cis.upenn.edu>
Cc: Tianyang Chen <tiche@cis.upenn.edu>
---
 xen/common/sched_rt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4b4f232..434b773 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -953,6 +953,7 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now)
     }
 
     svc->cur_budget -= delta;
+    svc->last_start = now;
 
     if ( svc->cur_budget <= 0 )
     {
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen:rtds: Update last_start whenever cur_budget is updated
  2016-10-26 19:06 [PATCH] xen:rtds: Update last_start whenever cur_budget is updated Meng Xu
@ 2016-10-27  9:14 ` Dario Faggioli
  2016-10-27 10:03   ` Wei Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Dario Faggioli @ 2016-10-27  9:14 UTC (permalink / raw)
  To: Meng Xu, xen-devel
  Cc: Wei Liu, Dagaen Golomb, George Dunlap, Haoran Li,
	Linh Thi Xuan Phan, Meng Xu, Tianyang Chen


[-- Attachment #1.1: Type: text/plain, Size: 1146 bytes --]

On Wed, 2016-10-26 at 15:06 -0400, Meng Xu wrote:
> We keep last_start updated whenever cur_budget is updated.
> This avoids subtle bugs in case burn_budget() will be called
> in other places in the future.
> 
I'd change this into something like:

"Make budget accounting code more consistent by making sure the values
used to compute how much budget has been consumed are updated together.

This makes code resilient to calling burn_budget() from more than just
one place --in case we will need to do that-- without risking subtle
bugs."

Also, when that is the case, like here, you need to explicitly state
that no functional changes are intended.

With all this done to the changelog:

> Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>

This can go in 4.8, but can also well wait for 4.9.

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen:rtds: Update last_start whenever cur_budget is updated
  2016-10-27  9:14 ` Dario Faggioli
@ 2016-10-27 10:03   ` Wei Liu
  2016-10-27 13:40     ` Meng Xu
  2016-10-27 13:42     ` Meng Xu
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Liu @ 2016-10-27 10:03 UTC (permalink / raw)
  To: Dario Faggioli
  Cc: Wei Liu, Dagaen Golomb, George Dunlap, Haoran Li,
	Linh Thi Xuan Phan, Meng Xu, Meng Xu, xen-devel, Tianyang Chen

On Thu, Oct 27, 2016 at 11:14:36AM +0200, Dario Faggioli wrote:
> On Wed, 2016-10-26 at 15:06 -0400, Meng Xu wrote:
> > We keep last_start updated whenever cur_budget is updated.
> > This avoids subtle bugs in case burn_budget() will be called
> > in other places in the future.
> > 
> I'd change this into something like:
> 
> "Make budget accounting code more consistent by making sure the values
> used to compute how much budget has been consumed are updated together.
> 
> This makes code resilient to calling burn_budget() from more than just
> one place --in case we will need to do that-- without risking subtle
> bugs."
> 
> Also, when that is the case, like here, you need to explicitly state
> that no functional changes are intended.
> 
> With all this done to the changelog:
> 
> > Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
> >
> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
> 
> This can go in 4.8, but can also well wait for 4.9.
> 

Meng, let me know if you're OK with Dario's suggestion.

Wei.

> Regards,
> Dario
> -- 
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen:rtds: Update last_start whenever cur_budget is updated
  2016-10-27 10:03   ` Wei Liu
@ 2016-10-27 13:40     ` Meng Xu
  2016-10-27 13:42     ` Meng Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Meng Xu @ 2016-10-27 13:40 UTC (permalink / raw)
  To: Wei Liu
  Cc: Dagaen Golomb, George Dunlap, Haoran Li, Dario Faggioli,
	Linh Thi Xuan Phan, xen-devel, Tianyang Chen

Hi Wei and Dario,


On Thu, Oct 27, 2016 at 6:03 AM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Thu, Oct 27, 2016 at 11:14:36AM +0200, Dario Faggioli wrote:
>> On Wed, 2016-10-26 at 15:06 -0400, Meng Xu wrote:
>> > We keep last_start updated whenever cur_budget is updated.
>> > This avoids subtle bugs in case burn_budget() will be called
>> > in other places in the future.
>> >
>> I'd change this into something like:
>>
>> "Make budget accounting code more consistent by making sure the values
>> used to compute how much budget has been consumed are updated together.
>>
>> This makes code resilient to calling burn_budget() from more than just
>> one place --in case we will need to do that-- without risking subtle
>> bugs."

I agree.


>>
>> Also, when that is the case, like here, you need to explicitly state
>> that no functional changes are intended.


>>
>> With all this done to the changelog:
>>
>> > Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
>> >
>> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
>>
>> This can go in 4.8, but can also well wait for 4.9.
>>
>
> Meng, let me know if you're OK with Dario's suggestion.
>
> Wei.
>
>> Regards,
>> Dario
>> --
>> <<This happens because I choose it to happen!>> (Raistlin Majere)
>> -----------------------------------------------------------------
>> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
>> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
>
>



-- 
-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen:rtds: Update last_start whenever cur_budget is updated
  2016-10-27 10:03   ` Wei Liu
  2016-10-27 13:40     ` Meng Xu
@ 2016-10-27 13:42     ` Meng Xu
  2016-10-27 13:43       ` Wei Liu
  1 sibling, 1 reply; 6+ messages in thread
From: Meng Xu @ 2016-10-27 13:42 UTC (permalink / raw)
  To: Wei Liu
  Cc: Dagaen Golomb, George Dunlap, Haoran Li, Dario Faggioli,
	Linh Thi Xuan Phan, xen-devel, Tianyang Chen

Sorry, I accidentally sent out the previous email...

On Thu, Oct 27, 2016 at 6:03 AM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Thu, Oct 27, 2016 at 11:14:36AM +0200, Dario Faggioli wrote:
>> On Wed, 2016-10-26 at 15:06 -0400, Meng Xu wrote:
>> > We keep last_start updated whenever cur_budget is updated.
>> > This avoids subtle bugs in case burn_budget() will be called
>> > in other places in the future.
>> >
>> I'd change this into something like:
>>
>> "Make budget accounting code more consistent by making sure the values
>> used to compute how much budget has been consumed are updated together.
>>
>> This makes code resilient to calling burn_budget() from more than just
>> one place --in case we will need to do that-- without risking subtle
>> bugs."
>>

Agree.

>> Also, when that is the case, like here, you need to explicitly state
>> that no functional changes are intended.

As Dario suggested, it's better to add one more line in the change log
"No functional changes are intended."

>>
>> With all this done to the changelog:
>>
>> > Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
>> >
>> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
>>
>> This can go in 4.8, but can also well wait for 4.9.

Agree..

>>
>
> Meng, let me know if you're OK with Dario's suggestion.

I'm OK with his suggestion.
I can send out a new patch with the new commit change log, if needed.

Thanks,

Meng

-- 
------------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen:rtds: Update last_start whenever cur_budget is updated
  2016-10-27 13:42     ` Meng Xu
@ 2016-10-27 13:43       ` Wei Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2016-10-27 13:43 UTC (permalink / raw)
  To: Meng Xu
  Cc: Wei Liu, Dagaen Golomb, George Dunlap, Haoran Li, Dario Faggioli,
	Linh Thi Xuan Phan, xen-devel, Tianyang Chen

On Thu, Oct 27, 2016 at 09:42:56AM -0400, Meng Xu wrote:
> Sorry, I accidentally sent out the previous email...
> 
> On Thu, Oct 27, 2016 at 6:03 AM, Wei Liu <wei.liu2@citrix.com> wrote:
> > On Thu, Oct 27, 2016 at 11:14:36AM +0200, Dario Faggioli wrote:
> >> On Wed, 2016-10-26 at 15:06 -0400, Meng Xu wrote:
> >> > We keep last_start updated whenever cur_budget is updated.
> >> > This avoids subtle bugs in case burn_budget() will be called
> >> > in other places in the future.
> >> >
> >> I'd change this into something like:
> >>
> >> "Make budget accounting code more consistent by making sure the values
> >> used to compute how much budget has been consumed are updated together.
> >>
> >> This makes code resilient to calling burn_budget() from more than just
> >> one place --in case we will need to do that-- without risking subtle
> >> bugs."
> >>
> 
> Agree.
> 
> >> Also, when that is the case, like here, you need to explicitly state
> >> that no functional changes are intended.
> 
> As Dario suggested, it's better to add one more line in the change log
> "No functional changes are intended."
> 
> >>
> >> With all this done to the changelog:
> >>
> >> > Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
> >> >
> >> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
> >>
> >> This can go in 4.8, but can also well wait for 4.9.
> 
> Agree..
> 
> >>
> >
> > Meng, let me know if you're OK with Dario's suggestion.
> 
> I'm OK with his suggestion.
> I can send out a new patch with the new commit change log, if needed.
> 

No need. I will fix it up.

Wei.

> Thanks,
> 
> Meng
> 
> -- 
> ------------
> Meng Xu
> PhD Student in Computer and Information Science
> University of Pennsylvania
> http://www.cis.upenn.edu/~mengxu/

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-10-27 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26 19:06 [PATCH] xen:rtds: Update last_start whenever cur_budget is updated Meng Xu
2016-10-27  9:14 ` Dario Faggioli
2016-10-27 10:03   ` Wei Liu
2016-10-27 13:40     ` Meng Xu
2016-10-27 13:42     ` Meng Xu
2016-10-27 13:43       ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).