diff options
Diffstat (limited to 'arch/ia64/kernel')
| -rw-r--r-- | arch/ia64/kernel/acpi.c | 3 | ||||
| -rw-r--r-- | arch/ia64/kernel/iosapic.c | 23 | ||||
| -rw-r--r-- | arch/ia64/kernel/irq.c | 4 | ||||
| -rw-r--r-- | arch/ia64/kernel/time.c | 18 |
4 files changed, 24 insertions, 24 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index bd7acc71e8a9..0553648b7595 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
| @@ -202,7 +202,6 @@ char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size) | |||
| 202 | Boot-time Table Parsing | 202 | Boot-time Table Parsing |
| 203 | -------------------------------------------------------------------------- */ | 203 | -------------------------------------------------------------------------- */ |
| 204 | 204 | ||
| 205 | static int total_cpus __initdata; | ||
| 206 | static int available_cpus __initdata; | 205 | static int available_cpus __initdata; |
| 207 | struct acpi_table_madt *acpi_madt __initdata; | 206 | struct acpi_table_madt *acpi_madt __initdata; |
| 208 | static u8 has_8259; | 207 | static u8 has_8259; |
| @@ -1001,7 +1000,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) | |||
| 1001 | node = pxm_to_node(pxm); | 1000 | node = pxm_to_node(pxm); |
| 1002 | 1001 | ||
| 1003 | if (node >= MAX_NUMNODES || !node_online(node) || | 1002 | if (node >= MAX_NUMNODES || !node_online(node) || |
| 1004 | cpus_empty(node_to_cpumask(node))) | 1003 | cpumask_empty(cpumask_of_node(node))) |
| 1005 | return AE_OK; | 1004 | return AE_OK; |
| 1006 | 1005 | ||
| 1007 | /* We know a gsi to node mapping! */ | 1006 | /* We know a gsi to node mapping! */ |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index c8adecd5b416..5cfd3d91001a 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
| @@ -695,32 +695,31 @@ get_target_cpu (unsigned int gsi, int irq) | |||
| 695 | #ifdef CONFIG_NUMA | 695 | #ifdef CONFIG_NUMA |
| 696 | { | 696 | { |
| 697 | int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0; | 697 | int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0; |
| 698 | cpumask_t cpu_mask; | 698 | const struct cpumask *cpu_mask; |
| 699 | 699 | ||
| 700 | iosapic_index = find_iosapic(gsi); | 700 | iosapic_index = find_iosapic(gsi); |
| 701 | if (iosapic_index < 0 || | 701 | if (iosapic_index < 0 || |
| 702 | iosapic_lists[iosapic_index].node == MAX_NUMNODES) | 702 | iosapic_lists[iosapic_index].node == MAX_NUMNODES) |
| 703 | goto skip_numa_setup; | 703 | goto skip_numa_setup; |
| 704 | 704 | ||
| 705 | cpu_mask = node_to_cpumask(iosapic_lists[iosapic_index].node); | 705 | cpu_mask = cpumask_of_node(iosapic_lists[iosapic_index].node); |
| 706 | cpus_and(cpu_mask, cpu_mask, domain); | 706 | num_cpus = 0; |
| 707 | for_each_cpu_mask(numa_cpu, cpu_mask) { | 707 | for_each_cpu_and(numa_cpu, cpu_mask, &domain) { |
| 708 | if (!cpu_online(numa_cpu)) | 708 | if (cpu_online(numa_cpu)) |
| 709 | cpu_clear(numa_cpu, cpu_mask); | 709 | num_cpus++; |
| 710 | } | 710 | } |
| 711 | 711 | ||
| 712 | num_cpus = cpus_weight(cpu_mask); | ||
| 713 | |||
| 714 | if (!num_cpus) | 712 | if (!num_cpus) |
| 715 | goto skip_numa_setup; | 713 | goto skip_numa_setup; |
| 716 | 714 | ||
| 717 | /* Use irq assignment to distribute across cpus in node */ | 715 | /* Use irq assignment to distribute across cpus in node */ |
| 718 | cpu_index = irq % num_cpus; | 716 | cpu_index = irq % num_cpus; |
| 719 | 717 | ||
| 720 | for (numa_cpu = first_cpu(cpu_mask) ; i < cpu_index ; i++) | 718 | for_each_cpu_and(numa_cpu, cpu_mask, &domain) |
| 721 | numa_cpu = next_cpu(numa_cpu, cpu_mask); | 719 | if (cpu_online(numa_cpu) && i++ >= cpu_index) |
| 720 | break; | ||
| 722 | 721 | ||
| 723 | if (numa_cpu != NR_CPUS) | 722 | if (numa_cpu < nr_cpu_ids) |
| 724 | return cpu_physical_id(numa_cpu); | 723 | return cpu_physical_id(numa_cpu); |
| 725 | } | 724 | } |
| 726 | skip_numa_setup: | 725 | skip_numa_setup: |
| @@ -731,7 +730,7 @@ skip_numa_setup: | |||
| 731 | * case of NUMA.) | 730 | * case of NUMA.) |
| 732 | */ | 731 | */ |
| 733 | do { | 732 | do { |
| 734 | if (++cpu >= NR_CPUS) | 733 | if (++cpu >= nr_cpu_ids) |
| 735 | cpu = 0; | 734 | cpu = 0; |
| 736 | } while (!cpu_online(cpu) || !cpu_isset(cpu, domain)); | 735 | } while (!cpu_online(cpu) || !cpu_isset(cpu, domain)); |
| 737 | 736 | ||
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index 0b6db53fedcf..95ff16cb05d8 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c | |||
| @@ -112,11 +112,11 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir) | |||
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | bool is_affinity_mask_valid(cpumask_t cpumask) | 115 | bool is_affinity_mask_valid(cpumask_var_t cpumask) |
| 116 | { | 116 | { |
| 117 | if (ia64_platform_is("sn2")) { | 117 | if (ia64_platform_is("sn2")) { |
| 118 | /* Only allow one CPU to be specified in the smp_affinity mask */ | 118 | /* Only allow one CPU to be specified in the smp_affinity mask */ |
| 119 | if (cpus_weight(cpumask) != 1) | 119 | if (cpumask_weight(cpumask) != 1) |
| 120 | return false; | 120 | return false; |
| 121 | } | 121 | } |
| 122 | return true; | 122 | return true; |
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 65c10a42c88f..f0ebb342409d 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c | |||
| @@ -93,13 +93,14 @@ void ia64_account_on_switch(struct task_struct *prev, struct task_struct *next) | |||
| 93 | now = ia64_get_itc(); | 93 | now = ia64_get_itc(); |
| 94 | 94 | ||
| 95 | delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp)); | 95 | delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp)); |
| 96 | account_system_time(prev, 0, delta_stime); | 96 | if (idle_task(smp_processor_id()) != prev) |
| 97 | account_system_time_scaled(prev, delta_stime); | 97 | account_system_time(prev, 0, delta_stime, delta_stime); |
| 98 | else | ||
| 99 | account_idle_time(delta_stime); | ||
| 98 | 100 | ||
| 99 | if (pi->ac_utime) { | 101 | if (pi->ac_utime) { |
| 100 | delta_utime = cycle_to_cputime(pi->ac_utime); | 102 | delta_utime = cycle_to_cputime(pi->ac_utime); |
| 101 | account_user_time(prev, delta_utime); | 103 | account_user_time(prev, delta_utime, delta_utime); |
| 102 | account_user_time_scaled(prev, delta_utime); | ||
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | pi->ac_stamp = ni->ac_stamp = now; | 106 | pi->ac_stamp = ni->ac_stamp = now; |
| @@ -122,8 +123,10 @@ void account_system_vtime(struct task_struct *tsk) | |||
| 122 | now = ia64_get_itc(); | 123 | now = ia64_get_itc(); |
| 123 | 124 | ||
| 124 | delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp)); | 125 | delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp)); |
| 125 | account_system_time(tsk, 0, delta_stime); | 126 | if (irq_count() || idle_task(smp_processor_id()) != tsk) |
| 126 | account_system_time_scaled(tsk, delta_stime); | 127 | account_system_time(tsk, 0, delta_stime, delta_stime); |
| 128 | else | ||
| 129 | account_idle_time(delta_stime); | ||
| 127 | ti->ac_stime = 0; | 130 | ti->ac_stime = 0; |
| 128 | 131 | ||
| 129 | ti->ac_stamp = now; | 132 | ti->ac_stamp = now; |
| @@ -143,8 +146,7 @@ void account_process_tick(struct task_struct *p, int user_tick) | |||
| 143 | 146 | ||
| 144 | if (ti->ac_utime) { | 147 | if (ti->ac_utime) { |
| 145 | delta_utime = cycle_to_cputime(ti->ac_utime); | 148 | delta_utime = cycle_to_cputime(ti->ac_utime); |
| 146 | account_user_time(p, delta_utime); | 149 | account_user_time(p, delta_utime, delta_utime); |
| 147 | account_user_time_scaled(p, delta_utime); | ||
| 148 | ti->ac_utime = 0; | 150 | ti->ac_utime = 0; |
| 149 | } | 151 | } |
| 150 | } | 152 | } |
