All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] xen: sched: removal of redundant check in Credit
@ 2016-12-16 19:23 Praveen Kumar
  2016-12-17  1:46 ` Dario Faggioli
  0 siblings, 1 reply; 7+ messages in thread
From: Praveen Kumar @ 2016-12-16 19:23 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, dario.faggioli, Praveen Kumar

The patch gets rid of a redundant check in csched_vcpu_acct. In fact,
the function is only called from csched_tick, which already checks
that current is not the idle vcpu. The patch also adds an ASSERT to
the same effect, in order to make assumption ( i.e., no calling this
on idle vcpus) even more clear and as a guard for future mis-use.

Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_credit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index fc3a321..dfe8545 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -941,6 +941,7 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu)

     ASSERT( current->processor == cpu );
     ASSERT( svc->sdom != NULL );
+    ASSERT( !is_idle_vcpu(svc->vcpu) );

     /*
      * If this VCPU's priority was boosted when it last awoke, reset it.
@@ -957,8 +958,7 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu)
     /*
      * Update credits
      */
-    if ( !is_idle_vcpu(svc->vcpu) )
-        burn_credits(svc, NOW());
+    burn_credits(svc, NOW());

     /*
      * Put this VCPU and domain back on the active list if it was
--
1.8.5.6


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

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

* Re: [PATCH v3] xen: sched: removal of redundant check in Credit
  2016-12-16 19:23 [PATCH v3] xen: sched: removal of redundant check in Credit Praveen Kumar
@ 2016-12-17  1:46 ` Dario Faggioli
  2016-12-17  8:14   ` Praveen Kumar
  2016-12-28  9:02   ` George Dunlap
  0 siblings, 2 replies; 7+ messages in thread
From: Dario Faggioli @ 2016-12-17  1:46 UTC (permalink / raw)
  To: Praveen Kumar, xen-devel; +Cc: george.dunlap


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

On Sat, 2016-12-17 at 00:53 +0530, Praveen Kumar wrote:
> The patch gets rid of a redundant check in csched_vcpu_acct. In fact,
> the function is only called from csched_tick, which already checks
> that current is not the idle vcpu. The patch also adds an ASSERT to
> the same effect, in order to make assumption ( i.e., no calling this
> on idle vcpus) even more clear and as a guard for future mis-use.
> 
> Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
>
Better than before. But still, if I:
 - save this mail as mbox
 - try to import it in git
it fails.

OTOH, if I:
 - save this mail as mbox
 - run dos2unix on the mbox file
 - try to import it in git
it works!

Which, since you're now using git-send-email, makes me think it may be
your editor/OS which is at fault and inserts spurious stuff at line
breaks (the classic CR vs. CR+LF thing).

What editor on what OS are you using?

Another possibility is that there is something wrong here at my hand.
George, do you have (similar) issues when trying to apply this patch?

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] 7+ messages in thread

* Re: [PATCH v3] xen: sched: removal of redundant check in Credit
  2016-12-17  1:46 ` Dario Faggioli
@ 2016-12-17  8:14   ` Praveen Kumar
  2016-12-20  9:04     ` Praveen Kumar
  2016-12-28  9:02   ` George Dunlap
  1 sibling, 1 reply; 7+ messages in thread
From: Praveen Kumar @ 2016-12-17  8:14 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: George Dunlap, xen-devel


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

Hi,

On Sat, Dec 17, 2016 at 7:16 AM, Dario Faggioli <dario.faggioli@citrix.com>
wrote:

> On Sat, 2016-12-17 at 00:53 +0530, Praveen Kumar wrote:
> > The patch gets rid of a redundant check in csched_vcpu_acct. In fact,
> > the function is only called from csched_tick, which already checks
> > that current is not the idle vcpu. The patch also adds an ASSERT to
> > the same effect, in order to make assumption ( i.e., no calling this
> > on idle vcpus) even more clear and as a guard for future mis-use.
> >
> > Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
> > Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
> >
> Better than before. But still, if I:
>  - save this mail as mbox
>  - try to import it in git
> it fails.
>
> OTOH, if I:
>  - save this mail as mbox
>  - run dos2unix on the mbox file
>  - try to import it in git
> it works!
>
> Which, since you're now using git-send-email, makes me think it may be
> your editor/OS which is at fault and inserts spurious stuff at line
> breaks (the classic CR vs. CR+LF thing).
>
> What editor on what OS are you using?
>

