All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: David Gibson <david@gibson.dropbear.id.au>,
	Andrew Morton <akpm@osdl.org>, Anton Blanchard <anton@samba.org>,
	Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org, linuxppc64-dev@lists.linuxppc.org
Subject: Re: [PPC64] Remove silly debug path from get_vsid()
Date: Thu, 27 May 2004 21:55:37 -0600	[thread overview]
Message-ID: <20040528035537.GT2603@schnapps.adilger.int> (raw)
In-Reply-To: <20040528031659.GC15922@zax>

On May 28, 2004  13:16 +1000, David Gibson wrote:
> This patch removes the test, replacing it with a compile time switch.
> It seems to make a measurable, although small speedup to the SLB miss
> path (maybe 0.5%).

Looking at include/asm-ppc64/ppcdebug.h the ifppcdebug() macro is defined:

#ifdef CONFIG_PPCDBG
#define ifppcdebug(FLAGS) if (udbg_ifdebug(FLAGS))
#else
#define ifppcdebug(...) if (0)
#endif

so presumably if you don't select CONFIG_PPCDBG it is also a no-op unless
the compiler is broken and doesn't optimize away "if (0)" stanzas.  The
original construct gives you the option to enable this particular debugging
at runtime (without necessarily enabling all debugging at one time) if wanted.

> Index: working-2.6/include/asm-ppc64/mmu_context.h
> ===================================================================
> --- working-2.6.orig/include/asm-ppc64/mmu_context.h	2004-05-20 12:58:51.000000000 +1000
> +++ working-2.6/include/asm-ppc64/mmu_context.h	2004-05-27 14:22:01.088506616 +1000
> @@ -189,15 +189,15 @@
>  	ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | (ea >> 60);
>  	vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK;
>  
> -	ifppcdebug(PPCDBG_HTABSTRESS) {
> -		/* For debug, this path creates a very poor vsid distribuition.
> -		 * A user program can access virtual addresses in the form
> -		 * 0x0yyyyxxxx000 where yyyy = xxxx to cause multiple mappings
> -		 * to hash to the same page table group.
> -		 */ 
> -		ordinal = ((ea >> 28) & 0x1fff) | (ea >> 44);
> -		vsid = ordinal & VSID_MASK;
> -	}
> +#ifdef HTABSTRESS
> +	/* For debug, this path creates a very poor vsid distribuition.
> +	 * A user program can access virtual addresses in the form
> +	 * 0x0yyyyxxxx000 where yyyy = xxxx to cause multiple mappings
> +	 * to hash to the same page table group.
> +	 */ 
> +	ordinal = ((ea >> 28) & 0x1fff) | (ea >> 44);
> +	vsid = ordinal & VSID_MASK;
> +#endif /* HTABSTRESS */
>  
>  	return vsid;
>  } 
> @@ -212,11 +212,11 @@
>  	ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | context;
>  	vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK;
>  
> -	ifppcdebug(PPCDBG_HTABSTRESS) {
> -		/* See comment above. */
> -		ordinal = ((ea >> 28) & 0x1fff) | (context << 16);
> -		vsid = ordinal & VSID_MASK;
> -	}
> +#ifdef HTABSTRESS
> +	/* See comment above. */
> +	ordinal = ((ea >> 28) & 0x1fff) | (context << 16);
> +	vsid = ordinal & VSID_MASK;
> +#endif /* HTABSTRESS */
>  
>  	return vsid;
>  }
> 
> -- 
> David Gibson			| For every complex problem there is a
> david AT gibson.dropbear.id.au	| solution which is simple, neat and
> 				| wrong.
> http://www.ozlabs.org/people/dgibson
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  reply	other threads:[~2004-05-28  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28  3:16 [PPC64] Remove silly debug path from get_vsid() David Gibson
2004-05-28  3:55 ` Andreas Dilger [this message]
2004-05-28  4:53   ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040528035537.GT2603@schnapps.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.