[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061120221941.e2c379b3.akpm@osdl.org>
Date: Mon, 20 Nov 2006 22:19:41 -0800
From: Andrew Morton <akpm@...l.org>
To: ego@...ibm.com
Cc: torvalds@...l.org, linux-kernel@...r.kernel.org, vatsa@...ibm.com,
dipankar@...ibm.com, davej@...hat.com, mingo@...e.hu,
kiran@...lex86.org
Subject: Re: [PATCH 1/4] Extend notifier_call_chain to count nr_calls made.
On Tue, 14 Nov 2006 17:50:51 +0530
Gautham R Shenoy <ego@...ibm.com> wrote:
> Provide notifier_call_chain with an option to call only a specified number of
> notifiers and also record the number of call to notifiers made.
>
> The need for this enhancement was identified in the post entitled
> "Slab - Eliminate lock_cpu_hotplug from slab"
> (http://lkml.org/lkml/2006/10/28/92) by Ravikiran G Thirumalai and
> Andrew Morton.
>
> This patch adds two additional parameters to notifier_call_chain API namely
> - int nr_to_calls : Number of notifier_functions to be called.
> The don't care value is -1.
>
> - unsigned int *nr_calls : Records the total number of notifier_funtions
> called by notifier_call_chain. The don't care
> value is NULL.
>
> ...
>
> +
> static int __kprobes notifier_call_chain(struct notifier_block **nl,
> - unsigned long val, void *v)
> + unsigned long val, void *v,
> + int nr_to_call, unsigned int *nr_calls)
> {
> int ret = NOTIFY_DONE;
> struct notifier_block *nb, *next_nb;
>
> nb = rcu_dereference(*nl);
> - while (nb) {
> +
> + while (nb && nr_to_call) {
> next_nb = rcu_dereference(nb->next);
> ret = nb->notifier_call(nb, val, v);
> +
> + if (nr_calls)
> + *nr_calls ++;
This gets
kernel/sys.c: In function 'notifier_call_chain':
kernel/sys.c:164: warning: value computed is not used
And indeed, this code doesn't work.
What happened?
-
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