Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] fix file and descriptor handling in perfmon
[IA64] TS_RESTORE_SIGMASK
[IA64] smp.c coding style fix
[IA64] fix section mismatch in arch/ia64/kernel/topology.c
[IA64] fix section mismatch in arch/ia64/kernel/palinfo.c
[IA64] fix section mismatch in arch/ia64/kernel/irq.c
[IA64] fix section mismatch in arch/ia64/kernel/acpi.c

+156 -170
+1 -1
arch/ia64/ia32/ia32_signal.c
··· 463 463 464 464 current->state = TASK_INTERRUPTIBLE; 465 465 schedule(); 466 - set_thread_flag(TIF_RESTORE_SIGMASK); 466 + set_restore_sigmask(); 467 467 return -ERESTARTNOHAND; 468 468 } 469 469
+1 -1
arch/ia64/kernel/acpi.c
··· 966 966 fs_initcall(acpi_map_iosapics); 967 967 #endif /* CONFIG_ACPI_NUMA */ 968 968 969 - int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) 969 + int __ref acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) 970 970 { 971 971 int err; 972 972
+2 -2
arch/ia64/kernel/irq.c
··· 183 183 { 184 184 unsigned int irq; 185 185 extern void ia64_process_pending_intr(void); 186 - extern void ia64_disable_timer(void); 187 186 extern volatile int time_keeper_id; 188 187 189 - ia64_disable_timer(); 188 + /* Mask ITV to disable timer */ 189 + ia64_set_itv(1 << 16); 190 190 191 191 /* 192 192 * Find a new timesync master
+1 -1
arch/ia64/kernel/palinfo.c
··· 1053 1053 return NOTIFY_OK; 1054 1054 } 1055 1055 1056 - static struct notifier_block palinfo_cpu_notifier __cpuinitdata = 1056 + static struct notifier_block __refdata palinfo_cpu_notifier = 1057 1057 { 1058 1058 .notifier_call = palinfo_cpu_callback, 1059 1059 .priority = 0,
+87 -112
arch/ia64/kernel/perfmon.c
··· 867 867 } 868 868 869 869 static pfm_context_t * 870 - pfm_context_alloc(void) 870 + pfm_context_alloc(int ctx_flags) 871 871 { 872 872 pfm_context_t *ctx; 873 873 ··· 878 878 ctx = kzalloc(sizeof(pfm_context_t), GFP_KERNEL); 879 879 if (ctx) { 880 880 DPRINT(("alloc ctx @%p\n", ctx)); 881 + 882 + /* 883 + * init context protection lock 884 + */ 885 + spin_lock_init(&ctx->ctx_lock); 886 + 887 + /* 888 + * context is unloaded 889 + */ 890 + ctx->ctx_state = PFM_CTX_UNLOADED; 891 + 892 + /* 893 + * initialization of context's flags 894 + */ 895 + ctx->ctx_fl_block = (ctx_flags & PFM_FL_NOTIFY_BLOCK) ? 1 : 0; 896 + ctx->ctx_fl_system = (ctx_flags & PFM_FL_SYSTEM_WIDE) ? 1: 0; 897 + ctx->ctx_fl_no_msg = (ctx_flags & PFM_FL_OVFL_NO_MSG) ? 1: 0; 898 + /* 899 + * will move to set properties 900 + * ctx->ctx_fl_excl_idle = (ctx_flags & PFM_FL_EXCL_IDLE) ? 1: 0; 901 + */ 902 + 903 + /* 904 + * init restart semaphore to locked 905 + */ 906 + init_completion(&ctx->ctx_restart_done); 907 + 908 + /* 909 + * activation is used in SMP only 910 + */ 911 + ctx->ctx_last_activation = PFM_INVALID_ACTIVATION; 912 + SET_LAST_CPU(ctx, -1); 913 + 914 + /* 915 + * initialize notification message queue 916 + */ 917 + ctx->ctx_msgq_head = ctx->ctx_msgq_tail = 0; 918 + init_waitqueue_head(&ctx->ctx_msgq_wait); 919 + init_waitqueue_head(&ctx->ctx_zombieq); 920 + 881 921 } 882 922 return ctx; 883 923 } ··· 2205 2165 }; 2206 2166 2207 2167 2208 - static int 2209 - pfm_alloc_fd(struct file **cfile) 2168 + static struct file * 2169 + pfm_alloc_file(pfm_context_t *ctx) 2210 2170 { 2211 - int fd, ret = 0; 2212 - struct file *file = NULL; 2213 - struct inode * inode; 2171 + struct file *file; 2172 + struct inode *inode; 2173 + struct dentry *dentry; 2214 2174 char name[32]; 2215 2175 struct qstr this; 2216 - 2217 - fd = get_unused_fd(); 2218 - if (fd < 0) return -ENFILE; 2219 - 2220 - ret = -ENFILE; 2221 - 2222 - file = get_empty_filp(); 2223 - if (!file) goto out; 2224 2176 2225 2177 /* 2226 2178 * allocate a new inode 2227 2179 */ 2228 2180 inode = new_inode(pfmfs_mnt->mnt_sb); 2229 - if (!inode) goto out; 2181 + if (!inode) 2182 + return ERR_PTR(-ENOMEM); 2230 2183 2231 2184 DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode)); 2232 2185 ··· 2232 2199 this.len = strlen(name); 2233 2200 this.hash = inode->i_ino; 2234 2201 2235 - ret = -ENOMEM; 2236 - 2237 2202 /* 2238 2203 * allocate a new dcache entry 2239 2204 */ 2240 - file->f_path.dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this); 2241 - if (!file->f_path.dentry) goto out; 2205 + dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this); 2206 + if (!dentry) { 2207 + iput(inode); 2208 + return ERR_PTR(-ENOMEM); 2209 + } 2242 2210 2243 - file->f_path.dentry->d_op = &pfmfs_dentry_operations; 2211 + dentry->d_op = &pfmfs_dentry_operations; 2212 + d_add(dentry, inode); 2244 2213 2245 - d_add(file->f_path.dentry, inode); 2246 - file->f_path.mnt = mntget(pfmfs_mnt); 2247 - file->f_mapping = inode->i_mapping; 2214 + file = alloc_file(pfmfs_mnt, dentry, FMODE_READ, &pfm_file_ops); 2215 + if (!file) { 2216 + dput(dentry); 2217 + return ERR_PTR(-ENFILE); 2218 + } 2248 2219 2249 - file->f_op = &pfm_file_ops; 2250 - file->f_mode = FMODE_READ; 2251 2220 file->f_flags = O_RDONLY; 2252 - file->f_pos = 0; 2221 + file->private_data = ctx; 2253 2222 2254 - /* 2255 - * may have to delay until context is attached? 2256 - */ 2257 - fd_install(fd, file); 2258 - 2259 - /* 2260 - * the file structure we will use 2261 - */ 2262 - *cfile = file; 2263 - 2264 - return fd; 2265 - out: 2266 - if (file) put_filp(file); 2267 - put_unused_fd(fd); 2268 - return ret; 2269 - } 2270 - 2271 - static void 2272 - pfm_free_fd(int fd, struct file *file) 2273 - { 2274 - struct files_struct *files = current->files; 2275 - struct fdtable *fdt; 2276 - 2277 - /* 2278 - * there ie no fd_uninstall(), so we do it here 2279 - */ 2280 - spin_lock(&files->file_lock); 2281 - fdt = files_fdtable(files); 2282 - rcu_assign_pointer(fdt->fd[fd], NULL); 2283 - spin_unlock(&files->file_lock); 2284 - 2285 - if (file) 2286 - put_filp(file); 2287 - put_unused_fd(fd); 2223 + return file; 2288 2224 } 2289 2225 2290 2226 static int ··· 2477 2475 2478 2476 /* link buffer format and context */ 2479 2477 ctx->ctx_buf_fmt = fmt; 2478 + ctx->ctx_fl_is_sampling = 1; /* assume record() is defined */ 2480 2479 2481 2480 /* 2482 2481 * check if buffer format wants to use perfmon buffer allocation/mapping service ··· 2672 2669 { 2673 2670 pfarg_context_t *req = (pfarg_context_t *)arg; 2674 2671 struct file *filp; 2672 + struct path path; 2675 2673 int ctx_flags; 2674 + int fd; 2676 2675 int ret; 2677 2676 2678 2677 /* let's check the arguments first */ 2679 2678 ret = pfarg_is_sane(current, req); 2680 - if (ret < 0) return ret; 2679 + if (ret < 0) 2680 + return ret; 2681 2681 2682 2682 ctx_flags = req->ctx_flags; 2683 2683 2684 2684 ret = -ENOMEM; 2685 2685 2686 - ctx = pfm_context_alloc(); 2687 - if (!ctx) goto error; 2686 + fd = get_unused_fd(); 2687 + if (fd < 0) 2688 + return fd; 2688 2689 2689 - ret = pfm_alloc_fd(&filp); 2690 - if (ret < 0) goto error_file; 2690 + ctx = pfm_context_alloc(ctx_flags); 2691 + if (!ctx) 2692 + goto error; 2691 2693 2692 - req->ctx_fd = ctx->ctx_fd = ret; 2694 + filp = pfm_alloc_file(ctx); 2695 + if (IS_ERR(filp)) { 2696 + ret = PTR_ERR(filp); 2697 + goto error_file; 2698 + } 2693 2699 2694 - /* 2695 - * attach context to file 2696 - */ 2697 - filp->private_data = ctx; 2700 + req->ctx_fd = ctx->ctx_fd = fd; 2698 2701 2699 2702 /* 2700 2703 * does the user want to sample? 2701 2704 */ 2702 2705 if (pfm_uuid_cmp(req->ctx_smpl_buf_id, pfm_null_uuid)) { 2703 2706 ret = pfm_setup_buffer_fmt(current, filp, ctx, ctx_flags, 0, req); 2704 - if (ret) goto buffer_error; 2707 + if (ret) 2708 + goto buffer_error; 2705 2709 } 2706 - 2707 - /* 2708 - * init context protection lock 2709 - */ 2710 - spin_lock_init(&ctx->ctx_lock); 2711 - 2712 - /* 2713 - * context is unloaded 2714 - */ 2715 - ctx->ctx_state = PFM_CTX_UNLOADED; 2716 - 2717 - /* 2718 - * initialization of context's flags 2719 - */ 2720 - ctx->ctx_fl_block = (ctx_flags & PFM_FL_NOTIFY_BLOCK) ? 1 : 0; 2721 - ctx->ctx_fl_system = (ctx_flags & PFM_FL_SYSTEM_WIDE) ? 1: 0; 2722 - ctx->ctx_fl_is_sampling = ctx->ctx_buf_fmt ? 1 : 0; /* assume record() is defined */ 2723 - ctx->ctx_fl_no_msg = (ctx_flags & PFM_FL_OVFL_NO_MSG) ? 1: 0; 2724 - /* 2725 - * will move to set properties 2726 - * ctx->ctx_fl_excl_idle = (ctx_flags & PFM_FL_EXCL_IDLE) ? 1: 0; 2727 - */ 2728 - 2729 - /* 2730 - * init restart semaphore to locked 2731 - */ 2732 - init_completion(&ctx->ctx_restart_done); 2733 - 2734 - /* 2735 - * activation is used in SMP only 2736 - */ 2737 - ctx->ctx_last_activation = PFM_INVALID_ACTIVATION; 2738 - SET_LAST_CPU(ctx, -1); 2739 - 2740 - /* 2741 - * initialize notification message queue 2742 - */ 2743 - ctx->ctx_msgq_head = ctx->ctx_msgq_tail = 0; 2744 - init_waitqueue_head(&ctx->ctx_msgq_wait); 2745 - init_waitqueue_head(&ctx->ctx_zombieq); 2746 2710 2747 2711 DPRINT(("ctx=%p flags=0x%x system=%d notify_block=%d excl_idle=%d no_msg=%d ctx_fd=%d \n", 2748 2712 ctx, ··· 2725 2755 */ 2726 2756 pfm_reset_pmu_state(ctx); 2727 2757 2758 + fd_install(fd, filp); 2759 + 2728 2760 return 0; 2729 2761 2730 2762 buffer_error: 2731 - pfm_free_fd(ctx->ctx_fd, filp); 2763 + path = filp->f_path; 2764 + put_filp(filp); 2765 + path_put(&path); 2732 2766 2733 2767 if (ctx->ctx_buf_fmt) { 2734 2768 pfm_buf_fmt_exit(ctx->ctx_buf_fmt, current, NULL, regs); ··· 2741 2767 pfm_context_free(ctx); 2742 2768 2743 2769 error: 2770 + put_unused_fd(fd); 2744 2771 return ret; 2745 2772 } 2746 2773
+8 -7
arch/ia64/kernel/signal.c
··· 464 464 if (!user_mode(&scr->pt)) 465 465 return; 466 466 467 - if (test_thread_flag(TIF_RESTORE_SIGMASK)) 467 + if (current_thread_info()->status & TS_RESTORE_SIGMASK) 468 468 oldset = &current->saved_sigmask; 469 469 else 470 470 oldset = &current->blocked; ··· 530 530 * continue to iterate in this loop so we can deliver the SIGSEGV... 531 531 */ 532 532 if (handle_signal(signr, &ka, &info, oldset, scr)) { 533 - /* a signal was successfully delivered; the saved 533 + /* 534 + * A signal was successfully delivered; the saved 534 535 * sigmask will have been stored in the signal frame, 535 536 * and will be restored by sigreturn, so we can simply 536 - * clear the TIF_RESTORE_SIGMASK flag */ 537 - if (test_thread_flag(TIF_RESTORE_SIGMASK)) 538 - clear_thread_flag(TIF_RESTORE_SIGMASK); 537 + * clear the TS_RESTORE_SIGMASK flag. 538 + */ 539 + current_thread_info()->status &= ~TS_RESTORE_SIGMASK; 539 540 return; 540 541 } 541 542 } ··· 567 566 568 567 /* if there's no signal to deliver, we just put the saved sigmask 569 568 * back */ 570 - if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 571 - clear_thread_flag(TIF_RESTORE_SIGMASK); 569 + if (current_thread_info()->status & TS_RESTORE_SIGMASK) { 570 + current_thread_info()->status &= ~TS_RESTORE_SIGMASK; 572 571 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 573 572 } 574 573 }
+34 -32
arch/ia64/kernel/smp.c
··· 98 98 spin_unlock_irq(&call_lock); 99 99 } 100 100 101 + static inline void 102 + handle_call_data(void) 103 + { 104 + struct call_data_struct *data; 105 + void (*func)(void *info); 106 + void *info; 107 + int wait; 108 + 109 + /* release the 'pointer lock' */ 110 + data = (struct call_data_struct *)call_data; 111 + func = data->func; 112 + info = data->info; 113 + wait = data->wait; 114 + 115 + mb(); 116 + atomic_inc(&data->started); 117 + /* At this point the structure may be gone unless wait is true. */ 118 + (*func)(info); 119 + 120 + /* Notify the sending CPU that the task is done. */ 121 + mb(); 122 + if (wait) 123 + atomic_inc(&data->finished); 124 + } 125 + 101 126 static void 102 - stop_this_cpu (void) 127 + stop_this_cpu(void) 103 128 { 104 129 /* 105 130 * Remove this CPU: ··· 163 138 ops &= ~(1 << which); 164 139 165 140 switch (which) { 166 - case IPI_CALL_FUNC: 167 - { 168 - struct call_data_struct *data; 169 - void (*func)(void *info); 170 - void *info; 171 - int wait; 141 + case IPI_CALL_FUNC: 142 + handle_call_data(); 143 + break; 172 144 173 - /* release the 'pointer lock' */ 174 - data = (struct call_data_struct *) call_data; 175 - func = data->func; 176 - info = data->info; 177 - wait = data->wait; 178 - 179 - mb(); 180 - atomic_inc(&data->started); 181 - /* 182 - * At this point the structure may be gone unless 183 - * wait is true. 184 - */ 185 - (*func)(info); 186 - 187 - /* Notify the sending CPU that the task is done. */ 188 - mb(); 189 - if (wait) 190 - atomic_inc(&data->finished); 191 - } 192 - break; 193 - 194 - case IPI_CPU_STOP: 145 + case IPI_CPU_STOP: 195 146 stop_this_cpu(); 196 147 break; 197 148 #ifdef CONFIG_KEXEC 198 - case IPI_KDUMP_CPU_STOP: 149 + case IPI_KDUMP_CPU_STOP: 199 150 unw_init_running(kdump_cpu_freeze, NULL); 200 151 break; 201 152 #endif 202 - default: 203 - printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n", this_cpu, which); 153 + default: 154 + printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n", 155 + this_cpu, which); 204 156 break; 205 157 } 206 158 } while (ops);
-5
arch/ia64/kernel/time.c
··· 379 379 .name = "timer" 380 380 }; 381 381 382 - void __devinit ia64_disable_timer(void) 383 - { 384 - ia64_set_itv(1 << 16); 385 - } 386 - 387 382 void __init 388 383 time_init (void) 389 384 {
+10 -6
arch/ia64/kernel/topology.c
··· 36 36 } 37 37 EXPORT_SYMBOL_GPL(arch_fix_phys_package_id); 38 38 39 - int arch_register_cpu(int num) 39 + 40 + #ifdef CONFIG_HOTPLUG_CPU 41 + int __ref arch_register_cpu(int num) 40 42 { 41 - #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) 43 + #ifdef CONFIG_ACPI 42 44 /* 43 45 * If CPEI can be re-targetted or if this is not 44 46 * CPEI target, then it is hotpluggable ··· 49 47 sysfs_cpus[num].cpu.hotpluggable = 1; 50 48 map_cpu_to_node(num, node_cpuid[num].nid); 51 49 #endif 52 - 53 50 return register_cpu(&sysfs_cpus[num].cpu, num); 54 51 } 55 - 56 - #ifdef CONFIG_HOTPLUG_CPU 52 + EXPORT_SYMBOL(arch_register_cpu); 57 53 58 54 void arch_unregister_cpu(int num) 59 55 { 60 56 unregister_cpu(&sysfs_cpus[num].cpu); 61 57 unmap_cpu_from_node(num, cpu_to_node(num)); 62 58 } 63 - EXPORT_SYMBOL(arch_register_cpu); 64 59 EXPORT_SYMBOL(arch_unregister_cpu); 60 + #else 61 + static int __init arch_register_cpu(int num) 62 + { 63 + return register_cpu(&sysfs_cpus[num].cpu, num); 64 + } 65 65 #endif /*CONFIG_HOTPLUG_CPU*/ 66 66 67 67
+1 -1
include/asm-ia64/cpu.h
··· 14 14 15 15 DECLARE_PER_CPU(int, cpu_state); 16 16 17 - extern int arch_register_cpu(int num); 18 17 #ifdef CONFIG_HOTPLUG_CPU 18 + extern int arch_register_cpu(int num); 19 19 extern void arch_unregister_cpu(int); 20 20 #endif 21 21
+11 -2
include/asm-ia64/thread_info.h
··· 108 108 #define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ 109 109 #define TIF_FREEZE 20 /* is freezing for suspend */ 110 110 #define TIF_RESTORE_RSE 21 /* user RBS is newer than kernel RBS */ 111 - #define TIF_RESTORE_SIGMASK 22 /* restore signal mask in do_signal() */ 112 111 113 112 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 114 113 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 115 114 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 116 115 #define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP) 117 - #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 118 116 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 119 117 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 120 118 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) ··· 129 131 #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) 130 132 131 133 #define TS_POLLING 1 /* true if in idle loop and not sleeping */ 134 + #define TS_RESTORE_SIGMASK 2 /* restore signal mask in do_signal() */ 132 135 133 136 #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) 137 + 138 + #ifndef __ASSEMBLY__ 139 + #define HAVE_SET_RESTORE_SIGMASK 1 140 + static inline void set_restore_sigmask(void) 141 + { 142 + struct thread_info *ti = current_thread_info(); 143 + ti->status |= TS_RESTORE_SIGMASK; 144 + set_bit(TIF_SIGPENDING, &ti->flags); 145 + } 146 + #endif /* !__ASSEMBLY__ */ 134 147 135 148 #endif /* _ASM_IA64_THREAD_INFO_H */