time.c integration
Subsystems (11)
Ingo, please pull the latest master git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/glommer/linux-2.6-x86-integration.git master
into your tree
It contains code to integrate time_32.c and time_64.c into time.c
Thanks!
Glauber
------------------>
Glauber Costa (22):
x86: use user_mode macro
x86: coalesce tests
x86: use frame pointer information on x86_64 profile_pc
x86: remove SEGMENT_IS_FLAT_CODE
x86: use user_mode_vm instead of user_mode
x86: bind irq0 irq data to cpu0
x86: factor out irq initialization for x86_64
x86: make init_ISA_irqs nonstatic
x86: rename timer_event_interrupt to timer_interrupt
x86: allow x86_64 to build with subarch support
x86: replace ISA initialization function
x86: use generic intr_init call
x86: use time_init_hook in time_64.c
x86: use generic time hook
x86: replace hardcoded number
x86: assign timer_ack variable
x86: wrap MCA_bus test around an ifdef
x86: wrap conditional inside ifdef at profile_pc
x86: fix checkpatch errors
x86: move vgetcpu mode probing to cpu detection
x86: add pre_time_init_hooks to x86_64 time initialization
x86: integrate time.c
arch/x86/Makefile | 4 -
arch/x86/kernel/Makefile | 2 +-
arch/x86/kernel/acpi/cstate.c | 3 +-
arch/x86/kernel/cpu/common_64.c | 9 ++
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 10 ++-
arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 15 ++-
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | 12 ++-
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c | 3 +-
arch/x86/kernel/cpu/intel_cacheinfo.c | 3 +-
arch/x86/kernel/io_apic_64.c | 6 +-
arch/x86/kernel/irqinit_64.c | 59 +++++-----
arch/x86/kernel/ldt.c | 6 +-
arch/x86/kernel/microcode.c | 17 ++-
arch/x86/kernel/reboot.c | 11 ++-
arch/x86/kernel/setup_percpu.c | 21 ++++
arch/x86/kernel/{time_32.c => time.c} | 66 +++++++++++-
arch/x86/kernel/time_64.c | 126 ----------------------
drivers/acpi/processor_throttling.c | 11 ++-
drivers/char/pcmcia/ipwireless/hardware.c | 2 +-
drivers/firmware/dcdbas.c | 3 +-
drivers/misc/sgi-xp/xpc_main.c | 3 +-
include/asm-x86/segment.h | 6 -
include/linux/cpumask.h | 63 +++++++----
kernel/cpu.c | 25 -----
kernel/time/tick-common.c | 8 +-
kernel/trace/trace_sysprof.c | 4 +-
lib/smp_processor_id.c | 5 +-
net/sunrpc/svc.c | 3 +-
28 files changed, 247 insertions(+), 259 deletions(-)
rename arch/x86/kernel/{time_32.c => time.c} (70%)
delete mode 100644 arch/x86/kernel/time_64.carch/x86/Makefile +0 -4
@@ -121,10 +121,6 @@ mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default/ # default subarch .h files mflags-y += -Iinclude/asm-x86/mach-default -# 64 bit does not support subarch support - clear sub arch variables -fcore-$(CONFIG_X86_64) := -mcore-$(CONFIG_X86_64) := - KBUILD_CFLAGS += $(mflags-y) KBUILD_AFLAGS += $(mflags-y)
arch/x86/kernel/Makefile +1 -1
@@ -24,7 +24,7 @@ CFLAGS_tsc.o := $(nostackp) obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o obj-y += traps_$(BITS).o irq_$(BITS).o -obj-y += time_$(BITS).o ioport.o ldt.o +obj-y += time.o ioport.o ldt.o obj-y += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o obj-$(CONFIG_X86_VISWS) += visws_quirks.o obj-$(CONFIG_X86_32) += probe_roms_32.o
arch/x86/kernel/acpi/cstate.c +2 -1
@@ -73,6 +73,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,struct cpuinfo_x86 *c = &cpu_data (cpu);cpumask_t saved_mask; +cpumask_of_cpu_ptr (new_mask, cpu);int retval;unsigned int eax, ebx, ecx, edx;unsigned int edx_part;
@@ -91,7 +92,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,/* Make sure we are running on right CPU */ saved_mask = current->cpus_allowed; - retval =set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); + retval =set_cpus_allowed_ptr (current, new_mask);if (retval)return -1 ;
arch/x86/kernel/cpu/common_64.c +9 -0
@@ -375,9 +375,18 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) } +static void vgetcpu_set_mode (void ) +{ +if (cpu_has (&boot_cpu_data,X86_FEATURE_RDTSCP )) + vgetcpu_mode =VGETCPU_RDTSCP ; +else + vgetcpu_mode =VGETCPU_LSL ; +} +void __cpuinit identify_boot_cpu (void ) {identify_cpu (&boot_cpu_data); +vgetcpu_set_mode (); }void __cpuinit identify_secondary_cpu (struct cpuinfo_x86 *c)
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +7 -3
@@ -200,10 +200,12 @@ static void drv_read(struct drv_cmd *cmd)static void drv_write (struct drv_cmd *cmd) {cpumask_t saved_mask = current->cpus_allowed; +cpumask_of_cpu_ptr_declare (cpu_mask);unsigned int i;for_each_cpu_mask_nr (i, cmd->mask) { -set_cpus_allowed_ptr (current, &cpumask_of_cpu (i)); +cpumask_of_cpu_ptr_next (cpu_mask, i); +set_cpus_allowed_ptr (current, cpu_mask);do_drv_write (cmd); }
@@ -267,11 +269,12 @@ static unsigned int get_measured_perf(unsigned int cpu) } aperf_cur, mperf_cur;cpumask_t saved_mask; +cpumask_of_cpu_ptr (cpu_mask, cpu);unsigned int perf_percent;unsigned int retval; saved_mask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, cpu_mask);if (get_cpu () != cpu) {/* We were not able to run on requested processor */ put_cpu ();
@@ -337,6 +340,7 @@ static unsigned int get_measured_perf(unsigned int cpu)static unsigned int get_cur_freq_on_cpu (unsigned int cpu) { +cpumask_of_cpu_ptr (cpu_mask, cpu);struct acpi_cpufreq_data *data =per_cpu (drv_data, cpu);unsigned int freq;unsigned int cached_freq;
@@ -349,7 +353,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) } cached_freq = data->freq_table[data->acpi_data->state].frequency; - freq =extract_freq (get_cur_val (&cpumask_of_cpu (cpu)), data); + freq =extract_freq (get_cur_val (cpu_mask), data);if (freq != cached_freq) {/* * The dreaded BIOS frequency change behind our back.
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +10 -5
@@ -479,11 +479,12 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvistatic int check_supported_cpu (unsigned int cpu) {cpumask_t oldmask; +cpumask_of_cpu_ptr (cpu_mask, cpu);u32 eax, ebx, ecx, edx;unsigned int rc =0 ; oldmask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, cpu_mask);if (smp_processor_id () != cpu) { printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
@@ -1016,6 +1017,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned istatic int powernowk8_target (struct cpufreq_policy *pol,unsigned targfreq,unsigned relation) {cpumask_t oldmask; +cpumask_of_cpu_ptr (cpu_mask, pol->cpu);struct powernow_k8_data *data =per_cpu (powernow_data, pol->cpu);u32 checkfid;u32 checkvid;
@@ -1030,7 +1032,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi/* only run on specific CPU from here on */ oldmask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (pol->cpu)); +set_cpus_allowed_ptr (current, cpu_mask);if (smp_processor_id () != pol->cpu) { printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1105,6 +1107,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) {struct powernow_k8_data *data;cpumask_t oldmask; +cpumask_of_cpu_ptr_declare (newmask);int rc;if (!cpu_online (pol->cpu))
@@ -1156,7 +1159,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)/* only run on specific CPU from here on */ oldmask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (pol->cpu)); +cpumask_of_cpu_ptr_next (newmask, pol->cpu); +set_cpus_allowed_ptr (current, newmask);if (smp_processor_id () != pol->cpu) { printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1178,7 +1182,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)set_cpus_allowed_ptr (current, &oldmask);if (cpu_family ==CPU_HW_PSTATE ) - pol->cpus =cpumask_of_cpu (pol->cpu); + pol->cpus = *newmask;else pol->cpus =per_cpu (cpu_core_map, pol->cpu); data->available_cores = &(pol->cpus);
@@ -1244,6 +1248,7 @@ static unsigned int powernowk8_get (unsigned int cpu) {struct powernow_k8_data *data;cpumask_t oldmask = current->cpus_allowed; +cpumask_of_cpu_ptr (newmask, cpu);unsigned int khz =0 ;unsigned int first;
@@ -1253,7 +1258,7 @@ static unsigned int powernowk8_get (unsigned int cpu)if (!data)return -EINVAL ; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, newmask);if (smp_processor_id () != cpu) { printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c +8 -4
@@ -324,9 +324,10 @@ static unsigned int get_cur_freq(unsigned int cpu)unsigned l, h;unsigned clock_freq;cpumask_t saved_mask; +cpumask_of_cpu_ptr (new_mask, cpu); saved_mask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, new_mask);if (smp_processor_id () != cpu)return 0 ;
@@ -584,12 +585,15 @@ static int centrino_target (struct cpufreq_policy *policy,* Best effort undo.. */ -if (!cpus_empty (*covered_cpus)) +if (!cpus_empty (*covered_cpus)) { +cpumask_of_cpu_ptr_declare (new_mask); +for_each_cpu_mask_nr (j, *covered_cpus) { -set_cpus_allowed_ptr (current, - &cpumask_of_cpu (j)); +cpumask_of_cpu_ptr_next (new_mask, j); +set_cpus_allowed_ptr (current, new_mask);wrmsr (MSR_IA32_PERF_CTL , oldmsr, h); } + } tmp = freqs.new; freqs.new = freqs.old;
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c +2 -1
@@ -244,7 +244,8 @@ static unsigned int _speedstep_get(const cpumask_t *cpus)static unsigned int speedstep_get (unsigned int cpu) { -return _speedstep_get (&cpumask_of_cpu (cpu)); +cpumask_of_cpu_ptr (newmask, cpu); +return _speedstep_get (newmask); }/**
arch/x86/kernel/cpu/intel_cacheinfo.c +2 -1
@@ -516,6 +516,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)unsigned long j;int retval;cpumask_t oldmask; +cpumask_of_cpu_ptr (newmask, cpu);if (num_cache_leaves ==0 )return -ENOENT ;
@@ -526,7 +527,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)return -ENOMEM ; oldmask = current->cpus_allowed; - retval =set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); + retval =set_cpus_allowed_ptr (current, newmask);if (retval) goto out;
arch/x86/kernel/io_apic_64.c +5 -1
@@ -49,6 +49,7 @@#include <asm/nmi.h> #include <asm/msidef.h> #include <asm/hypertransport.h> +#include <asm/timer.h> #include <mach_ipi.h> #include <mach_apic.h>
@@ -91,7 +92,7 @@ char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE};int sis_apic_bug;/* not actually supported, dummy for compile */ -static int no_timer_check; +int no_timer_check;static int disable_timer_pin_1__initdata ;
@@ -1689,6 +1690,7 @@ static inline void __init check_timer(void)*/ apic_write (APIC_LVT0 ,APIC_LVT_MASKED |APIC_DM_EXTINT );init_8259A (1 ); + timer_ack = (nmi_watchdog ==NMI_IO_APIC && !APIC_INTEGRATED (ver)); pin1 =find_isa_irq_pin (0 , mp_INT); apic1 =find_isa_irq_apic (0 , mp_INT);
@@ -1767,6 +1769,8 @@ static inline void __init check_timer(void)apic_printk (APIC_QUIET ,KERN_INFO "....... failed.\n" ); } + timer_ack = (nmi_watchdog ==NMI_IO_APIC && !APIC_INTEGRATED (ver)); +if (nmi_watchdog ==NMI_IO_APIC ) {apic_printk (APIC_QUIET ,KERN_WARNING "timer doesn't work " "through the IO-APIC - disabling NMI Watchdog!\n" );
arch/x86/kernel/irqinit_64.c +29 -30
95 lines not on this page · raw message
arch/x86/kernel/ldt.c +4 -2
@@ -62,10 +62,12 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)if (reload) {#ifdef CONFIG_SMP +cpumask_of_cpu_ptr_declare (mask); +preempt_disable ();load_LDT (pc); -if (!cpus_equal (current->mm->cpu_vm_mask, -cpumask_of_cpu (smp_processor_id ()))) +cpumask_of_cpu_ptr_next (mask,smp_processor_id ()); +if (!cpus_equal (current->mm->cpu_vm_mask, *mask))smp_call_function (flush_ldt, current->mm,1 );preempt_enable ();#else
arch/x86/kernel/microcode.c +12 -5
@@ -388,6 +388,7 @@ static int do_microcode_update (void)void *new_mc =NULL ;int cpu;cpumask_t old; +cpumask_of_cpu_ptr_declare (newmask); old = current->cpus_allowed;
@@ -404,7 +405,8 @@ static int do_microcode_update (void)if (!uci->valid)continue ; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +cpumask_of_cpu_ptr_next (newmask, cpu); +set_cpus_allowed_ptr (current, newmask); error =get_maching_microcode (new_mc, cpu);if (error <0 ) goto out;
@@ -574,6 +576,7 @@ static int apply_microcode_check_cpu(int cpu)struct cpuinfo_x86 *c = &cpu_data (cpu);struct ucode_cpu_info *uci = ucode_cpu_info + cpu;cpumask_t old; +cpumask_of_cpu_ptr (newmask, cpu);unsigned int val[2 ];int err =0 ;
@@ -582,7 +585,7 @@ static int apply_microcode_check_cpu(int cpu)return 0 ; old = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, newmask);/* Check if the microcode we have in memory matches the CPU */ if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 ||
@@ -620,11 +623,12 @@ static int apply_microcode_check_cpu(int cpu)static void microcode_init_cpu (int cpu,int resume) {cpumask_t old; +cpumask_of_cpu_ptr (newmask, cpu);struct ucode_cpu_info *uci = ucode_cpu_info + cpu; old = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, newmask);mutex_lock (µcode_mutex);collect_cpu_info (cpu);if (uci->valid && system_state ==SYSTEM_RUNNING && !resume)
@@ -657,10 +661,13 @@ static ssize_t reload_store(struct sys_device *dev,if (end == buf)return -EINVAL ;if (val ==1 ) { -cpumask_t old = current->cpus_allowed; +cpumask_t old; +cpumask_of_cpu_ptr (newmask, cpu); + + old = current->cpus_allowed;get_online_cpus (); -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +set_cpus_allowed_ptr (current, newmask);mutex_lock (µcode_mutex);if (uci->valid)
arch/x86/kernel/reboot.c +8 -3
@@ -414,20 +414,25 @@ void native_machine_shutdown(void)/* The boot cpu is always logical cpu 0 */ int reboot_cpu_id =0 ; +cpumask_of_cpu_ptr (newmask, reboot_cpu_id);#ifdef CONFIG_X86_32 /* See if there has been given a command line override */ if ((reboot_cpu !=-1 ) && (reboot_cpu <NR_CPUS ) && -cpu_online (reboot_cpu)) +cpu_online (reboot_cpu)) { reboot_cpu_id = reboot_cpu; +cpumask_of_cpu_ptr_next (newmask, reboot_cpu_id); + }#endif /* Make certain the cpu I'm about to reboot on is online */ -if (!cpu_online (reboot_cpu_id)) +if (!cpu_online (reboot_cpu_id)) { reboot_cpu_id =smp_processor_id (); +cpumask_of_cpu_ptr_next (newmask, reboot_cpu_id); + }/* Make certain I only run on the appropriate processor */ -set_cpus_allowed_ptr (current, &cpumask_of_cpu (reboot_cpu_id)); +set_cpus_allowed_ptr (current, newmask);/* O.K Now that I'm on the appropriate processor, * stop all of the others.
arch/x86/kernel/setup_percpu.c +21 -0
@@ -80,6 +80,24 @@ static void __init setup_per_cpu_maps(void)#endif } +#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP +cpumask_t *cpumask_of_cpu_map__read_mostly ; +EXPORT_SYMBOL (cpumask_of_cpu_map); + +/* requires nr_cpu_ids to be initialized */ +static void __init setup_cpumask_of_cpu (void ) +{ +int i; + +/* alloc_bootmem zeroes memory */ + cpumask_of_cpu_map =alloc_bootmem_low (sizeof (cpumask_t) * nr_cpu_ids); +for (i =0 ; i < nr_cpu_ids; i++) +cpu_set (i, cpumask_of_cpu_map[i]); +} +#else +static inline void setup_cpumask_of_cpu (void ) { } +#endif +#ifdef CONFIG_X86_32 /* * Great future not-so-futuristic plan: make i386 and x86_64 do it
@@ -179,6 +197,9 @@ void __init setup_per_cpu_areas(void)/* Setup node to cpumask map */ setup_node_to_cpumask_map (); + +/* Setup cpumask_of_cpu map */ + setup_cpumask_of_cpu(); }#endif
arch/x86/kernel/time.c renamed from arch/x86/kernel/time_32.c +61 -5
103 lines not on this page · raw message
arch/x86/kernel/time_64.c deleted +0 -126
126 lines not on this page · raw message
drivers/acpi/processor_throttling.c +8 -3
@@ -827,6 +827,7 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)static int acpi_processor_get_throttling (struct acpi_processor *pr) {cpumask_t saved_mask; +cpumask_of_cpu_ptr_declare (new_mask);int ret;if (!pr)
@@ -838,7 +839,8 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)* Migrate task to the cpu pointed by pr. */ saved_mask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (pr->id)); +cpumask_of_cpu_ptr_next (new_mask, pr->id); +set_cpus_allowed_ptr (current, new_mask); ret = pr->throttling.acpi_processor_get_throttling (pr);/* restore the previous state */ set_cpus_allowed_ptr (current, &saved_mask);
@@ -987,6 +989,7 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,int acpi_processor_set_throttling (struct acpi_processor *pr,int state) {cpumask_t saved_mask; +cpumask_of_cpu_ptr_declare (new_mask);int ret =0 ;unsigned int i;struct acpi_processor *match_pr;
@@ -1025,7 +1028,8 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)* it can be called only for the cpu pointed by pr. */ if (p_throttling->shared_type ==DOMAIN_COORD_TYPE_SW_ANY ) { -set_cpus_allowed_ptr (current, &cpumask_of_cpu (pr->id)); +cpumask_of_cpu_ptr_next (new_mask, pr->id); +set_cpus_allowed_ptr (current, new_mask); ret = p_throttling->acpi_processor_set_throttling (pr, t_state.target_state); }else {
@@ -1056,7 +1060,8 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)continue ; } t_state.cpu = i; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (i)); +cpumask_of_cpu_ptr_next (new_mask, i); +set_cpus_allowed_ptr (current, new_mask); ret = match_pr->throttling.acpi_processor_set_throttling ( match_pr, t_state.target_state);
drivers/char/pcmcia/ipwireless/hardware.c +1 -1
@@ -568,7 +568,7 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,list_del (&packet->queue); }else {const int min_capacity = -ipwireless_ppp_mru (hw->network) +2 ; +ipwireless_ppp_mru (hw->network +2 );int new_capacity;spin_unlock_irqrestore (&hw->lock, flags);
drivers/firmware/dcdbas.c +2 -1
@@ -245,6 +245,7 @@ static ssize_t host_control_on_shutdown_store(struct device *dev,static int smi_request (struct smi_cmd *smi_cmd) {cpumask_t old_mask; +cpumask_of_cpu_ptr (new_mask,0 );int ret =0 ;if (smi_cmd->magic !=SMI_CMD_MAGIC ) {
@@ -255,7 +256,7 @@ static int smi_request(struct smi_cmd *smi_cmd)/* SMI requires CPU 0 */ old_mask = current->cpus_allowed; -set_cpus_allowed_ptr (current, &cpumask_of_cpu (0 )); +set_cpus_allowed_ptr (current, new_mask);if (smp_processor_id () !=0 ) {dev_dbg (&dcdbas_pdev->dev,"%s: failed to get CPU 0\n" , __func__);
drivers/misc/sgi-xp/xpc_main.c +2 -1
@@ -229,10 +229,11 @@ xpc_hb_checker(void *ignore)int last_IRQ_count =0 ;int new_IRQ_count;int force_IRQ =0 ; +cpumask_of_cpu_ptr (cpumask,XPC_HB_CHECK_CPU );/* this thread was marked active by xpc_hb_init() */ -set_cpus_allowed_ptr (current, &cpumask_of_cpu (XPC_HB_CHECK_CPU )); +set_cpus_allowed_ptr (current, cpumask);/* set our heartbeating to other partitions into motion */ xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval *HZ );
include/asm-x86/segment.h +0 -6
@@ -131,12 +131,6 @@* Matching rules for certain types of segments. */ -/* Matches only __KERNEL_CS, ignoring PnP / USER / APM segments */ -#define SEGMENT_IS_KERNEL_CODE (x) (((x) & 0xfc) == GDT_ENTRY_KERNEL_CS * 8) - -/* Matches __KERNEL_CS and __USER_CS (they must be 2 entries apart) */ -#define SEGMENT_IS_FLAT_CODE (x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8) -/* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */ #define SEGMENT_IS_PNP_CODE (x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8)
include/linux/cpumask.h +39 -24
76 lines not on this page · raw message
kernel/cpu.c +0 -25
@@ -455,28 +455,3 @@ out:#endif /* CONFIG_PM_SLEEP_SMP */ #endif /* CONFIG_SMP */ - -/* -* cpu_bit_bitmap[] is a special, "compressed" data structure that -* represents all NR_CPUS bits binary values of 1<<nr. -* -* It is used by cpumask_of_cpu() to get a constant address to a CPU -* mask value that has a single bit set only. -*/ - -/* cpu_bit_bitmap[0] is empty - so we can back into it */ -#define MASK_DECLARE_1 (x) [x+1][0] = 1UL << (x) -#define MASK_DECLARE_2 (x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1) -#define MASK_DECLARE_4 (x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2) -#define MASK_DECLARE_8 (x) MASK_DECLARE_4(x), MASK_DECLARE_4(x+4) - -const unsigned long cpu_bit_bitmap[BITS_PER_LONG +1 ][BITS_TO_LONGS (NR_CPUS )] = { - -MASK_DECLARE_8 (0 ),MASK_DECLARE_8 (8 ), -MASK_DECLARE_8 (16 ),MASK_DECLARE_8 (24 ), -#if BITS_PER_LONG > 32 -MASK_DECLARE_8 (32 ),MASK_DECLARE_8 (40 ), -MASK_DECLARE_8 (48 ),MASK_DECLARE_8 (56 ), -#endif -}; -EXPORT_SYMBOL_GPL (cpu_bit_bitmap);
kernel/time/tick-common.c +5 -3
@@ -196,10 +196,12 @@ static int tick_check_new_device(struct clock_event_device *newdev)struct tick_device *td;int cpu, ret =NOTIFY_OK ;unsigned long flags; +cpumask_of_cpu_ptr_declare (cpumask);spin_lock_irqsave (&tick_device_lock, flags); cpu =smp_processor_id (); +cpumask_of_cpu_ptr_next (cpumask, cpu);if (!cpu_isset (cpu, newdev->cpumask)) goto out_bc;
@@ -207,7 +209,7 @@ static int tick_check_new_device(struct clock_event_device *newdev) curdev = td->evtdev;/* cpu local device ? */ -if (!cpus_equal (newdev->cpumask,cpumask_of_cpu (cpu))) { +if (!cpus_equal (newdev->cpumask, *cpumask)) {/* * If the cpu affinity of the device interrupt can not
@@ -220,7 +222,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)* If we have a cpu local device already, do not replace it * by a non cpu local device */ -if (curdev &&cpus_equal (curdev->cpumask,cpumask_of_cpu (cpu))) +if (curdev &&cpus_equal (curdev->cpumask, *cpumask)) goto out_bc; }
@@ -252,7 +254,7 @@ static int tick_check_new_device(struct clock_event_device *newdev) curdev =NULL ; }clockevents_exchange_device (curdev, newdev); -tick_setup_device (td, newdev, cpu, &cpumask_of_cpu (cpu)); +tick_setup_device (td, newdev, cpu, cpumask);if (newdev->features &CLOCK_EVT_FEAT_ONESHOT )tick_oneshot_notify ();
kernel/trace/trace_sysprof.c +3 -1
@@ -213,7 +213,9 @@ static void start_stack_timers(void)int cpu;for_each_online_cpu (cpu) { -set_cpus_allowed_ptr (current, &cpumask_of_cpu (cpu)); +cpumask_of_cpu_ptr (new_mask, cpu); + +set_cpus_allowed_ptr (current, new_mask);start_stack_timer (cpu); }set_cpus_allowed_ptr (current, &saved_mask);
lib/smp_processor_id.c +4 -1
@@ -11,6 +11,7 @@ notrace unsigned int debug_smp_processor_id(void) {unsigned long preempt_count =preempt_count ();int this_cpu =raw_smp_processor_id (); +cpumask_of_cpu_ptr_declare (this_mask);if (likely (preempt_count)) goto out;
@@ -22,7 +23,9 @@ notrace unsigned int debug_smp_processor_id(void)* Kernel threads bound to a single CPU can safely use * smp_processor_id(): */ -if (cpus_equal (current->cpus_allowed,cpumask_of_cpu (this_cpu))) +cpumask_of_cpu_ptr_next (this_mask, this_cpu); + +if (cpus_equal (current->cpus_allowed, *this_mask)) goto out;/*
net/sunrpc/svc.c +2 -1
@@ -310,7 +310,8 @@ svc_pool_map_set_cpumask(struct task_struct *task, unsigned int pidx)switch (m->mode) {case SVC_POOL_PERCPU : { -set_cpus_allowed_ptr (task, &cpumask_of_cpu (node)); +cpumask_of_cpu_ptr (cpumask, node); +set_cpus_allowed_ptr (task, cpumask);break ; }case SVC_POOL_PERNODE :
Quoted 8 lines · Glauber Costa
Ingo, please pull the latest master git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/glommer/linux-2.6-x86-integration.gitmasterinto your tree
It contains code to integrate
time_32.candtime_64.cintotime.c
btw., this diffstat initially scared me:
Quoted 23 lines
arch/x86/Makefile | 4 -
arch/x86/kernel/Makefile | 2 +-
arch/x86/kernel/acpi/cstate.c | 3 +-
arch/x86/kernel/cpu/common_64.c | 9 ++
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 10 ++-
arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 15 ++-
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | 12 ++-
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c | 3 +-
arch/x86/kernel/cpu/intel_cacheinfo.c | 3 +-
arch/x86/kernel/io_apic_64.c | 6 +-
arch/x86/kernel/irqinit_64.c | 59 +++++-----
arch/x86/kernel/ldt.c | 6 +-
arch/x86/kernel/microcode.c | 17 ++-
arch/x86/kernel/reboot.c | 11 ++-
arch/x86/kernel/setup_percpu.c | 21 ++++
arch/x86/kernel/{time_32.c => time.c} | 66 +++++++++++-
arch/x86/kernel/time_64.c | 126 ----------------------
drivers/acpi/processor_throttling.c | 11 ++-
drivers/char/pcmcia/ipwireless/hardware.c | 2 +-
drivers/firmware/dcdbas.c | 3 +-
drivers/misc/sgi-xp/xpc_main.c | 3 +-
include/asm-x86/segment.h | 6 -
include/linux/cpumask.h | 63 +++++++----Quoted 8 lines
kernel/cpu.c | 25 -----
kernel/time/tick-common.c | 8 +-
kernel/trace/trace_sysprof.c | 4 +-
lib/smp_processor_id.c | 5 +-
net/sunrpc/svc.c | 3 +-
28 files changed, 247 insertions(+), 259 deletions(-)
rename arch/x86/kernel/{time_32.c => time.c} (70%)
delete mode 100644 arch/x86/kernel/time_64.cbut what i pulled looked a lot saner:
arch/x86/Makefile | 4 - arch/x86/kernel/Makefile | 2 +- arch/x86/kernel/cpu/common_64.c | 9 ++ arch/x86/kernel/io_apic_64.c | 6 +- arch/x86/kernel/irqinit_64.c | 59 ++++++------ arch/x86/kernel/time.c | 191 +++++++++++++++++++++++++++++++++++++++ arch/x86/kernel/time_32.c | 135 --------------------------- arch/x86/kernel/time_64.c | 126 -------------------------- include/asm-x86/segment.h | 6 -- 9 files changed, 235 insertions(+), 303 deletions(-)
why the discrepancy?
another thing is, the integration commit itself is not done correctly. You change both time_32.c and time_64.c while unifying them. The proper way to unify is to change both files _prior_ the unification, to make them bit for bit identical, _then_ rename them in one mechanic move that cannot break anything.
that way things like the thing below wouldnt need laborous slice & compare but would be obvious: for example you've removed copyright notices from time_64.c. Please dont do that - keep the unification of all copyrights in the new time.c.
Also, please do smaller steps while bringing both time_32.c and time_64.c up into their final forms (and do it in multiple commits), and make sure each step compiles on their respective defconfig. time.c details are historically fragile, i'd not be surprised if this series was the target of bisection efforts.
Ingo
x86/kernel/time.c renamed from time_64.c +116 -64
@@ -1,81 +1,50 @@/* -* "High Precision Event Timer" based timekeeping. +* Copyright (C) 1991, 1992, 1995 Linus Torvalds * -* Copyright (c) 1991,1992,1995 Linus Torvalds -* Copyright (c) 1994 Alan Modra -* Copyright (c) 1995 Markus Kuhn -* Copyright (c) 1996 Ingo Molnar -* Copyright (c) 1998 Andrea Arcangeli -* Copyright (c) 2002,2006 Vojtech Pavlik -* Copyright (c) 2003 Andi Kleen -* RTC support code taken from arch/i386/kernel/timers/time_hpet.c +* This file contains the PC-specific time handling details: +* reading the RTC at bootup, etc.. +* 1994-07-02 Alan Modra +* fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime +* 1995-03-26 Markus Kuhn +* fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887 +* precision CMOS clock update +* 1996-05-03 Ingo Molnar +* fixed time warps in do_[slow|fast]_gettimeoffset() +* 1997-09-10 Updated NTP code according to technical memorandum Jan '96 +* "A Kernel Model for Precision Timekeeping" by Dave Mills +* 1998-09-05 (Various) +* More robust do_fast_gettimeoffset() algorithm implemented +* (works with APM, Cyrix 6x86MX and Centaur C6), +* monotonic gettimeofday() with fast_get_timeoffset(), +* drift-proof precision TSC calibration on boot +* (C. Scott Ananian <[email protected]>, Andrew D. +* Balsa <[email protected]>, Philip Gladstone <[email protected]>; +* ported from 2.0.35 Jumbo-9 by Michael Krause <[email protected]>). +* 1998-12-16 Andrea Arcangeli +* Fixed Jumbo-9 code in 2.1.131: do_gettimeofday was missing 1 jiffy +* because was not accounting lost_ticks. +* 1998-12-24 Copyright (C) 1998 Andrea Arcangeli +* Fixed a xtime SMP race (we need the xtime_lock rw spinlock to +* serialize accesses to xtime/lost_ticks). */ -#include <linux/clockchips.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <linux/module.h> #include <linux/time.h> +#include <linux/mca.h> -#include <asm/i8253.h> +#include <asm/arch_hooks.h> #include <asm/hpet.h> -#include <asm/nmi.h> -#include <asm/vgtod.h> #include <asm/time.h> +#include <asm/nmi.h> #include <asm/timer.h> -#include <asm/arch_hooks.h> #include "do_timer.h" -volatile unsigned long __jiffies __section_jiffies =INITIAL_JIFFIES ;int timer_ack; -unsigned long profile_pc (struct pt_regs *regs) -{ -unsigned long pc =instruction_pointer (regs); - -#ifdef CONFIG_SMP -/* Assume the lock function has either no stack frame or a copy -of flags from PUSHF -Eflags always has bits 22 and up cleared unlike kernel addresses. */ -if (!user_mode_vm (regs) &&in_lock_functions (pc)) { -#ifdef CONFIG_FRAME_POINTER -return *(unsigned long *)(regs->bp +sizeof (long )); -#endif -unsigned long *sp = (unsigned long *)regs->sp; -if (sp[0 ] >>22 ) -return sp[0 ]; -if (sp[1 ] >>22 ) -return sp[1 ]; - } -#endif -return pc; -} -EXPORT_SYMBOL (profile_pc); - -irqreturn_t timer_interrupt (int irq,void *dev_id) -{ -add_pda (irq0_irqs,1 ); - -#ifdef CONFIG_X86_IO_APIC -if (timer_ack) { -spin_lock (&i8259A_lock); -outb (0x0c ,PIC_MASTER_OCW3 ); -inb (PIC_MASTER_POLL ); -spin_unlock (&i8259A_lock); - } -#endif -do_timer_interrupt_hook (); - -#ifdef CONFIG_MCA -if (MCA_bus) { -u8 irq_v =inb_p (0x61 );/* read the current state */ -outb_p (irq_v|0x80 ,0x61 );/* reset the IRQ */ - } -#endif - -return IRQ_HANDLED ; -} +#ifdef CONFIG_X86_64 +volatile unsigned long __jiffies __section_jiffies =INITIAL_JIFFIES ;/* calibrate_cpu is used on systems with fixed rate TSCs to determine * processor frequency */
@@ -122,19 +91,102 @@ unsigned long __init calibrate_cpu(void)return pmc_now * tsc_khz / (tsc_now - tsc_start); } +#endif +unsigned long profile_pc (struct pt_regs *regs) +{ +unsigned long pc =instruction_pointer (regs); + +#ifdef CONFIG_SMP +if (!user_mode_vm (regs) &&in_lock_functions (pc)) { +#ifdef CONFIG_FRAME_POINTER +return *(unsigned long *)(regs->bp +sizeof (long )); +#else +unsigned long *sp = (unsigned long *)®s->sp; + +/* Return address is either directly at stack pointer +or above a saved flags. Eflags has bits 22-31 zero, +kernel addresses don't. */ +if (sp[0 ] >>22 ) +return sp[0 ]; +if (sp[1 ] >>22 ) +return sp[1 ]; +#endif + } +#endif +return pc; +} +EXPORT_SYMBOL (profile_pc); + +/* +* This is the same as the above, except we _also_ save the current +* Time Stamp Counter value at the time of the timer interrupt, so that +* we later on can estimate the time of day more exactly. +*/ +irqreturn_t timer_interrupt (int irq,void *dev_id) +{ +/* Keep nmi watchdog up to date */ +#ifdef CONFIG_X86_32 +per_cpu (irq_stat,smp_processor_id ()).irq0_irqs++; +#else +add_pda (irq0_irqs,1 ); +#endif + +#ifdef CONFIG_X86_IO_APIC +if (timer_ack) { +/* +* Subtle, when I/O APICs are used we have to ack timer IRQ +* manually to deassert NMI lines for the watchdog if run +* on an 82489DX-based system. +*/ +spin_lock (&i8259A_lock); +outb (0x0c ,PIC_MASTER_OCW3 ); +/* Ack the IRQ; AEOI will end it automatically. */ +inb (PIC_MASTER_POLL ); +spin_unlock (&i8259A_lock); + } +#endif + +do_timer_interrupt_hook (); + +#ifdef CONFIG_MCA +if (MCA_bus) { +/* The PS/2 uses level-triggered interrupts. You can't +turn them off, nor would you want to (any attempt to +enable edge-triggered interrupts usually gets intercepted by a +special hardware circuit). Hence we have to acknowledge +the timer interrupt. Through some incredibly stupid +design idea, the reset for IRQ 0 is done by setting the +high bit of the PPI port B (0x61). Note that some PS/2s, +notably the 55SX, work fine if this is removed. */ + +u8 irq_v =inb_p (0x61 );/* read the current state */ +outb_p (irq_v|0x80 ,0x61 );/* reset the IRQ */ + } +#endif + +return IRQ_HANDLED ; +} + +/* Duplicate of time_init() below, with hpet_enable part added */ void __init hpet_time_init (void ) {if (!hpet_enable ())setup_pit_timer (); -time_init_hook (); } +/* +* This is called directly from init code; we must delay timer setup in the +* HPET case as we can't make the decision to turn on HPET this early in the +* boot process. +* +* The chosen time_init function will usually be hpet_time_init, above, but +* in the case of virtual hardware, an alternative function may be substituted. +*/ void __init time_init (void ) {pre_time_init_hook ();tsc_init (); - late_time_init =choose_time_init (); }
Quoted 5 lines · Ingo Molnar
Also, please do smaller steps while bringing both
time_32.candtime_64.cup into their final forms (and do it in multiple commits), and make sure each step compiles on their respective defconfig.time.cdetails are historically fragile, i'd not be surprised if this series was the target of bisection efforts.
i briefly put your current variant into tip/master, but it has build problems as well:
arch/x86/kernel/io_apic_64.c: In function 'check_timer':arch/x86/kernel/io_apic_64.c:2016: error: 'timer_ack' undeclared (first use in this function) arch/x86/kernel/io_apic_64.c:2016: error: (Each undeclared identifier is reported only once arch/x86/kernel/io_apic_64.c:2016: error: for each function it appears in.)
with:
http://redhat.com/~mingo/misc/config-Wed_Jul_30_20_50_17_CEST_2008.bad
Ingo
Quoted 17 lines · Ingo Molnar
Quoted 5 lines · Ingo Molnar
Also, please do smaller steps while bringing both
time_32.candtime_64.cup into their final forms (and do it in multiple commits), and make sure each step compiles on their respective defconfig.time.cdetails are historically fragile, i'd not be surprised if this series was the target of bisection efforts.i briefly put your current variant into tip/master, but it has build problems as well:
arch/x86/kernel/io_apic_64.c: In function 'check_timer':arch/x86/kernel/io_apic_64.c:2016: error: 'timer_ack' undeclared (first use in this function)arch/x86/kernel/io_apic_64.c:2016: error: (Each undeclared identifier is reported only oncearch/x86/kernel/io_apic_64.c:2016: error: for each function it appears in.)
Quoted 6 lines
with:
http://redhat.com/~mingo/misc/config-Wed_Jul_30_20_50_17_CEST_2008.bad
Ingo
--
include/asm-x86/timer.h +1 -1
@@ -9,8 +9,8 @@unsigned long long native_sched_clock (void );unsigned long native_calibrate_tsc (void ); -#ifdef CONFIG_X86_32 extern int timer_ack; +#ifdef CONFIG_X86_32 extern int recalibrate_cpu_khz (void );#endif /* CONFIG_X86_32 */
Quoted 29 lines · Yinghai Lu
Quoted 23 lines · Ingo Molnar
Quoted 5 lines · Ingo Molnar
Also, please do smaller steps while bringing both
time_32.candtime_64.cup into their final forms (and do it in multiple commits), and make sure each step compiles on their respective defconfig.time.cdetails are historically fragile, i'd not be surprised if this series was the target of bisection efforts.i briefly put your current variant into tip/master, but it has build problems as well:
arch/x86/kernel/io_apic_64.c: In function 'check_timer':arch/x86/kernel/io_apic_64.c:2016: error: 'timer_ack' undeclared (first use in this function)arch/x86/kernel/io_apic_64.c:2016: error: (Each undeclared identifier is reported only oncearch/x86/kernel/io_apic_64.c:2016: error: for each function it appears in.)with:
http://redhat.com/~mingo/misc/config-Wed_Jul_30_20_50_17_CEST_2008.bad
Ingo
--include/asm-x86/timer.h +0
-0
include/asm-x86/timer.h line 15
Quoted 8 lines
include/asm-x86/timer.h +1
-1@@ -9,8 +9,8 @@unsigned long long native_sched_clock (void );unsigned long native_calibrate_tsc (void ); -#ifdef CONFIG_X86_32 extern int timer_ack; +#ifdef CONFIG_X86_32 extern int recalibrate_cpu_khz (void );#endif /* CONFIG_X86_32 */
thanks - but i'll wait for Glauber's new, more finegrained series. I think regarding time.c one cannot be over-cautious enough.
Ingo