Skip to contentSkip to conversation

Accounting in Credit Scheduler

DISCUSSION rahul gundecha 6 participants 10 messages Apr 9, 2007 – Apr 12, 2007

lore
Share & tools
lore
#0 lore raw

Hi..

I was going through wiki page of Credit Scheduler which says -
" The scheduling decision is the common path of the scheduler and is therefore designed to be light weight and efficient. No accounting takes place in this code path. "

So where does the accounting process takes place. exctaly by which way accounting for CPU, different IO device usage is done. With the complex architecture of Xen, how does this accounting process is carried out?

thanks,
-Rahul

---------------------------------
Here’s a new way to find what you're looking for - Yahoo! Answers

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 10 lines · rahul gundecha

Hi..
I was going through wiki page of Credit Scheduler which says - " The scheduling decision is the common path of the scheduler and is therefore designed to be light weight and efficient. No accounting takes place in this code path. "
So where does the accounting process takes place. exctaly by which way accounting for CPU, different IO device usage is done. With the complex architecture of Xen, how does this accounting process is carried out?

The credit scheduler sets up a timer when it is initialized. It does process accounting during the timer service routine.

The decision to schedule the next vcpu is done on a different code path, and is optimized to be as fast as possible.

Mike

Signature · 5 lines
Mike D. Day
IBM LTC
Cell: 919 412-3900
Sametime: [email protected] AIM: ncmikeday  Yahoo: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc
#2 lore raw

thanks alot Mike for kind reply.

One more curiousity is how often a timer routine is called & how often scheduling code? It may be configurable interval as well, but then whats default value. I guess timer is called more frequently & call to scheduling routine is made less frquently and is called from timer itself.

Can I get pointer to some reference where I will get to know how exactly this mechanism works. May be digging through code will be expensive option so I want to avoid it for a moment.

thanks,
-rahul

Quoted 10 lines · rahul gundecha

Hi..
I was going through wiki page of Credit Scheduler which says - " The scheduling decision is the common path of the scheduler and is therefore designed to be light weight and efficient. No accounting takes place in this code path. "
So where does the accounting process takes place. exctaly by which way accounting for CPU, different IO device usage is done. With the complex architecture of Xen, how does this accounting process is carried out?

The credit scheduler sets up a timer when it is initialized. It does process accounting during the timer service routine.

The decision to schedule the next vcpu is done on a different code path, and is optimized to be as fast as possible.

Mike

Signature · 15 lines
Mike D. Day
IBM LTC
Cell: 919 412-3900
Sametime: [email protected] AIM: ncmikeday  Yahoo: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc




-Rahooooooooooooooool...
 exceptions are most common things to happen..... 

 				
---------------------------------
 Here’s a new way to find what you're looking for - Yahoo! Answers 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 12 lines · rahul gundecha

thanks alot Mike for kind reply.
One more curiousity is how often a timer routine is called & how often scheduling code? It may be configurable interval as well, but then whats default value.
I guess timer is called more frequently & call to scheduling routine is made less frquently and is called from timer itself. Can I get pointer to some reference where I will get to know how exactly this mechanism works. May be digging through code will be expensive option so I want to avoid it for a moment. thanks,
-rahul

The timer is initialized in xen/common/sched_credit.c:

static __init int csched_start_tickers(void)
{
struct csched_pcpu *spc;
unsigned int cpu;

   for_each_online_cpu ( cpu )
   {
       spc = CSCHED_PCPU(cpu);
       set_timer(&spc->ticker, NOW() + MILLISECS(CSCHED_MSECS_PER_TICK));
   }

return 0;
}

CSCHED_MSECS_PER_TICK is #defined as 10, so the accounting code runs every 10 ms - for each physical processor.

Mike

Signature · 5 lines
Mike D. Day
IBM LTC
Cell: 919 412-3900
Sametime: [email protected] AIM: ncmikeday  Yahoo: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc
#4 lore raw

XenOProfile may have the conflict with SATA AHCI mode.

Hi,

I notice this issue recently when I'm using XenOProfile with the latest Xen-unstable repository. I have several SATA disks to hose several guest domains. For the performance purpose, I want to use the on-board AHCI mode so each SATA disk has its own data transfer channel. However, I found XenOProfile has some conflict with AHCI mode as Xen will boot into kernel panic with weird mount errors after XenOProfile is enabled. The problem is gone when I set SATA mode to compatible in BIOS (i.g. IDE emulation mode).

Regards,

Liang

#5 lore raw

RE: XenOProfile may have the conflict with SATA AHCI mode.

Quoted 1 line

I notice this issue recently when I'm using XenOProfile with the

latest

Quoted 1 line

Xen-unstable repository. I have several SATA disks to hose several

guest

Quoted 6 lines

domains. For the performance purpose, I want to use the on-board AHCI mode
so each SATA disk has its own data transfer channel. However, I found XenOProfile has some conflict with AHCI mode as Xen will boot into kernel
panic with weird mount errors after XenOProfile is enabled. The

problem

Quoted 3 lines

is
gone when I set SATA mode to compatible in BIOS (i.g. IDE emulation mode).

XenOProfile is the only thing that uses NMIs, but I've no idea why that would interfere with the SATA controller.

