Skip to content

Commit

Permalink
Merge branch 'core/percpu' into x86/paravirt
Browse files Browse the repository at this point in the history
  • Loading branch information
H. Peter Anvin committed Feb 5, 2009
2 parents 1f4f931 + ef3892b commit 327641d
Show file tree
Hide file tree
Showing 68 changed files with 586 additions and 310 deletions.
6 changes: 3 additions & 3 deletions Documentation/block/biodoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -954,14 +954,14 @@ elevator_allow_merge_fn called whenever the block layer determines
results in some sort of conflict internally,
this hook allows it to do that.

elevator_dispatch_fn fills the dispatch queue with ready requests.
elevator_dispatch_fn* fills the dispatch queue with ready requests.
I/O schedulers are free to postpone requests by
not filling the dispatch queue unless @force
is non-zero. Once dispatched, I/O schedulers
are not allowed to manipulate the requests -
they belong to generic dispatch queue.

elevator_add_req_fn called to add a new request into the scheduler
elevator_add_req_fn* called to add a new request into the scheduler

elevator_queue_empty_fn returns true if the merge queue is empty.
Drivers shouldn't use this, but rather check
Expand Down Expand Up @@ -991,7 +991,7 @@ elevator_activate_req_fn Called when device driver first sees a request.
elevator_deactivate_req_fn Called when device driver decides to delay
a request by requeueing it.

elevator_init_fn
elevator_init_fn*
elevator_exit_fn Allocate and free any elevator specific storage
for a queue.

Expand Down
25 changes: 6 additions & 19 deletions Documentation/networking/alias.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
IP-Aliasing:
============

IP-aliases are additional IP-addresses/masks hooked up to a base
interface by adding a colon and a string when running ifconfig.
This string is usually numeric, but this is not a must.

IP-Aliases are avail if CONFIG_INET (`standard' IPv4 networking)
is configured in the kernel.
IP-aliases are an obsolete way to manage multiple IP-addresses/masks
per interface. Newer tools such as iproute2 support multiple
address/prefixes per interface, but aliases are still supported
for backwards compatibility.

An alias is formed by adding a colon and a string when running ifconfig.
This string is usually numeric, but this is not a must.

o Alias creation.
Alias creation is done by 'magic' interface naming: eg. to create a
Expand Down Expand Up @@ -38,16 +38,3 @@ o Relationship with main device

If the base device is shut down the added aliases will be deleted
too.


Contact
-------
Please finger or e-mail me:
Juan Jose Ciarlante <jjciarla@raiz.uncu.edu.ar>

Updated by Erik Schoenfelder <schoenfr@gaertner.DE>

; local variables:
; mode: indented-text
; mode: auto-fill
; end:
2 changes: 0 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2836,8 +2836,6 @@ S: Maintained
MAC80211
P: Johannes Berg
M: johannes@sipsolutions.net
P: Michael Wu
M: flamingice@sourmilk.net
L: linux-wireless@vger.kernel.org
W: http://linuxwireless.org/
T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,8 @@ extern int sysenter_setup(void);
extern struct desc_ptr early_gdt_descr;

extern void cpu_set_gdt(int);
extern void switch_to_new_gdt(void);
extern void switch_to_new_gdt(int);
extern void load_percpu_segment(int);
extern void cpu_init(void);

static inline unsigned long get_debugctlmsr(void)
Expand Down
25 changes: 15 additions & 10 deletions arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,28 @@ static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)

__u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata;

void load_percpu_segment(int cpu)
{
#ifdef CONFIG_X86_32
loadsegment(fs, __KERNEL_PERCPU);
#else
loadsegment(gs, 0);
wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu));
#endif
}

/* Current gdt points %fs at the "master" per-cpu area: after this,
* it's on the real one. */
void switch_to_new_gdt(void)
void switch_to_new_gdt(int cpu)
{
struct desc_ptr gdt_descr;
int cpu = smp_processor_id();

gdt_descr.address = (long)get_cpu_gdt_table(cpu);
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
/* Reload the per-cpu base */
#ifdef CONFIG_X86_32
loadsegment(fs, __KERNEL_PERCPU);
#else
loadsegment(gs, 0);
wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu));
#endif

load_percpu_segment(cpu);
}

static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {};
Expand Down Expand Up @@ -993,7 +998,7 @@ void __cpuinit cpu_init(void)
* and set up the GDT descriptor:
*/

switch_to_new_gdt();
switch_to_new_gdt(cpu);
loadsegment(fs, 0);

load_idt((const struct desc_ptr *)&idt_descr);
Expand Down Expand Up @@ -1098,7 +1103,7 @@ void __cpuinit cpu_init(void)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);

load_idt(&idt_descr);
switch_to_new_gdt();
switch_to_new_gdt(cpu);

/*
* Set up and load the per-CPU TSS and LDT
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void __init setup_per_cpu_areas(void)
* area. Reload any changed state for the boot CPU.
*/
if (cpu == boot_cpu_id)
switch_to_new_gdt();
switch_to_new_gdt(cpu);

DBG("PERCPU: cpu %4d %p\n", cpu, ptr);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
void __init native_smp_prepare_boot_cpu(void)
{
int me = smp_processor_id();
switch_to_new_gdt();
switch_to_new_gdt(me);
/* already set me in cpu_online_mask in boot_cpu_init() */
cpumask_set_cpu(me, cpu_callout_mask);
per_cpu(cpu_state, me) = CPU_ONLINE;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/tlb_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const struct cpumask *uv_flush_send_and_wait(int cpu, int this_blade,
* the cpu's, all of which are still in the mask.
*/
__get_cpu_var(ptcstats).ptc_i++;
return 0;
return flush_mask;
}

/*
Expand Down
5 changes: 3 additions & 2 deletions arch/x86/kernel/vmlinux_64.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PHDRS {
#ifdef CONFIG_SMP
percpu PT_LOAD FLAGS(7); /* RWE */
#endif
data.init2 PT_LOAD FLAGS(7); /* RWE */
note PT_NOTE FLAGS(0); /* ___ */
}
SECTIONS
Expand Down Expand Up @@ -215,7 +216,7 @@ SECTIONS
/*
* percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
* output PHDR, so the next output section - __data_nosave - should
* switch it back to data.init. Also, pda should be at the head of
* start another section data.init2. Also, pda should be at the head of
* percpu area. Preallocate it and define the percpu offset symbol
* so that it can be accessed as a percpu variable.
*/
Expand All @@ -232,7 +233,7 @@ SECTIONS
__nosave_begin = .;
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
*(.data.nosave)
} :data.init /* switch back to data.init, see PERCPU_VADDR() above */
} :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
. = ALIGN(PAGE_SIZE);
__nosave_end = .;

Expand Down
11 changes: 6 additions & 5 deletions arch/x86/mach-voyager/voyager_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,12 +1746,13 @@ static void __init voyager_smp_prepare_cpus(unsigned int max_cpus)

static void __cpuinit voyager_smp_prepare_boot_cpu(void)
{
switch_to_new_gdt();
int cpu = smp_processor_id();
switch_to_new_gdt(cpu);

cpu_set(smp_processor_id(), cpu_online_map);
cpu_set(smp_processor_id(), cpu_callout_map);
cpu_set(smp_processor_id(), cpu_possible_map);
cpu_set(smp_processor_id(), cpu_present_map);
cpu_set(cpu, cpu_online_map);
cpu_set(cpu, cpu_callout_map);
cpu_set(cpu, cpu_possible_map);
cpu_set(cpu, cpu_present_map);
}

static int __cpuinit voyager_cpu_up(unsigned int cpu)
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,9 @@ asmlinkage void __init xen_start_kernel(void)
have_vcpu_info_placement = 0;
#endif

/* setup percpu state */
load_percpu_segment(0);

xen_smp_init();

/* Get mfn list */
Expand Down
5 changes: 4 additions & 1 deletion arch/x86/xen/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ static void __init xen_smp_prepare_boot_cpu(void)

/* We've switched to the "real" per-cpu gdt, so make sure the
old memory can be recycled */
make_lowmem_page_readwrite(&per_cpu_var(gdt_page));
make_lowmem_page_readwrite(__per_cpu_load +
(unsigned long)&per_cpu_var(gdt_page));

xen_setup_vcpu_info_placement();
}
Expand Down Expand Up @@ -235,6 +236,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
ctxt->user_regs.ss = __KERNEL_DS;
#ifdef CONFIG_X86_32
ctxt->user_regs.fs = __KERNEL_PERCPU;
#else
ctxt->gs_base_kernel = per_cpu_offset(cpu);
#endif
ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle;
ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */
Expand Down
2 changes: 1 addition & 1 deletion block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void bio_end_empty_barrier(struct bio *bio, int err)
* Description:
* Issue a flush for the block device in question. Caller can supply
* room for storing the error offset in case of a flush error, if they
* wish to. Caller must run wait_for_completion() on its own.
* wish to.
*/
int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
{
Expand Down
Loading

0 comments on commit 327641d

Please sign in to comment.