Hi all, I took Luca's advice to isolate the deadline wrap-around bugfix with a first minimally invasive patch (1-line). This leaves some weirdness in how cpudl_change_key() is called. Therefore, the second patch does a minimum of refactory to make things more explicit and clear. The 3rd patch contains now the actual performance enhancement (avoiding unneeded swaps during heapify operations), which, as said in the previous post, achieves up to 6% of speed-up for cpudl_set() calls. Finally, the 4th patch is another clear-up patch touching cpudeadline.{h,c} and deadline.c. Now you call cpudl_clear(cp, cpu) and cpudl_set(cp, cpu, dl) instead of cpudl_set(cp, cpu, 0 /* dl */, 0 /* is_valid */) and cpudl_set(cp, cpu, dl, 1 /* is_valid */).
Please, let me know how this looks like now. Thanks, Tommaso