[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJWu+oqbANdTq8H9oWBZU4Vc861Zu4fGmomw4o=NMC-2Q_QtxA@mail.gmail.com>
Date: Mon, 9 Oct 2017 12:11:54 -0700
From: Joel Fernandes <joelaf@...gle.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Joel Fernandes <joelaf@...gle.com>,
Jessica Yu <jeyu@...nel.org>
Subject: Re: [PATCH v2] ftrace: Clear hashes of stale ips of init memory
On Mon, Oct 9, 2017 at 11:53 AM, Joel Fernandes <joelaf@...gle.com> wrote:
[..]
> +
> void ftrace_free_mem(struct module *mod, void *start_ptr, void *end_ptr)
> {
> unsigned long start = (unsigned long)(start_ptr);
> @@ -6076,8 +6135,12 @@ void ftrace_free_mem(struct module *mod, void *start_ptr, void *end_ptr)
> struct dyn_ftrace *rec;
> struct dyn_ftrace key;
> struct ftrace_mod_map *mod_map = NULL;
> + struct ftrace_init_func *func, *func_next;
> + struct list_head clear_hash;
> int order;
>
> + INIT_LIST_HEAD(&clear_hash);
> +
> key.ip = start;
> key.flags = end; /* overload flags, as it is unsigned long */
>
> @@ -6102,6 +6165,9 @@ void ftrace_free_mem(struct module *mod, void *start_ptr, void *end_ptr)
> if (!rec)
> continue;
>
> + /* rec will be cleared from hashes after ftrace_lock unlock */
> + add_to_clear_hash_list(&clear_hash, rec);
> +
> if (mod_map)
> save_ftrace_mod_rec(mod_map, rec);
>
> @@ -6123,6 +6189,11 @@ void ftrace_free_mem(struct module *mod, void *start_ptr, void *end_ptr)
> goto again;
> }
> mutex_unlock(&ftrace_lock);
> +
> + list_for_each_entry_safe(func, func_next, &clear_hash, list) {
I think I screwed this list_for_each_entry up! Please ignore this
revision, I'll send another patch revision shortly.
Regards,
Joel
Powered by blists - more mailing lists