If you were seing the issue round the other way I'd suspect something dodgy with the BIOS'es SMM mode. Might still be worth checking for a BIOS upgrade.

Ian

#6 lore raw

RE: XenOProfile may have the conflict with SATA AHCI mode.

Quoted 21 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ian Pratt
Sent: Wednesday, April 11, 2007 12:18 PM
To: Liang Yang; [email protected]
Subject: RE: [Xen-devel] XenOProfile may have the conflict with SATA AHCI mode.

Quoted 1 line

I notice this issue recently when I'm using XenOProfile with the

latest

Quoted 1 line

Xen-unstable repository. I have several SATA disks to hose several

guest

Quoted 1 line

domains. For the performance purpose, I want to use the

on-board AHCI

Quoted 1 line

mode so each SATA disk has its own data transfer channel.

However, I

Quoted 3 lines

found XenOProfile has some conflict with AHCI mode as Xen will boot into kernel panic with weird mount errors after XenOProfile is enabled. The

Quoted 9 lines

problem

Quoted 2 lines

is
gone when I set SATA mode to compatible in BIOS (i.g. IDE

emulation

Quoted 1 line

mode).

XenOProfile is the only thing that uses NMIs, but I've no idea why that would interfere with the SATA controller.

I don't know how XenOprofile could be interfering with SATA
controller either. The only possible explanation I can think of is that the NMI interrupts are disrupting some time sensitive code in the SATA driver, but I do not know much about SATA. Maybe someone more familiar with SATA can comment.

Do you see the same behavior runing Oprofile in vanila linux? What is the parameters you use to start oprofile?

Renato.

Quoted 11 lines

If you were seing the issue round the other way I'd suspect something dodgy with the BIOS'es SMM mode. Might still be worth checking for a BIOS upgrade.

Ian

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw

Re: XenOProfile may have the conflict with SATA AHCI mode.

In reply to Ian Pratt

I once thought maybe the problem is caused by the failure of loading AHCI driver. So I added --preload=AHCI when building ramdisk for Xen after XenOProfiling is enabled. However, Xen still booted into kernel panic with weird mount errors.

I used some patch for XenOProfile nmi_int.c to make it work on Intel core 2 based processors. I notice Xen also updated nmi_int.c a couple of days ago to make XenOProfile recognize Intel core 2 based processors. I hope the problem is not caused by the updates of nmi_int.c.

BTW, The BIOS is already flashed to the latest I could get.

Liang

----- Original Message ----- From: "Ian Pratt" <[email protected]>
To: "Liang Yang" <[email protected]>; <[email protected]>
Sent: Wednesday, April 11, 2007 12:17 PM
Subject: RE: [Xen-devel] XenOProfile may have the conflict with SATA AHCI mode.

Quoted 1 line

I notice this issue recently when I'm using XenOProfile with the

latest

Quoted 1 line

Xen-unstable repository. I have several SATA disks to hose several

guest

Quoted 6 lines

domains. For the performance purpose, I want to use the on-board AHCI mode
so each SATA disk has its own data transfer channel. However, I found XenOProfile has some conflict with AHCI mode as Xen will boot into kernel
panic with weird mount errors after XenOProfile is enabled. The

problem

Quoted 3 lines

is
gone when I set SATA mode to compatible in BIOS (i.g. IDE emulation mode).

XenOProfile is the only thing that uses NMIs, but I've no idea why that would interfere with the SATA controller.

If you were seing the issue round the other way I'd suspect something dodgy with the BIOS'es SMM mode. Might still be worth checking for a BIOS upgrade.

Ian

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#8 lore raw
In reply to rahul gundecha
Quoted 4 lines

One more curiousity is how often a timer routine is called & how often scheduling code? It may be configurable interval as well, but then whats default value. I guess timer is called more frequently & call to scheduling routine is made less frquently and is called from timer itself.

Can I get pointer to some reference where I will get to know how exactly this mechanism works. May be digging through code will be expensive option so I want to avoid it for a moment.

Your best bet is to study the code. The scheduler code is fairly readable. IIRC, the accounting code happens in two parts -- every 10ms, measurements are made, but only every 30ms the measurements are used to update accounting information. Read xen/common/sched_credit.c

Diwaker

Signature · 1 line
Web/Blog/Gallery: http://floatingsun.net/blog
#9 lore raw

thanks alot Diwaker & Mike from your kind replies.. I will go through sched_credit.c as well..

regards,
-Rahul

Diwaker Gupta <[email protected]> wrote: > One more curiousity is how often a timer routine is called & how often scheduling code? It may be configurable interval as well, but then whats default value.

Quoted 3 lines

I guess timer is called more frequently & call to scheduling routine is made less frquently and is called from timer itself.

Can I get pointer to some reference where I will get to know how exactly this mechanism works. May be digging through code will be expensive option so I want to avoid it for a moment.

Your best bet is to study the code. The scheduler code is fairly readable. IIRC, the accounting code happens in two parts -- every 10ms, measurements are made, but only every 30ms the measurements are used to update accounting information. Read xen/common/sched_credit.c

Diwaker

Signature · 11 lines
Web/Blog/Gallery: http://floatingsun.net/blog




-Rahooooooooooooooool...
 exceptions are most common things to happen..... 

       
---------------------------------
 Check out what you're missing if you're not on Yahoo! Messenger 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel