x86, hpet.c: Changed delayed_work to work when delay is 0
PATCH 1/1 x86, hpet.c: Changed delayed_work to work when delay is 0
Here a delayed_work was used with delay 0, so it was changed to work. It avoids a timer set up and the work is directly queued, providing less use of memory and more performance.
I've tried to send this patch to Venkatesh Pallipadi, the creator of the code I changed ([email protected]), but "the message was rejected by the recipient domain".
--- arch/x86/kernel/hpet.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
arch/x86/kernel/hpet.c +2 -4
@@ -724,12 +724,10 @@ static int hpet_cpuhp_notify(struct notifier_block *n,switch (action &0xf ) {case CPU_ONLINE : -INIT_DELAYED_WORK_ON_STACK (&work.work, hpet_work); +INIT_WORK_ON_STACK (&work.work.work, hpet_work);init_completion (&work.complete); -/* FIXME: add schedule_work_on() */ -schedule_delayed_work_on (cpu, &work.work,0 ); +schedule_work_on (cpu, &work.work.work);wait_for_completion (&work.complete); -destroy_timer_on_stack (&work.work.timer);break ;case CPU_DEAD :if (hdev) {
Signature · 1 line
1.6.0.4
Thanks for sending the patch.
A comment below.
Quoted 17 lines · Leonardo de Sá Alt
Here a
delayed_workwas used with delay 0, so it was changed to work. It avoids a timer set up and the work is directly queued, providing less use of memory and more performance.Signed-off-by Leonardo de Sá Alt <[email protected]>---
arch/x86/kernel/hpet.c | 6 ++----1 files changed, 2 insertions(+), 4 deletions(-)arch/x86/kernel/hpet.c +0
-0@@ -724,12 +724,10 @@ static int hpet_cpuhp_notify(struct notifier_block *n, switch (action & 0xf) {
Quoted 3 lines
case
CPU_ONLINE:
-INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
+INIT_WORK_ON_STACK(&work.work.work, hpet_work);
Can you also change work in hpet_work_struct to work_struct. That should make things a bit more cleaner.
Thanks,
Venki