pagg
[Top] [All Lists]

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

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

>>I wondered why every advanced feature duplicates its own hooks
>>in fork()/exit() for those event handling.
>
>
> Sometimes the simple mechanism is the best.  If dozens of features
> require a special subroutine to be called from the same place, such as
> fork, exec or init (kernel boot), then perhaps dozens of subroutine
> calls, all in a row, is best.
>
> Just because a way of doing things requires a minimum of compute cycles,
> and is so simple that even a beginning programmer can understand it
> almost immediately, doesn't make it inferior.

Hmm..., 'Simple is the best' is truth, I also think.


>>__alloc_pages() has possibility to be called from a section which
>>cannot block. Thus, I replaced PAGG semaphore by RCU.
>
> Are you saying that pagg_sem can't block?  I thought semaphores
> could block.

No, semaphores always have possibility to block, and pagg_sem is also same.
(Who dose need a never-blocking-semaphore?)
When I modified the CpuSet feature for using PAGG, I noticed we need call
pagg_get() from some critical sections.
Thus, I modified PAGG to replace task->pagg_sem by RCU.
pagg_get() does not block on the PAGG implemented by RCU.

> I am missing something here.  What is the sequence of events that
> would lead to trying to hold a semaphore from interrupt context
> (before your lockless changes)?

For example, pid_array_load() in kernel/cpuset.c is relevant.
(This is the Paul Jackson's original implementation.)

int pid_array_load()
{
  read_lock(&tasklist_lock);              ---------
  do_each_thread(g, p) {                      ^
    if (p->cpuset == cs) {                    |
             :                             Critical
    }                                      Section
  } while_each_thread(g, p);                  |
array_full:                                   v
  read_unlock(&tasklist_lock);            ---------
}

In this case, if CpuSet would be a PAGG's custmer, we call pagg_call()
to refer the PAGG object related to each task under the 
read_lock(&tasklist_lock).
Thus, pagg_get() must not block.

>>Indeed, I think CpuSet and PAGG(+Job/CSA) are so worthwhile solution.
>>I'll try to move the discussion into LKML.
>>But we might start from the improvement of PAGG before it.
>
> I think that there is a good chance that later this month, February 2005,
> the subject of the cpuset patch will again become active on lkml.
> I will be pleased and grateful for any support you might provide to
> encourage the acceptance of cpusets.

Today, my colleague acclaim CpuSet also. :)
It's good, if we can use CpuSet on stock-kernel.

Thank you.
--
Linux Promotion Center, NEC
KaiGai Kohei <kaigai@xxxxxxxxxxxxx>

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