search for: completion_initializer_onstack

Displaying 17 results from an estimated 17 matches for "completion_initializer_onstack".

2020 May 08
0
[RFC v4 01/12] kthread: Add kthread_queue_flush_work()
...lock = __RAW_SPIN_LOCK_UNLOCKED((worker).lock), \ .work_list = LIST_HEAD_INIT((worker).work_list), \ @@ -122,6 +127,11 @@ struct kthread_delayed_work { TIMER_IRQSAFE), \ } +#define KTHREAD_FLUSH_WORK_INIT(fwork) { \ + KTHREAD_WORK_INIT((fwork).work, __kthread_flush_work_fn), \ + COMPLETION_INITIALIZER_ONSTACK((fwork).done), \ + } + #define DEFINE_KTHREAD_WORKER(worker) \ struct kthread_worker worker = KTHREAD_WORKER_INIT(worker) @@ -132,6 +142,9 @@ struct kthread_delayed_work { struct kthread_delayed_work dwork = \ KTHREAD_DELAYED_WORK_INIT(dwork, fn) +#define DEFINE_KTHREAD_FLUSH_WOR...
2016 Apr 05
1
[PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu
...(to me) reflect the hypervisor/physical-cpu thing. Also, as per smp_call_function_single() would it not be more consistent to make this the last argument? > +{ > + struct smp_call_on_cpu_struct sscs = { > + .work = __WORK_INITIALIZER(sscs.work, smp_call_on_cpu_callback), > + .done = COMPLETION_INITIALIZER_ONSTACK(sscs.done), > + .func = func, > + .data = par, > + .cpu = pin ? cpu : -1, > + }; > + > + if (cpu >= nr_cpu_ids) You might want to also include cpu_online(). if (cpu >= nr_cpu_ids || !cpu_online(cpu)) > + return -ENXIO; Seeing how its fairly hard to schedule work...
2016 Apr 05
1
[PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu
...(to me) reflect the hypervisor/physical-cpu thing. Also, as per smp_call_function_single() would it not be more consistent to make this the last argument? > +{ > + struct smp_call_on_cpu_struct sscs = { > + .work = __WORK_INITIALIZER(sscs.work, smp_call_on_cpu_callback), > + .done = COMPLETION_INITIALIZER_ONSTACK(sscs.done), > + .func = func, > + .data = par, > + .cpu = pin ? cpu : -1, > + }; > + > + if (cpu >= nr_cpu_ids) You might want to also include cpu_online(). if (cpu >= nr_cpu_ids || !cpu_online(cpu)) > + return -ENXIO; Seeing how its fairly hard to schedule work...
2016 Apr 01
0
[PATCH v3 2/6] smp: add function to execute a function synchronously on a physical cpu
...truct, work); + sscs->ret = sscs->func(sscs->data); + + complete(&sscs->done); +} + +int smp_call_sync_on_phys_cpu(unsigned int cpu, int (*func)(void *), void *par) +{ + struct smp_sync_call_struct sscs = { + .work = __WORK_INITIALIZER(sscs.work, smp_call_sync_callback), + .done = COMPLETION_INITIALIZER_ONSTACK(sscs.done), + .func = func, + .data = par, + }; + + if (cpu >= nr_cpu_ids) + return -EINVAL; + + queue_work_on(cpu, system_wq, &sscs.work); + wait_for_completion(&sscs.done); + + return sscs.ret; +} +EXPORT_SYMBOL_GPL(smp_call_sync_on_phys_cpu); diff --git a/kernel/up.c b/kernel/up.c...
2016 Apr 05
0
[PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu
...+ if (sscs->cpu >= 0) + hypervisor_pin_vcpu(-1); + + complete(&sscs->done); +} + +int smp_call_on_cpu(unsigned int cpu, bool pin, int (*func)(void *), void *par) +{ + struct smp_call_on_cpu_struct sscs = { + .work = __WORK_INITIALIZER(sscs.work, smp_call_on_cpu_callback), + .done = COMPLETION_INITIALIZER_ONSTACK(sscs.done), + .func = func, + .data = par, + .cpu = pin ? cpu : -1, + }; + + if (cpu >= nr_cpu_ids) + return -ENXIO; + + queue_work_on(cpu, system_wq, &sscs.work); + wait_for_completion(&sscs.done); + + return sscs.ret; +} +EXPORT_SYMBOL_GPL(smp_call_on_cpu); diff --git a/kernel/up....
2016 Apr 06
0
[PATCH v5 3/6] smp: add function to execute a function synchronously on a cpu
...+ if (sscs->cpu >= 0) + hypervisor_pin_vcpu(-1); + + complete(&sscs->done); +} + +int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys) +{ + struct smp_call_on_cpu_struct sscs = { + .work = __WORK_INITIALIZER(sscs.work, smp_call_on_cpu_callback), + .done = COMPLETION_INITIALIZER_ONSTACK(sscs.done), + .func = func, + .data = par, + .cpu = phys ? cpu : -1, + }; + + if (cpu >= nr_cpu_ids || !cpu_online(cpu)) + return -ENXIO; + + queue_work_on(cpu, system_wq, &sscs.work); + wait_for_completion(&sscs.done); + + return sscs.ret; +} +EXPORT_SYMBOL_GPL(smp_call_on_cpu); di...
2016 Apr 05
10
[PATCH v4 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Apr 05
10
[PATCH v4 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Mar 21
8
[PATCH v2 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Mar 21
8
[PATCH v2 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Apr 01
8
[PATCH v3 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Apr 01
8
[PATCH v3 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Aug 29
6
[PATCH v6 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Aug 29
6
[PATCH v6 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2020 May 08
16
[RFC v4 00/12] drm/nouveau: Introduce CRC support for gf119+
Nvidia released some documentation on how CRC support works on their GPUs, hooray! So: this patch series implements said CRC support in nouveau, along with adding some special debugfs interfaces for some relevant igt-gpu-tools tests (already on the ML). First - we add some new functionality to kthread_work in the kernel, and then use this to add a new feature to DRM that Ville Syrj?l? came up
2016 Apr 06
14
[PATCH v5 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a
2016 Apr 06
14
[PATCH v5 0/6] Support calling functions on dedicated physical cpu
Some hardware (e.g. Dell Studio laptops) require special functions to be called on physical cpu 0 in order to avoid occasional hangs. When running as dom0 under Xen this could be achieved only via special boot parameters (vcpu pinning) limiting the hypervisor in it's scheduling decisions. This patch series is adding a generic function to be able to temporarily pin a (virtual) cpu to a