Message ID | 65929045-FF25-4BFB-BA89-F07A47328F1F@bell.net (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Hi Dave, On 27.09.2015 18:27, John David Anglin wrote: > On 2015-09-22, at 12:20 PM, Helge Deller wrote: >> The baseline for all results is the timing with a vanilla kernel 4.2: >> real 0m13.596s >> user 0m18.152s >> sys 0m35.752s >> >> >> The next results are with the atomic_hash (a) patch applied: >> For ATOMIC_HASH_SIZE = 4. >> real 0m21.892s >> user 0m27.492s >> sys 0m59.704s >> >> For ATOMIC_HASH_SIZE = 64. >> real 0m20.604s >> user 0m24.832s >> sys 0m56.552s >> > Attached is a revised patch "a" to try to improve performance of atomic_t variables. If you get a chance, could > you see how it performs. here are the numbers for your revised "a" patch (on top of vanilla kernel 4.2): real 0m20.040s user 0m22.876s sys 0m56.724s (Variations can be around +- 0.5 seconds) If you want to test yourself: The testcase executable is on sibaris: /home/var_lib_sbuild_build/libatomic/libatomic-ops-7.4.2/test_atomic Helge -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 2015-09-28 11:57 AM, Helge Deller wrote: > Hi Dave, > > On 27.09.2015 18:27, John David Anglin wrote: >> On 2015-09-22, at 12:20 PM, Helge Deller wrote: >>> The baseline for all results is the timing with a vanilla kernel 4.2: >>> real 0m13.596s >>> user 0m18.152s >>> sys 0m35.752s >>> >>> >>> The next results are with the atomic_hash (a) patch applied: >>> For ATOMIC_HASH_SIZE = 4. >>> real 0m21.892s >>> user 0m27.492s >>> sys 0m59.704s >>> >>> For ATOMIC_HASH_SIZE = 64. >>> real 0m20.604s >>> user 0m24.832s >>> sys 0m56.552s >>> >> Attached is a revised patch "a" to try to improve performance of atomic_t variables. If you get a chance, could >> you see how it performs. > here are the numbers for your revised "a" patch (on top of vanilla kernel 4.2): > > real 0m20.040s > user 0m22.876s > sys 0m56.724s > (Variations can be around +- 0.5 seconds) > > If you want to test yourself: > The testcase executable is on sibaris: /home/var_lib_sbuild_build/libatomic/libatomic-ops-7.4.2/test_atomic It doesn't seem like the padding has much difference. I had hoped for better although the test probably doesn't test atomic_t variables. The regression from the the vanilla kernel is a problem. Dave
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index 226f8ca9..a5c6de5 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h @@ -25,8 +25,8 @@ * Hash function to index into a different SPINLOCK. * Since "a" is usually an address, use one spinlock per cacheline. */ -# define ATOMIC_HASH_SIZE 4 -# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) +# define ATOMIC_HASH_SIZE 64 +# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/SMP_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; diff --git a/arch/parisc/include/asm/spinlock_types.h b/arch/parisc/include/asm/spinlock_types.h index 8c373aa..8c54f5e 100644 --- a/arch/parisc/include/asm/spinlock_types.h +++ b/arch/parisc/include/asm/spinlock_types.h @@ -4,7 +4,8 @@ typedef struct { #ifdef CONFIG_PA20 volatile unsigned int slock; -# define __ARCH_SPIN_LOCK_UNLOCKED { 1 } + volatile unsigned int pad[3]; +# define __ARCH_SPIN_LOCK_UNLOCKED { 1, { 1, 1, 1 } } #else volatile unsigned int lock[4]; # define __ARCH_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } }