[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C9BB696F3A938947B10DCAD29FAB8FFA66BDB8A6@CRSMSX101.amr.corp.intel.com>
Date: Fri, 22 Jun 2018 18:46:28 +0000
From: "Bae, Chang Seok" <chang.seok.bae@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: Andy Lutomirski <luto@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>,
"Ingo Molnar" <mingo@...nel.org>, Andi Kleen <ak@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Metzger, Markus T" <markus.t.metzger@...el.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v4 6/7] x86/vdso: Introduce CPU number helper functions
On Friday, 22 Jun 2018, Thomas Gleixner wrote:
> On Wed, 20 Jun 2018, Chang S. Bae wrote:
> > CPU number initialization in vDSO is now a bit cleaned up by
> > the new helper functions. The helper functions will take
> > care of combing CPU and node number and reading each from
> s/combing/combining/ please
Will fix.
> > @@ -18,9 +18,9 @@ __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
> > p = __getcpu();
> While we are touching this, can we please as a first step change __getcpu()
> to something else? I've tripped over this several times in the past and
> confused it with a (nonexisting) variant of get_cpu().
How about __vdso_get_cpudata()?
> > #ifdef CONFIG_NUMA
> > node = cpu_to_node(cpu);
> > #endif
> While at it please get rid of the ifdeffery. If CONFIG_NUMA=n then
> cpu_to_node(cpu) resolves to (0).
Okay, will fix this.
> >
> > if (cpu)
> > - *cpu = p & VGETCPU_CPU_MASK;
> > + *cpu = lsl_tscp_to_cpu(p);
> >
> > if (node)
> > - *node = p >> 12;
> > + *node = lsl_tscp_to_node(p);
>
> Are these new helpers going to be used at some other place than this? If
> not, then there is really no point at all. Then just go and make this:
>
> __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
> {
> vdso_read_cpu_and_node(cpu, node);
> return 0;
> }
> > @@ -340,19 +340,19 @@ static void vgetcpu_cpu_init(void *arg)
> > int cpu = smp_processor_id();
> > struct desc_struct d = { };
> > unsigned long node = 0;
> > + unsigned long cpu_number = 0;
>
> That's hardly a CPU number. It's encoded CPU and node information.
>
> > + cpu_number = make_lsl_tscp(cpu, node);
>
> So the whole thing can be reduced to:
>
> u64 cpudata = vdso_encode_cpu_and_node(cpu, cpu_to_node(cpu));
>
> Or some other sensible function name.
Now, for these helper function renaming, I would like to check it from Andy.
Thanks,
Chang
Powered by blists - more mailing lists