Skip to contentSkip to conversation

linux-next: manual merge of the tip tree with the workqueues tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Feb 26, 2024 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the tip tree got a conflict in:

kernel/workqueue.c

between commit:

aae17ebb53cd ("workqueue: Avoid using isolated cpus' timers on queue_delayed_work")

from the workqueues tree and commit:

c0e8c5b59949 ("workqueue: Use global variant for add_timer()")

from the tip tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 30 lines
Cheers,
Stephen Rothwell

diff --cc kernel/workqueue.c
index 65a27be81452,78eaea2e5d72..000000000000
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@@ -2545,18 -1958,10 +2545,18 @@@ static void __queue_delayed_work(int cp
  	dwork->cpu = cpu;
  	timer->expires = jiffies + delay;
  
 -	if (unlikely(cpu != WORK_CPU_UNBOUND))
 +	if (housekeeping_enabled(HK_TYPE_TIMER)) {
 +		/* If the current cpu is a housekeeping cpu, use it. */
 +		cpu = smp_processor_id();
 +		if (!housekeeping_test_cpu(cpu, HK_TYPE_TIMER))
 +			cpu = housekeeping_any_cpu(HK_TYPE_TIMER);
  		add_timer_on(timer, cpu);
 -	else
 -		add_timer_global(timer);
 +	} else {
 +		if (likely(cpu == WORK_CPU_UNBOUND))
- 			add_timer(timer);
++			add_timer_global(timer);
 +		else
 +			add_timer_on(timer, cpu);
 +	}
  }
  
  /**
#1 lore raw
Quoted 45 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the tip tree got a conflict in:

kernel/workqueue.c

between commit:

aae17ebb53cd ("workqueue: Avoid using isolated cpus' timers on queue_delayed_work")

from the workqueues tree and commit:

c0e8c5b59949 ("workqueue: Use global variant for add_timer()")

from the tip tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

--
Cheers,
Stephen Rothwell

kernel/workqueue.c +0 -0
diff --cc kernel/workqueue.c
index 65a27be81452,78eaea2e5d72..000000000000
@@@ -2545,18 -1958,10 +2545,18 @@@ static void __queue_delayed_work(int cp
        dwork->cpu = cpu;
        timer->expires = jiffies + delay;
 
 -      if (unlikely(cpu != WORK_CPU_UNBOUND))
 +      if (housekeeping_enabled(HK_TYPE_TIMER)) {
 +              /* If the current cpu is a housekeeping cpu, use it. */
 +              cpu = smp_processor_id();
 +              if (!housekeeping_test_cpu(cpu, HK_TYPE_TIMER))
 +                      cpu = housekeeping_any_cpu(HK_TYPE_TIMER);
                add_timer_on(timer, cpu);
 -      else
 -              add_timer_global(timer);

kernel/workqueue.c

Quoted 10 lines
kernel/workqueue.c +1 -1
 +      } else {
 +              if (likely(cpu == WORK_CPU_UNBOUND))
-                       add_timer(timer);
++                      add_timer_global(timer);
 +              else
 +                      add_timer_on(timer, cpu);
 +      }
  }
 
  /**

Fix looks perfect.

Thanks Stephen!
Leo