[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830611230053m7182698cu897abe5d19471aff@mail.gmail.com>
Date: Thu, 23 Nov 2006 00:53:51 -0800
From: "Paul Menage" <menage@...gle.com>
To: "Pavel Emelianov" <xemul@...nvz.org>
Cc: "Kirill Korotaev" <dev@...ru>, "Andrew Morton" <akpm@...l.org>,
ckrm-tech@...ts.sourceforge.net,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
matthltc@...ibm.com, hch@...radead.org,
"Alan Cox" <alan@...rguk.ukuu.org.uk>, oleg@...sign.ru,
devel@...nvz.org
Subject: Re: [ckrm-tech] [PATCH 4/13] BC: context handling
On 11/23/06, Pavel Emelianov <xemul@...nvz.org> wrote:
>
> We can do the following:
>
> if (tsk == current)
> /* fast way */
> tsk->exec_bc = bc;
> else
> /* slow way */
> stop_machine_run(...);
>
> What do you think?
How about having two pointers per task:
- exec_bc, which is the one used for charging
- real_bc, which is the task's actual beancounter
at the start of irq, do
current->exec_bc = &init_bc;
at the end of irq, do
current->exec_bc = current->real_bc;
When moving a task to a different bc do:
task->real_bc = new_bc;
atomic_cmpxchg(&task->exec_bc, old_bc, new_bc);
(with appropriate memory barriers). So if the task is in an irq with a
modified exec_bc pointer, we do nothing, otherwise we update exec_bc
to point to the new real_bc.
Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists