lkml.org 
[lkml]   [2000]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] Merge softirq, local_irq_count, local_bh_count
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.052 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site