Re: [RFC] Merge softirq, local_irq_count, local_bh_count

From: Russell King (rmk@arm.linux.org.uk)
Date: Thu Jul 27 2000 - 17:22:38 EST


Keith Owens writes:
> Except for the places where cpu is a variable instead of smp_processor_id(),
> those places might generate array access code.

They shouldn't do - GCC should realise that code like:

        int this_cpu = 0;

        array_access[this_cpu].foo = 0;
        array_access[this_cpu].bar = 1;

can be optimised. So long as "this_cpu" remains an auto variable, then
it should be ok.

> I thought about using a
> single set of macros and always defining irq_stat[NR_CPUS], trusting to
> gcc to optimize the array access away for UP but decided to err on the
> side of caution.

We relied on it before, so why can't we rely on it again?

> As for readability, almost all the existing code
> defines SMP and UP versions, at least this patch reduces to one
> definition instead of one per arch with subtly different definitions.

There's no argument there. Its only that it can be improved further
with very little effort.
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:25 EST