RE: [PATCH V2 05/15] x86/vdso: Move out the CPU number store

From: Bae, Chang Seok
Date: Thu May 31 2018 - 17:07:08 EST


>> +/* Bit size and mask of CPU number stored in the per CPU data */
>> +#define PERCPU_CPU_SIZE 12
>> +#define PERCPU_CPU_MASK 0xfff

> This name is confusing. Maybe LSL_TSCP_CPU_MASK?

> Can you also add a helpers like:

> static inline unsigned long make_lsl_tscp(unsigned int cpu, unsigned
> int node) { ... }
> static inline unsigned int lsl_tscp_to_cpu(unsigned long x) { ... }
> static inline unsigned int lsl_tscp_to_node(unsigned long x) { ... }

> and use them everywhere? This will make it lot easier to understand the code.

Will rename and include the helpers as suggested.

> +#ifdef CONFIG_X86_32
> + GDT_ENTRY_PERCPU,
> +#else /* 64 bit */
> + GDT_ENTRY_PER_CPU,
> #endif

> Please just rename one of these to match the other one.

Okay, I will try.