[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YBEuy6zlBcV8gLvY@hirez.programming.kicks-ass.net>
Date: Wed, 27 Jan 2021 10:13:47 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Frederic Weisbecker <frederic@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E . McKenney" <paulmck@...nel.org>,
Ingo Molnar <mingo@...hat.com>, Michal Hocko <mhocko@...e.com>,
rostedt@...dmis.org, jbaron@...mai.com, ardb@...nel.org
Subject: Re: [RFC PATCH 6/8] preempt/dynamic: Provide
preempt_schedule[_notrace]() static calls
On Tue, Jan 26, 2021 at 05:57:30PM -0600, Josh Poimboeuf wrote:
> On Fri, Jan 22, 2021 at 05:52:26PM +0100, Peter Zijlstra wrote:
> > static int static_call_add_module(struct module *mod)
> > {
> > - return __static_call_init(mod, mod->static_call_sites,
> > - mod->static_call_sites + mod->num_static_call_sites);
> > + struct static_call_site *start = mod->static_call_sites;
> > + struct static_call_site *stop = start + mod->num_static_call_sites;
> > + struct static_call_site *site;
> > +
> > + for (site = start; site != stop; site++) {
> > + unsigned long addr = (unsigned long)static_call_key(site);
> > + struct static_call_ass *ass;
> > +
> > + /*
> > + * Gotta fix up the keys that point to the trampoline.
> > + */
> > + if (!kernel_text_address(addr))
> > + continue;
> > +
> > + ass = static_call_find_ass(addr);
> > + if (!ass) {
> > + pr_warn("Failed to fixup __raw_static_call() usage at: %ps\n",
> > + static_call_addr(site));
> > + return -EINVAL;
> > + }
> > + site->key = ((unsigned long)ass->key - (unsigned long)&site->key) |
> > + (site->key & STATIC_CALL_SITE_FLAGS);
>
> Well, I hate it, but I'm not sure I have any better ideas. It should be
> possible to use kallsyms, instead of the rb-tree/register nonsense. Not
> sure about the performance impact though. Might be a good reason to
> speed up kallsyms!
Oh right, let me see if I can make that work.
> Also I do have some naming suggestions ;-)
Nah, we need a little more fun back in the code :-)
Powered by blists - more mailing lists