lkml.org 
[lkml]   [2012]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 04/31] x86/mm: Introduce pte_accessible()
NAK NAK NAK.

On Thu, Oct 25, 2012 at 5:16 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>
> +#define __HAVE_ARCH_PTE_ACCESSIBLE
> +static inline int pte_accessible(pte_t a)

Stop doing this f*cking crazy ad-hoc "I have some other name
available" #defines.

Use the same name, for chissake! Don't make up new random names.

Just do

#define pte_accessible pte_accessible

and then you can use

#ifndef pte_accessible

to define the generic thing. Instead of having this INSANE "two
different names for the same f*cking thing" crap.

Stop it. Really.

Also, this:

> +#ifndef __HAVE_ARCH_PTE_ACCESSIBLE
> +#define pte_accessible(pte) pte_present(pte)
> +#endif

looks unsafe and like a really bad idea.

You should probably do

#ifndef pte_accessible
#define pte_accessible(pte) ((void)(pte),1)
#endif

because you have no idea if other architectures do

(a) the same trick as x86 does for PROT_NONE (I can already tell you
from a quick grep that ia64, m32r, m68k and sh do it)
(b) might not perhaps be caching non-present pte's anyway

So NAK on this whole patch. It's bad. It's ugly, it's wrong, and it's
actively buggy.

Linus


\
 
 \ /
  Last update: 2012-10-25 22:41    [W:0.568 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site