Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5388
b: refs/heads/master
c: 37a47e6
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Jul 29, 2005
1 parent d960a38 commit c4baf39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 87 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f68c1388ada34998c2902c289c6a6b625a73c4e
refs/heads/master: 37a47e65fa58d413a31f27ee88f6cb98583b6157
88 changes: 2 additions & 86 deletions trunk/arch/x86_64/kernel/genapic_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Hacked for x86-64 by James Cleverdon from i386 architecture code by
* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
* James Cleverdon.
* Ashok Raj <ashok.raj@intel.com>
* Removed IPI broadcast shortcut to support CPU hotplug
*/
#include <linux/config.h>
#include <linux/threads.h>
Expand All @@ -20,47 +18,6 @@
#include <asm/smp.h>
#include <asm/ipi.h>

/*
* The following permit choosing broadcast IPI shortcut v.s sending IPI only
* to online cpus via the send_IPI_mask varient.
* The mask version is my preferred option, since it eliminates a lot of
* other extra code that would need to be written to cleanup intrs sent
* to a CPU while offline.
*
* Sending broadcast introduces lots of trouble in CPU hotplug situations.
* These IPI's are delivered to cpu's irrespective of their offline status
* and could pickup stale intr data when these CPUS are turned online.
*
* Not using broadcast is a cleaner approach IMO, but Andi Kleen disagrees with
* the idea of not using broadcast IPI's anymore. Hence the run time check
* is introduced, on his request so we can choose an alternate mechanism.
*
* Initial wacky performance tests that collect cycle counts show
* no increase in using mask v.s broadcast version. In fact they seem
* identical in terms of cycle counts.
*
* if we need to use broadcast, we need to do the following.
*
* cli;
* hold call_lock;
* clear any pending IPI, just ack and clear all pending intr
* set cpu_online_map;
* release call_lock;
* sti;
*
* The complicated dummy irq processing shown above is not required if
* we didnt sent IPI's to wrong CPU's in the first place.
*
* - Ashok Raj <ashok.raj@intel.com>
*/
#ifdef CONFIG_HOTPLUG_CPU
#define DEFAULT_SEND_IPI (1)
#else
#define DEFAULT_SEND_IPI (0)
#endif

static int no_broadcast=DEFAULT_SEND_IPI;

static cpumask_t flat_target_cpus(void)
{
return cpu_online_map;
Expand Down Expand Up @@ -119,37 +76,15 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
local_irq_restore(flags);
}

static inline void __local_flat_send_IPI_allbutself(int vector)
{
if (no_broadcast) {
cpumask_t mask = cpu_online_map;
int this_cpu = get_cpu();

cpu_clear(this_cpu, mask);
flat_send_IPI_mask(mask, vector);
put_cpu();
}
else
__send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
}

static inline void __local_flat_send_IPI_all(int vector)
{
if (no_broadcast)
flat_send_IPI_mask(cpu_online_map, vector);
else
__send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
}

static void flat_send_IPI_allbutself(int vector)
{
if (((num_online_cpus()) - 1) >= 1)
__local_flat_send_IPI_allbutself(vector);
__send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
}

static void flat_send_IPI_all(int vector)
{
__local_flat_send_IPI_all(vector);
__send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
}

static int flat_apic_id_registered(void)
Expand All @@ -170,16 +105,6 @@ static unsigned int phys_pkg_id(int index_msb)
return ((ebx >> 24) & 0xFF) >> index_msb;
}

static __init int no_ipi_broadcast(char *str)
{
get_option(&str, &no_broadcast);
printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
"IPI Broadcast");
return 1;
}

__setup("no_ipi_broadcast", no_ipi_broadcast);

struct genapic apic_flat = {
.name = "flat",
.int_delivery_mode = dest_LowestPrio,
Expand All @@ -194,12 +119,3 @@ struct genapic apic_flat = {
.cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
.phys_pkg_id = phys_pkg_id,
};

static int __init print_ipi_mode(void)
{
printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" :
"Shortcut");
return 0;
}

late_initcall(print_ipi_mode);

0 comments on commit c4baf39

Please sign in to comment.