diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2006-01-12 18:26:42 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-13 05:17:39 -0500 |
commit | 3356bb9f7ba378a6e2709f9df95f4ea52111f4df (patch) | |
tree | 84f370df6e58cec63132f9acce492d585226e671 /arch/powerpc/lib | |
parent | e58c3495e6007af59382540bb21ee941e470d88d (diff) |
[PATCH] powerpc: Remove lppaca structure from the PACA
At present the lppaca - the structure shared with the iSeries
hypervisor and phyp - is contained within the PACA, our own low-level
per-cpu structure. This doesn't have to be so, the patch below
removes it, making a separate array of lppaca structures.
This saves approximately 500*NR_CPUS bytes of image size and kernel
memory, because we don't need aligning gap between the Linux and
hypervisor portions of every PACA. On the other hand it means an
extra level of dereference in many accesses to the lppaca.
The patch also gets rid of several places where we assign the paca
address to a local variable for no particular reason.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/locks.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c index 35bd03c41dd1..8362fa272ca5 100644 --- a/arch/powerpc/lib/locks.c +++ b/arch/powerpc/lib/locks.c | |||
@@ -28,15 +28,13 @@ | |||
28 | void __spin_yield(raw_spinlock_t *lock) | 28 | void __spin_yield(raw_spinlock_t *lock) |
29 | { | 29 | { |
30 | unsigned int lock_value, holder_cpu, yield_count; | 30 | unsigned int lock_value, holder_cpu, yield_count; |
31 | struct paca_struct *holder_paca; | ||
32 | 31 | ||
33 | lock_value = lock->slock; | 32 | lock_value = lock->slock; |
34 | if (lock_value == 0) | 33 | if (lock_value == 0) |
35 | return; | 34 | return; |
36 | holder_cpu = lock_value & 0xffff; | 35 | holder_cpu = lock_value & 0xffff; |
37 | BUG_ON(holder_cpu >= NR_CPUS); | 36 | BUG_ON(holder_cpu >= NR_CPUS); |
38 | holder_paca = &paca[holder_cpu]; | 37 | yield_count = lppaca[holder_cpu].yield_count; |
39 | yield_count = holder_paca->lppaca.yield_count; | ||
40 | if ((yield_count & 1) == 0) | 38 | if ((yield_count & 1) == 0) |
41 | return; /* virtual cpu is currently running */ | 39 | return; /* virtual cpu is currently running */ |
42 | rmb(); | 40 | rmb(); |
@@ -60,15 +58,13 @@ void __rw_yield(raw_rwlock_t *rw) | |||
60 | { | 58 | { |
61 | int lock_value; | 59 | int lock_value; |
62 | unsigned int holder_cpu, yield_count; | 60 | unsigned int holder_cpu, yield_count; |
63 | struct paca_struct *holder_paca; | ||
64 | 61 | ||
65 | lock_value = rw->lock; | 62 | lock_value = rw->lock; |
66 | if (lock_value >= 0) | 63 | if (lock_value >= 0) |
67 | return; /* no write lock at present */ | 64 | return; /* no write lock at present */ |
68 | holder_cpu = lock_value & 0xffff; | 65 | holder_cpu = lock_value & 0xffff; |
69 | BUG_ON(holder_cpu >= NR_CPUS); | 66 | BUG_ON(holder_cpu >= NR_CPUS); |
70 | holder_paca = &paca[holder_cpu]; | 67 | yield_count = lppaca[holder_cpu].yield_count; |
71 | yield_count = holder_paca->lppaca.yield_count; | ||
72 | if ((yield_count & 1) == 0) | 68 | if ((yield_count & 1) == 0) |
73 | return; /* virtual cpu is currently running */ | 69 | return; /* virtual cpu is currently running */ |
74 | rmb(); | 70 | rmb(); |