I am using SLED machine and vim editor. I tried checking with vimdiff over
the patch generated and mbox file ( create by evolution ), I found spurious
stuff (^M) as mentioned added. After dos2unix, the mbox file was same to
that of the patch sent.

>
> Another possibility is that there is something wrong here at my hand.
> George, do you have (similar) issues when trying to apply this patch?
>
> 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: Type: text/html, Size: 2647 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] 7+ messages in thread

* Re: [PATCH v3] xen: sched: removal of redundant check in Credit
  2016-12-17  8:14   ` Praveen Kumar
@ 2016-12-20  9:04     ` Praveen Kumar
  2016-12-20 13:18       ` Dario Faggioli
  0 siblings, 1 reply; 7+ messages in thread
From: Praveen Kumar @ 2016-12-20  9:04 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: George Dunlap, xen-devel


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

Hi Dario,

I tried with 'git am' to apply the patch after downloading the mbox file,
that worked fine. Do let me know if that is ok.

Regards,

~Praveen.

On Sat, Dec 17, 2016 at 1:44 PM, Praveen Kumar <kpraveen.lkml@gmail.com>
wrote:

> Hi,
>
> On Sat, Dec 17, 2016 at 7:16 AM, Dario Faggioli <dario.faggioli@citrix.com
> > wrote:
>
>> On Sat, 2016-12-17 at 00:53 +0530, Praveen Kumar wrote:
>> > The patch gets rid of a redundant check in csched_vcpu_acct. In fact,
>> > the function is only called from csched_tick, which already checks
>> > that current is not the idle vcpu. The patch also adds an ASSERT to
>> > the same effect, in order to make assumption ( i.e., no calling this
>> > on idle vcpus) even more clear and as a guard for future mis-use.
>> >
>> > Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
>> > Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
>> >
>> Better than before. But still, if I:
>>  - save this mail as mbox
>>  - try to import it in git
>> it fails.
>>
>> OTOH, if I:
>>  - save this mail as mbox
>>  - run dos2unix on the mbox file
>>  - try to import it in git
>> it works!
>>
>> Which, since you're now using git-send-email, makes me think it may be
>> your editor/OS which is at fault and inserts spurious stuff at line
>> breaks (the classic CR vs. CR+LF thing).
>>
>> What editor on what OS are you using?
>>
>
> I am using SLED machine and vim editor. I tried checking with vimdiff over
> the patch generated and mbox file ( create by evolution ), I found spurious
> stuff (^M) as mentioned added. After dos2unix, the mbox file was same to
> that of the patch sent.
>
>>
>> Another possibility is that there is something wrong here at my hand.
>> George, do you have (similar) issues when trying to apply this patch?
>>
>> 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: Type: text/html, Size: 3328 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] 7+ messages in thread

* Re: [PATCH v3] xen: sched: removal of redundant check in Credit
  2016-12-20  9:04     ` Praveen Kumar
