linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@austin.ibm.com>
To: Milton Miller <miltonm@bga.com>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 2/16] xics: update default_server during migrate_irqs_away
Date: Mon, 13 Oct 2008 15:04:22 -0500	[thread overview]
Message-ID: <48F3A9C6.1010309@austin.ibm.com> (raw)
In-Reply-To: <patch-xics-2@bga.com>

Milton Miller wrote:
> Currently, every time we determine which irq server to use, we check if
> default_server, which is the id of the bootcpu, is still online.  But
> default_server is a hardware cpu, not the logical cpu id needed to index
> cpu_online_map.  
> 
> Since the default server can only go offline during a cpu hotplug event,
> explicitly check the default server and choose the new one when we move
> irqs away from the cpu being offlined.
> 
> This has the added benefit of only needing the boot_cpuid to be updated
> and not relying on the cpu being marked offline during migrate_irqs_away.
> 
> Also, since xics_update_irq_servers only reads device tree information, we
> can call it before xics_init_host in xics_init_IRQ and then default_server
> will always be valid when we can reach get_irq_server via the host ops.
> 
> Signed-off-by: Milton Miller <miltonm@bga.com>

Acked-by: Nathan Fontenot <nfont@austin.ibm.com>

> ---
> I realized the hard vs soft cpu id as I was writing the patch description.
> get_irq_server is called from unmask and set affinity.  
> 
> The effects of this bug would be the increased pathlength to walk the
> device tree in the unmask and set affinity methods, and possible failure
> to migrate irqs during cpu hotplug removal (not likely to be seen on
> until a sequence of remove and adds is performed).
> 
> This check dates to 2.6.25 via de0723dcca6e593a12a259798a54eb0e82628fb8.
> 
> Index: next.git/arch/powerpc/platforms/pseries/xics.c
> ===================================================================
> --- next.git.orig/arch/powerpc/platforms/pseries/xics.c	2008-10-04 16:36:07.000000000 -0500
> +++ next.git/arch/powerpc/platforms/pseries/xics.c	2008-10-04 16:36:09.000000000 -0500
> @@ -208,9 +208,6 @@ static int get_irq_server(unsigned int v
>  	cpumask_t cpumask = irq_desc[virq].affinity;
>  	cpumask_t tmp = CPU_MASK_NONE;
>  
> -	if (! cpu_isset(default_server, cpu_online_map))
> -		xics_update_irq_servers();
> -
>  	if (!distribute_irqs)
>  		return default_server;
>  
> @@ -685,8 +682,8 @@ void __init xics_init_IRQ(void)
>  	if (found == 0)
>  		return;
>  
> -	xics_init_host();
>  	xics_update_irq_servers();
> +	xics_init_host();
>  
>  	if (firmware_has_feature(FW_FEATURE_LPAR))
>  		ppc_md.get_irq = xics_get_irq_lpar;
> @@ -779,6 +776,10 @@ void xics_migrate_irqs_away(void)
>  	int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
>  	unsigned int irq, virq;
>  
> +	/* If we used to be the default server, move to the new "boot_cpuid" */
> +	if (hw_cpu == default_server)
> +		xics_update_irq_servers();
> +
>  	/* Reject any interrupt that was queued to us... */
>  	xics_set_cpu_priority(0);
>  

  reply	other threads:[~2008-10-13 20:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-10 11:56 [PATCH 00/16] xics and ipi cleanups for 2.6.28 Milton Miller
2008-10-10 11:56 ` [PATCH 1/16] powerpc pseries: eoi unmapped xics irqs after disable Milton Miller
2008-10-10 11:56 ` [PATCH 2/16] xics: update default_server during migrate_irqs_away Milton Miller
2008-10-13 20:04   ` Nathan Fontenot [this message]
2008-10-10 11:56 ` [PATCH 3/16] xics: consolidate ipi message encode and decode Milton Miller
2008-10-10 11:56 ` [PATCH 4/16] xics: rearrange file to group code by function Milton Miller
2008-10-10 11:56 ` [PATCH 5/16] xics: change arg type to remove casts Milton Miller
2008-10-10 11:56 ` [PATCH 6/16] xics: trim includes Milton Miller
2008-10-10 11:56 ` [PATCH 7/16] xics: initialization cleanups Milton Miller
2008-10-13  0:55   ` Benjamin Herrenschmidt
2008-10-10 11:56 ` [PATCH 8/16] xics: factor out giq set and unset Milton Miller
2008-10-10 11:56 ` [PATCH 9/16] powerpc: eoi xics ipi by hand in kexec Milton Miller
2008-10-10 11:56 ` [PATCH 11/16] powerpc: mark xics ipi percpu Milton Miller
2008-10-10 11:56 ` [PATCH 10/16] xics: make printk formats fit on one line Milton Miller
2008-10-10 11:56 ` [PATCH 12/16] powerpc: reduce and comment xics ipi memory barrier Milton Miller
2008-10-10 11:56 ` [PATCH 13/16] powerpc smp: no need to set_need_resched in resched ipi Milton Miller
2008-10-10 11:56   ` [PATCH 14/16] powerpc: expand vs demux ipi actions per message Milton Miller
2008-10-10 11:56     ` [PATCH 14/16] powerpc mpic: use smp_request_message_ipi Milton Miller
2008-10-10 11:56     ` [PATCH 15/16] powerpc cell: " Milton Miller
2008-10-10 11:56     ` [PATCH 16/16] powerpc ps3: " Milton Miller
2008-10-10 12:55     ` [PATCH 14/16] powerpc: expand vs demux ipi actions per message Geert Uytterhoeven
2008-10-21  1:37     ` [PATCH 14/16 v2] " Milton Miller
2008-11-06  4:42       ` Paul Mackerras
2008-11-11 16:12         ` Milton Miller
2008-10-13  5:28 ` [PATCH 00/16] xics and ipi cleanups for 2.6.28 Benjamin Herrenschmidt

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=48F3A9C6.1010309@austin.ibm.com \
    --to=nfont@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --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 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).