linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Cliff Wickman <cpw@sgi.com>
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86: UV BAU activation descriptor init
Date: Wed, 20 May 2009 10:33:50 +0200	[thread overview]
Message-ID: <20090520083350.GE6736@elte.hu> (raw)
In-Reply-To: <E1M6YCG-0002eM-1Z@eag09.americas.sgi.com>


* Cliff Wickman <cpw@sgi.com> wrote:

> From: Cliff Wickman <cpw@sgi.com>
> 
> The UV tlb shootdown code has a serious initialization error.
> 
> An array of structures [32*8] is initialized as if it were [32].
> The array is indexed by (cpu number on the blade)*8, so the short
> initialization works for up to 4 cpus on a blade.
> But above that, we provide an invalid opcode to the hub's
> broadcast assist unit.
> 
> This patch changes the allocation of the array to use its symbolic
> dimensions for better clarity. And initializes all 32*8 entries.
> 
> Tested on the UV simulator.
> 
> Diffed against 2.6.30-rc6
> 
> Signed-off-by: Cliff Wickman <cpw@sgi.com>
> 
> ---
>  arch/x86/kernel/tlb_uv.c |   18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> Index: linux/arch/x86/kernel/tlb_uv.c
> ===================================================================
> --- linux.orig/arch/x86/kernel/tlb_uv.c
> +++ linux/arch/x86/kernel/tlb_uv.c
> @@ -715,7 +715,14 @@ uv_activation_descriptor_init(int node, 
>  	struct bau_desc *adp;
>  	struct bau_desc *ad2;
>  
> -	adp = (struct bau_desc *)kmalloc_node(16384, GFP_KERNEL, node);
> +	/*
> +	 * each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR)
> +	 * per cpu; and up to 32 (UV_ACTIVATION_DESCRIPTOR_SIZE) cpu's
> +	 * per blade
> +	 */
> +	adp = (struct bau_desc *)kmalloc_node(sizeof(struct bau_desc)*
> +		UV_ACTIVATION_DESCRIPTOR_SIZE*UV_ITEMS_PER_DESCRIPTOR,
> +		GFP_KERNEL, node);
>  	BUG_ON(!adp);
>  
>  	pa = uv_gpa(adp); /* need the real nasid*/
> @@ -729,7 +736,14 @@ uv_activation_descriptor_init(int node, 
>  				      (n << UV_DESC_BASE_PNODE_SHIFT | m));
>  	}
>  
> -	for (i = 0, ad2 = adp; i < UV_ACTIVATION_DESCRIPTOR_SIZE; i++, ad2++) {
> +	/*
> +	 * initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each
> +	 * cpu even though we only use the first one; one descriptor can
> +	 * describe a broadcast to 256 nodes.
> +	 */
> +	for (i = 0, ad2 = adp;
> +		i < (UV_ACTIVATION_DESCRIPTOR_SIZE*UV_ITEMS_PER_DESCRIPTOR);
> +		i++, ad2++) {
>  		memset(ad2, 0, sizeof(struct bau_desc));
>  		ad2->header.sw_ack_flag = 1;
>  		/*

looks good but could you please define a shortcut for:

	UV_ACTIVATION_DESCRIPTOR_SIZE*UV_ITEMS_PER_DESCRIPTOR

because its length causes a lot of ugly linebreaks. Something like 
UV_ADP_SIZE should do the trick?

	Ingo

      reply	other threads:[~2009-05-20  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 22:54 [PATCH] x86: UV BAU activation descriptor init Cliff Wickman
2009-05-20  8:33 ` Ingo Molnar [this message]

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=20090520083350.GE6736@elte.hu \
    --to=mingo@elte.hu \
    --cc=cpw@sgi.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).