@ 2016-12-20 13:18       ` Dario Faggioli
  0 siblings, 0 replies; 7+ messages in thread
From: Dario Faggioli @ 2016-12-20 13:18 UTC (permalink / raw)
  To: Praveen Kumar; +Cc: George Dunlap, xen-devel


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

On Tue, 2016-12-20 at 14:34 +0530, Praveen Kumar wrote:
> Hi Dario,
> 
> I tried with 'git am' to apply the patch after downloading the mbox
> file, that worked fine. Do let me know if that is ok.
> 
Well, if you tried and it works, I'm sure it is. I don't really use
`git am` as part of my workload, that's why I did not try.

I've now done it as a test, and I confirm it works. So it's probably an
StGit issue, or something else. In fact, I said in my email that,
although I was reporting an issue I was having, I wasn't sure how
relevant it was, and could not rule out it was an issue with my own
setup.

Thanks for trying `git am` and reporting it works. This patch has my
Ack already, which means I'm happy with it. It's now up to George, or
another committer, to either comment or put it in.

Let's a little bit of time for this to happen, especially considering
the time of the year. :-D
If it will take too long, you can ping the thread with an email.

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] 7+ messages in thread

* Re: [PATCH v3] xen: sched: removal of redundant check in Credit
  2016-12-17  1:46 ` Dario Faggioli
  2016-12-17  8:14   ` Praveen Kumar
@ 2016-12-28  9:02   ` George Dunlap
  2016-12-28 14:23     ` Dario Faggioli
  1 sibling, 1 reply; 7+ messages in thread
From: George Dunlap @ 2016-12-28  9:02 UTC (permalink / raw)
  To: Dario Faggioli, Praveen Kumar, xen-devel; +Cc: george.dunlap

On 17/12/16 01:46, Dario Faggioli wrote:
> On Sat, 2016-12-17 at 00:53 +0530, Praveen Kumar wrote:
>> The patch gets rid of a redundant check in csched_vcpu_acct. In fact,
>> the function is only called from csched_tick, which already checks
>> that current is not the idle vcpu. The patch also adds an ASSERT to
>> the same effect, in order to make assumption ( i.e., no calling this
>> on idle vcpus) even more clear and as a guard for future mis-use.
>>
>> Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
>> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
>>
> Better than before. But still, if I:
>  - save this mail as mbox
>  - try to import it in git
> it fails.
> 
> OTOH, if I:
>  - save this mail as mbox
>  - run dos2unix on the mbox file
>  - try to import it in git
> it works!

FWIW the script I use runs dos2unix on everything I get via e-mail
(either saved as an mbox or as an attachment) as a matter of course.
Are you actually sometimes able to git am mbox'd files *without* running
dos2unix?

 -George


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

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

* Re: [PATCH v3] xen: sched: removal of redundant check in Credit
  2016-12-28  9:02   ` George Dunlap
@ 2016-12-28 14:23     ` Dario Faggioli
  0 siblings, 0 replies; 7+ messages in thread
From: Dario Faggioli @ 2016-12-28 14:23 UTC (permalink / raw)
  To: George Dunlap, Praveen Kumar, xen-devel; +Cc: george.dunlap


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

On Wed, 2016-12-28 at 09:02 +0000, George Dunlap wrote:
> On 17/12/16 01:46, Dario Faggioli wrote:
> > On Sat, 2016-12-17 at 00:53 +0530, Praveen Kumar wrote:
> > > Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
> > > Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
> > > 
> > Better than before. But still, if I:
> >  - save this mail as mbox
> >  - try to import it in git
> > it fails.
> > 
> > OTOH, if I:
> >  - save this mail as mbox
> >  - run dos2unix on the mbox file
> >  - try to import it in git
> > it works!
> 
> FWIW the script I use runs dos2unix on everything I get via e-mail
> (either saved as an mbox or as an attachment) as a matter of course.
> Are you actually sometimes able to git am mbox'd files *without*
> running
> dos2unix?
> 
Not really, but main reason is I don't `git am' at all! I use `stg
import', but not very often, and I also end up pre-filtering with
dos2unix.

I mentioned it to Praveen as a potential issue, out of _my_ ignorance
of your workflow as committers. It turns out it's normal.. So, thanks
for letting me know, and sorry for the noise. :-)

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] 7+ messages in thread

end of thread, other threads:[~2016-12-28 14:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16 19:23 [PATCH v3] xen: sched: removal of redundant check in Credit Praveen Kumar
2016-12-17  1:46 ` Dario Faggioli
2016-12-17  8:14   ` Praveen Kumar
2016-12-20  9:04     ` Praveen Kumar
2016-12-20 13:18       ` Dario Faggioli
2016-12-28  9:02   ` George Dunlap
2016-12-28 14:23     ` Dario Faggioli

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.