pagg
[Top] [All Lists]

Re: CpuSet on PAGG (Re: PAGG in Open Source projects?)

To: Erik Jacobson <erikj@xxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: CpuSet on PAGG (Re: PAGG in Open Source projects?)
From: Kaigai Kohei <kaigai@xxxxxxxxxxxxx>
Date: Thu, 03 Feb 2005 22:44:45 +0900
Cc: Paul Jackson <pj@xxxxxxx>, pagg@xxxxxxxxxxx, limin@xxxxxxxxxxxxxxxxxx, lse-tech@xxxxxxxxxxxxxxxxxxxxx, guillaume.thouvenin@xxxxxxxx
In-reply-to: <Pine.SGI.4.53.0502020830360.978682@subway.americas.sgi.com>
References: <Pine.SGI.4.53.0501181437280.627920@subway.americas.sgi.com> <41F8E117.5030501@ak.jp.nec.com> <20050127081753.5a9d16af.pj@sgi.com> <41FA330A.2030303@ak.jp.nec.com> <20050128050807.24018fb3.pj@sgi.com> <41FDFCDC.8080504@ak.jp.nec.com> <20050131030715.05cbb981.pj@sgi.com> <41FF7EB3.2090409@ak.jp.nec.com> <Pine.SGI.4.53.0502020830360.978682@subway.americas.sgi.com>
Sender: pagg-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Hi, Erik. Thanks for your comments.

Erik Jacobson wrote:
>>I agree that Call-by-string-name dynamically evaluated invocations are
>>expensive and not good as you said.
>>(1) It should be possible to refer a PAGG object from some critical
>>sections. (2) It should be light-weight to refer a PAGG object for
>>each customer. IMO, these should be fixed for PAGG to be widely-supported.
>>I want a comment by Erik Jacobson.
>
>
> Sorry for the delay.  I was on vacation.
>
> For (1) - can you give some examples?

For example, I want to refer the PAGG object for each task
when we scan the task-list under the read_lock(&tasklist_lock).
Using semaphore for exclusion isn't appropriate st such times.

And, we should avoid to use any kind of spinlock as possible as we can,
because it's expencive.
I think RCU is appropriate for alternative lockless method in this case.
# RCU's bad point is current PAGG's custmer must be forced to modify
# own implementation.

> For (2) - If you look at the exec hook __pagg_exec function, we go through
> the list of paggs for the task that reached the hook, and we execute the
> associated function pointer (if it is assigned in the pagg hook).  When we
> execute the associated exec function pointer, we pass a reference to the pagg
> in question.

It's right when we are processing the hook function.
But we can call pagg_get() to refer the PAGG object in other place.

I think the issue of (2) is using string comparison in pagg_get and so on.
Generically, string comparison is more expensive than integer one.

Is it possible that PAGG-engine associates the unique integer key with
PAGG's customer(such as Job) when pagg_hook_register() was called, and
we can call pagg_get() with task_strcut and this integer key instead of
PAGG-custmer's identical string(such as "job" or "cpuset") ?

> pagg_get I suppose is a tiny bit expensive but it only gets bad when there
> are lots of pagg associations for a given task.  I assume this is your
> concern for (2) though, right?

That's right also, I think. But is it unavoidable ?

> If we were to change this, what would you suggest?  Recall that there is
> a data pointer in the pagg structure that kernel module "customers" can
> store stuff in on a per-task basis.  One could envision look-up tables
> or something, but that seems only a little less expensive and more
> complicated.

My proposal is that pagg_sem should be replaced by RCU for issue (1).

For example, is it possible to abolish strcmp() for the issue (2)
by the following method ?

1) pagg_hook_register() returns the unique integer key associated with
   PAGG's customer registered.
2) That unique integer key is made a key for finding the PAGG object.

  struct pagg * pagg_get(struct task_struct *task, int key){
    struct pagg *pagg;
    list_for_each_entry(pagg, &task->pagg_list, entry) {
    if (key==pagg->key)
      return pagg;
    return NULL;
  }

I expect that PAGG and PAGG's custmer such as Job is merged into up-stream 
kernel.
Thanks.
--
Linux Promotion Center, NEC
KaiGai Kohei <kaigai@xxxxxxxxxxxxx>


<Prev in Thread] Current Thread [Next in Thread>