Re: [ckpatch][8/29] track_mutexes-1.patch

From: Nikita Danilov
Date: Sun Jun 18 2006 - 07:03:17 EST


Con Kolivas writes:
> Keep a record of how many mutexes are held by any task. This allows cpu
> scheduler code to use this information in decision making for tasks that
> hold contended resources.

Natural extension of this idea is to specify priority bump for every
mutex, with default mutex initializer setting this value to 1.

In fact, this looks like an old UNIX method of specifying priority value
as an argument to the call of sleeping function (sleep, tsleep,
etc.).

>
> Signed-off-by: Con Kolivas <kernel@xxxxxxxxxxx>
>

[...]

> void *journal_info;
> Index: linux-ck-dev/kernel/fork.c
> ===================================================================
> --- linux-ck-dev.orig/kernel/fork.c 2006-06-18 15:20:14.000000000 +1000
> +++ linux-ck-dev/kernel/fork.c 2006-06-18 15:23:44.000000000 +1000
> @@ -1022,6 +1022,7 @@ static task_t *copy_process(unsigned lon
> p->io_context = NULL;
> p->io_wait = NULL;
> p->audit_context = NULL;
> + p->mutexes_held = 0;

You may also add

BUG_ON(p->mutexes_held != 0);

check to do_exit().

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/