search for: put_cpu

Displaying 20 results from an estimated 140 matches for "put_cpu".

Did you mean: per_cpu
2007 Apr 18
2
[PATCH] Simplify smp_call_function*() by using common implementation
...xecute <func> + * or is or has executed. + */ +int smp_call_function_single(int cpu, void (*func) (void *info), void *info, + int nonatomic, int wait) +{ + /* prevent preemption and reschedule on another processor */ + int ret; + int me = get_cpu(); + if (cpu == me) { + WARN_ON(1); + put_cpu(); + return -EBUSY; + } + + ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait); + + put_cpu(); + return ret; +} +EXPORT_SYMBOL(smp_call_function_single); static void stop_this_cpu (void * dummy) { @@ -598,7 +664,7 @@ void smp_send_stop(void) unsigned long flags; local_ir...
2007 Apr 18
2
[PATCH] Simplify smp_call_function*() by using common implementation
...xecute <func> + * or is or has executed. + */ +int smp_call_function_single(int cpu, void (*func) (void *info), void *info, + int nonatomic, int wait) +{ + /* prevent preemption and reschedule on another processor */ + int ret; + int me = get_cpu(); + if (cpu == me) { + WARN_ON(1); + put_cpu(); + return -EBUSY; + } + + ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait); + + put_cpu(); + return ret; +} +EXPORT_SYMBOL(smp_call_function_single); static void stop_this_cpu (void * dummy) { @@ -598,7 +664,7 @@ void smp_send_stop(void) unsigned long flags; local_ir...
2007 Apr 18
1
[PATCH 7/21] i386 Losing fs gs to bios
...t[GDT_ENTRY_BAD_BIOS] = gdt[GDT_ENTRY_BAD_BIOS_CACHE]; +} + +static inline void restore_bios_segments(struct bios_segment_save *save_area) +{ + save_area->gdt[GDT_ENTRY_BAD_BIOS] = save_area->save_desc_40; + loadsegment(fs, save_area->saved_fs); + loadsegment(gs, save_area->saved_gs); + put_cpu(); +} + #endif /* !__ASSEMBLY__ */ #endif Index: linux-2.6.14-zach-work/drivers/pnp/pnpbios/bioscalls.c =================================================================== --- linux-2.6.14-zach-work.orig/drivers/pnp/pnpbios/bioscalls.c 2005-11-04 17:42:39.000000000 -0800 +++ linux-2.6.14-zach-w...
2007 Apr 18
1
[PATCH 7/21] i386 Losing fs gs to bios
...t[GDT_ENTRY_BAD_BIOS] = gdt[GDT_ENTRY_BAD_BIOS_CACHE]; +} + +static inline void restore_bios_segments(struct bios_segment_save *save_area) +{ + save_area->gdt[GDT_ENTRY_BAD_BIOS] = save_area->save_desc_40; + loadsegment(fs, save_area->saved_fs); + loadsegment(gs, save_area->saved_gs); + put_cpu(); +} + #endif /* !__ASSEMBLY__ */ #endif Index: linux-2.6.14-zach-work/drivers/pnp/pnpbios/bioscalls.c =================================================================== --- linux-2.6.14-zach-work.orig/drivers/pnp/pnpbios/bioscalls.c 2005-11-04 17:42:39.000000000 -0800 +++ linux-2.6.14-zach-w...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...> { > struct smp_sync_call_struct *sscs; > + unsigned int cpu; > > sscs = container_of(work, struct smp_sync_call_struct, work); > + cpu = get_cpu(); > + hypervisor_pin_vcpu(cpu); > sscs->ret = sscs->func(sscs->data); > + hypervisor_pin_vcpu(-1); > + put_cpu(); > > complete(&sscs->done); > } So I don't really like this; it adds the requirement that the function cannot schedule, which greatly limits the utility of the construct. At this point you might as well use the regular IPI stuff. You can easily avoid this constraint by...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...> { > struct smp_sync_call_struct *sscs; > + unsigned int cpu; > > sscs = container_of(work, struct smp_sync_call_struct, work); > + cpu = get_cpu(); > + hypervisor_pin_vcpu(cpu); > sscs->ret = sscs->func(sscs->data); > + hypervisor_pin_vcpu(-1); > + put_cpu(); > > complete(&sscs->done); > } So I don't really like this; it adds the requirement that the function cannot schedule, which greatly limits the utility of the construct. At this point you might as well use the regular IPI stuff. You can easily avoid this constraint by...
2007 Apr 28
3
[PATCH] i386: introduce voyager smp_ops, fix voyager build
...eturns just before the target cpu calls @func. - */ -int smp_call_function_single(int cpu, void (*func) (void *info), void *info, - int nonatomic, int wait) -{ - /* prevent preemption and reschedule on another processor */ - int ret; - int me = get_cpu(); - if (cpu == me) { - WARN_ON(1); - put_cpu(); - return -EBUSY; - } - - ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait); - - put_cpu(); - return ret; -} -EXPORT_SYMBOL(smp_call_function_single); - static void stop_this_cpu (void * dummy) { local_irq_disable(); @@ -671,7 +618,7 @@ static void stop_this_cpu (void * dum...
2007 Apr 28
3
[PATCH] i386: introduce voyager smp_ops, fix voyager build
...eturns just before the target cpu calls @func. - */ -int smp_call_function_single(int cpu, void (*func) (void *info), void *info, - int nonatomic, int wait) -{ - /* prevent preemption and reschedule on another processor */ - int ret; - int me = get_cpu(); - if (cpu == me) { - WARN_ON(1); - put_cpu(); - return -EBUSY; - } - - ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait); - - put_cpu(); - return ret; -} -EXPORT_SYMBOL(smp_call_function_single); - static void stop_this_cpu (void * dummy) { local_irq_disable(); @@ -671,7 +618,7 @@ static void stop_this_cpu (void * dum...
2016 Apr 01
0
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...scheduling and maybe other hypervisor functions like suspending the system which rely on scheduling. To ensure this don't let the current thread be preempted while the vcpu is pinned in smp_call_sync_on_phys_cpu(). Signed-off-by: Juergen Gross <jgross at suse.com> --- V3: use getc_cpu()/put_cpu() as suggested by David Vrabel V2: adapt to using workqueues add include/linux/hypervisor.h to hide architecture specific stuff from generic kernel code In case paravirt maintainers don't want to be responsible for include/linux/hypervisor.h I could take it. --- MAINTAINERS...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...life */ + if (stopmachine_timeout) { + limit = jiffies + msecs_to_jiffies(stopmachine_timeout); + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { + if (time_is_before_jiffies(limit)) + goto timeout; + cpu_relax(); + } + } + /* This will release the thread on our CPU. */ put_cpu(); wait_for_completion(&finished); @@ -169,10 +195,32 @@ kill_threads: for_each_online_cpu(i) if (threads[i]) kthread_stop(threads[i]); + atomic_set(&num_threads, 0); mutex_unlock(&lock); kfree(threads); return err; + +timeout: + printk(KERN_CRIT "stopmachine: Fa...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...life */ + if (stopmachine_timeout) { + limit = jiffies + msecs_to_jiffies(stopmachine_timeout); + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { + if (time_is_before_jiffies(limit)) + goto timeout; + cpu_relax(); + } + } + /* This will release the thread on our CPU. */ put_cpu(); wait_for_completion(&finished); @@ -169,10 +195,32 @@ kill_threads: for_each_online_cpu(i) if (threads[i]) kthread_stop(threads[i]); + atomic_set(&num_threads, 0); mutex_unlock(&lock); kfree(threads); return err; + +timeout: + printk(KERN_CRIT "stopmachine: Fa...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...] = bad_bios_desc; local_save_flags(flags); APM_DO_CLI; @@ -610,7 +612,7 @@ apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); APM_DO_RESTORE_SEGS; local_irq_restore(flags); - per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40; + gdt[desc_number(0x40)] = save_desc_40; put_cpu(); apm_restore_cpus(cpus); @@ -639,13 +641,14 @@ cpumask_t cpus; int cpu; struct desc_struct save_desc_40; - + struct desc_struct *gdt; cpus = apm_save_cpus(); cpu = get_cpu(); - save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8]; - per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = b...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...] = bad_bios_desc; local_save_flags(flags); APM_DO_CLI; @@ -610,7 +612,7 @@ apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); APM_DO_RESTORE_SEGS; local_irq_restore(flags); - per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40; + gdt[desc_number(0x40)] = save_desc_40; put_cpu(); apm_restore_cpus(cpus); @@ -639,13 +641,14 @@ cpumask_t cpus; int cpu; struct desc_struct save_desc_40; - + struct desc_struct *gdt; cpus = apm_save_cpus(); cpu = get_cpu(); - save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8]; - per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = b...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...life */ + if (stopmachine_timeout) { + limit = jiffies + msecs_to_jiffies(stopmachine_timeout); + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { + if (time_is_before_jiffies(limit)) + goto timeout; + cpu_relax(); + } + } + /* This will release the thread on our CPU. */ put_cpu(); wait_for_completion(&finished); @@ -169,10 +195,32 @@ kill_threads: for_each_online_cpu(i) if (threads[i]) kthread_stop(threads[i]); + atomic_set(&num_threads, 0); mutex_unlock(&lock); kfree(threads); return err; + +timeout: + printk(KERN_CRIT "stopmachine: Fa...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...life */ + if (stopmachine_timeout) { + limit = jiffies + msecs_to_jiffies(stopmachine_timeout); + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { + if (time_is_before_jiffies(limit)) + goto timeout; + cpu_relax(); + } + } + /* This will release the thread on our CPU. */ put_cpu(); wait_for_completion(&finished); @@ -169,10 +195,32 @@ kill_threads: for_each_online_cpu(i) if (threads[i]) kthread_stop(threads[i]); + atomic_set(&num_threads, 0); mutex_unlock(&lock); kfree(threads); return err; + +timeout: + printk(KERN_CRIT "stopmachine: Fa...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...ned int cpu; > >> > >> sscs = container_of(work, struct smp_sync_call_struct, work); > >> + cpu = get_cpu(); > >> + hypervisor_pin_vcpu(cpu); > >> sscs->ret = sscs->func(sscs->data); > >> + hypervisor_pin_vcpu(-1); > >> + put_cpu(); > >> > >> complete(&sscs->done); > >> } > > > > So I don't really like this; it adds the requirement that the function > > cannot schedule, which greatly limits the utility of the construct. At > > this point you might as well u...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...ned int cpu; > >> > >> sscs = container_of(work, struct smp_sync_call_struct, work); > >> + cpu = get_cpu(); > >> + hypervisor_pin_vcpu(cpu); > >> sscs->ret = sscs->func(sscs->data); > >> + hypervisor_pin_vcpu(-1); > >> + put_cpu(); > >> > >> complete(&sscs->done); > >> } > > > > So I don't really like this; it adds the requirement that the function > > cannot schedule, which greatly limits the utility of the construct. At > > this point you might as well u...
2007 Apr 18
1
[PATCH 2/3] Gdt_accessor
...e_flags(flags); APM_DO_CLI; @@ -610,7 +612,7 @@ static u8 apm_bios_call(u32 func, u32 eb apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); APM_DO_RESTORE_SEGS; local_irq_restore(flags); - per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40; + gdt[0x40 / 8] = save_desc_40; put_cpu(); apm_restore_cpus(cpus); @@ -639,13 +641,14 @@ static u8 apm_bios_call_simple(u32 func, cpumask_t cpus; int cpu; struct desc_struct save_desc_40; - + struct desc_struct *gdt; cpus = apm_save_cpus(); cpu = get_cpu(); - save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8]; -...
2007 Apr 18
1
[PATCH 2/3] Gdt_accessor
...e_flags(flags); APM_DO_CLI; @@ -610,7 +612,7 @@ static u8 apm_bios_call(u32 func, u32 eb apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); APM_DO_RESTORE_SEGS; local_irq_restore(flags); - per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40; + gdt[0x40 / 8] = save_desc_40; put_cpu(); apm_restore_cpus(cpus); @@ -639,13 +641,14 @@ static u8 apm_bios_call_simple(u32 func, cpumask_t cpus; int cpu; struct desc_struct save_desc_40; - + struct desc_struct *gdt; cpus = apm_save_cpus(); cpu = get_cpu(); - save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8]; -...
2016 Apr 06
14
[PATCH v5 0/6] Support calling functions on dedicated physical cpu
...quested by Peter Zijlstra - patch 3 (was 2): change return value in case of illegal cpu as requested by Peter Zijlstra - patch 3 (was 2): make pinning of vcpu an option as suggested by Peter Zijlstra - patches 5 and 6 (were 3 and 4): add call to get_online_cpus() Changes in V3: - use get_cpu()/put_cpu() as suggested by David Vrabel Changes in V2: - instead of manipulating the allowed set of cpus use cpu specific workqueue as requested by Peter Zijlstra - add include/linux/hypervisor.h to hide architecture specific stuff from generic kernel code Juergen Gross (6): xen: sync xen header v...