All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ananth <cbananth@gmail.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: Re: Issues while running Xen with new RR scheduler
Date: Sat, 9 May 2009 03:11:55 +0530	[thread overview]
Message-ID: <bdf293de0905081441r5b29f90dicc96fd18cad0e191@mail.gmail.com> (raw)
In-Reply-To: <bdf293de0905081355q1a9d7681xd4395b18ae570f09@mail.gmail.com>


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

Hello,
Sorry, I had attached the wrong file. Please find the correct round robin
code as attached.

Thanks & Regards
Ananth

On Sat, May 9, 2009 at 2:25 AM, Ananth <cbananth@gmail.com> wrote:

> Hi,
> I am not able to even view the cursor when system boots. I pressed Ctrl+A
> and tried giving other commands. But there was no response. I dont think
> setting up a serial console will also help in this case.
> In my code (attached) I have written methods to initialize vcpu and destroy
> vcpu. I have not initialized domains as it is compared to the other
> schedulers. Could that be the problem?
> Please guide me in this regard.
>
> Thank you.
>
> Regards
> Ananth
>
>
> On Mon, May 4, 2009 at 3:29 PM, Ananth <cbananth@gmail.com> wrote:
>
>> Hello,
>> Thank you so much for the suggestions. I suddenly got back my confidence
>> that there are so many people to help me out. :)
>> I will try setting it up and get back to you in case I face any issues.
>>
>> Thanks again.
>>
>> Warm Regards
>> Ananth
>>
>>
>> On Fri, May 1, 2009 at 8:33 PM, George Dunlap <
>> george.dunlap@eu.citrix.com> wrote:
>>
>>> Ian Jackson wrote:
>>>
>>>> ... xterm also has the ability to log to a file, available from the
>>>> mouse menus.
>>>>
>>>>
>>> Hmm, or with the -l option apparently.  But you can't chose the name of
>>> the log file, only the directory where it gets created, which could be
>>> annoying.
>>>
>>> Well, I learned a trick or two today. :-)
>>> -George
>>>
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 2599 bytes --]

[-- Attachment #2: sched_rrobin.c --]
[-- Type: text/x-csrc, Size: 3093 bytes --]

#include <xen/lib.h>
#include <xen/sched.h>
#include <xen/time.h>
#include <xen/sched-if.h>
#include <xen/softirq.h>
#include <xen/errno.h>
#include <xen/list.h>
#include <xen/timer.h>

#define EDOM_INFO(d)   ((struct rrobin_vcpu_info *)((d)->sched_priv))
#define CPU_INFO(cpu)  \
    ((struct rrobin_cpu_info *)per_cpu(schedule_data, cpu).sched_priv)
#define RUNQ(cpu)      (&CPU_INFO(cpu)->runnableq)
#define IDLETASK(cpu)  ((struct vcpu *)per_cpu(schedule_data, cpu).idle)

struct list_head *vcpu_list_head;
struct list_head *head;
struct list_head *vcpu_list_tail;
/*struct list_head *runq = RUNQ(cpu);*/
struct list_head *runq;

struct rrobin_vcpu_info {
    struct list_head list;
    struct vcpu *vcpu;
};

struct rrobin_cpu_info {
    struct list_head runnableq;
};

/* Add a VCPU */
static int rrobin_vcpu_init(struct vcpu *v){
    struct rrobin_vcpu_info *inf;
    printk(KERN_ALERT "\nin Add VCPU\n");
    if ( (v->sched_priv = xmalloc(struct rrobin_vcpu_info)) == NULL )
        return 1;
    memset(v->sched_priv, 0, sizeof(struct rrobin_vcpu_info));

    inf = EDOM_INFO(v);
    inf->vcpu = v;


    /* Allocate per-CPU context if this is the first domain to be added. */
    if ( unlikely(per_cpu(schedule_data, v->processor).sched_priv == NULL) )
    {
        per_cpu(schedule_data, v->processor).sched_priv = 
            xmalloc(struct rrobin_cpu_info);
        BUG_ON(per_cpu(schedule_data, v->processor).sched_priv == NULL);
        memset(CPU_INFO(v->processor), 0, sizeof(*CPU_INFO(v->processor)));
        INIT_LIST_HEAD(RUNQ(v->processor));
    }
    INIT_LIST_HEAD(&(inf->list));
    return 0;
}

static void rrobin_vcpu_destroy(struct vcpu *v)
{
    xfree(v->sched_priv);
}

static inline void increment_run_queue(void){
    vcpu_list_head = runq;
    vcpu_list_tail = (vcpu_list_head)->prev;
    head = vcpu_list_head;
    vcpu_list_tail = vcpu_list_head;
    vcpu_list_head = (vcpu_list_tail)->next;
    vcpu_list_tail = head;
}

struct task_slice rrobin_schedule(s_time_t now){
    /*struct list_head temp; 	*/
    int cpu = smp_processor_id();
    /*struct rrobin_vcpu_info *inf = EDOM_INFO(current);*/
    struct rrobin_vcpu_info *runinf;
    struct vcpu *temp;
    struct task_slice ret;
    ret.time = MILLISECS(10); /* Time quantum to scan the VCPU list to find a runnable VCPU */


    runq = RUNQ(cpu);

    if ( !list_empty(runq) ){
        runinf   = list_entry(runq->next,struct rrobin_vcpu_info,list);
        temp = runinf->vcpu;
        ret.task = temp;

    }
    else {
        ret.task = IDLETASK(cpu);
        
    }

increment_run_queue();

return ret;
}

struct scheduler sched_rrobin_def = {
    .name           = "Round robin Scheduler",
    .opt_name       = "rrobin",
    .sched_id       = XEN_SCHEDULER_RROBIN,

    .init_domain    = NULL,
    .destroy_domain = NULL,

    .init_vcpu      = rrobin_vcpu_init,
    .destroy_vcpu   = rrobin_vcpu_destroy,

    .do_schedule    = rrobin_schedule,

    .pick_cpu       = NULL,
    .dump_cpu_state = NULL,
    .sleep          = NULL,
    .wake           = NULL,
    .adjust         = NULL,

};



[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

      reply	other threads:[~2009-05-08 21:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27 18:39 Issues while running Xen with new RR scheduler Ananth
2009-04-27 20:41 ` George Dunlap
2009-04-27 22:39   ` Ananth
2009-04-28 14:19     ` George Dunlap
2009-04-30 22:00       ` Ananth
2009-05-01 10:25         ` George Dunlap
2009-05-01 10:27           ` George Dunlap
2009-05-01 14:48           ` Ian Jackson
2009-05-01 14:53             ` George Dunlap
2009-05-01 14:59               ` Ian Jackson
2009-05-01 15:03                 ` George Dunlap
2009-05-04  9:59                   ` Ananth
2009-05-08 20:55                     ` Ananth
2009-05-08 21:41                       ` Ananth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bdf293de0905081441r5b29f90dicc96fd18cad0e191@mail.gmail.com \
    --to=cbananth@gmail.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.