xen: in do_softirq() sample smp_processor_id() only once.
authorDario Faggioli <dario.faggioli@citrix.com>
Wed, 30 Aug 2017 11:06:20 +0000 (12:06 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 30 Aug 2017 11:06:20 +0000 (12:06 +0100)
commit57450cfe48b56db90166c52d45a411a9279a12e1
treec70cdc0b5b4cbd916a608d7adb9715920c67eada
parent9e675671cac6c7f6ab2a7cdd193869da27e113ba
xen: in do_softirq() sample smp_processor_id() only once.

In fact, right now, we read it at every iteration of the loop.
The reason it's done like this is how context switch was handled
on IA64 (see commit ae9bfcdc, "[XEN] Various softirq cleanups" [1]).

However:
1) we don't have IA64 any longer, and all the achitectures that
   we do support, are ok with sampling once and for all;
2) sampling at every iteration (slightly) affect performance;
3) sampling at every iteration is misleading, as it makes people
   believe that it is currently possible that SCHEDULE_SOFTIRQ
   moves the execution flow on another CPU (and the comment,
   by reinforcing this belief, makes things even worse!).

Therefore, let's:
- do the sampling only once, and remove the comment;
- leave an ASSERT() around, so that, if context switching
  logic changes (in current or new arches), we will notice.

[1] Some more (historical) information here:
    http://old-list-archives.xenproject.org/archives/html/xen-devel/2006-06/msg01262.html

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/common/softirq.c