This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] NUMA spinlock [BZ #23962]


    > 1. MCS spinlock
    > MCS spinlock help us to reduce the useless lock movement in the
    > spinning state.  This paper provides a good description for this
    > kind of lock:
    
    That's not the truth.
    No matter generic spinlock(or x86 version) spinlock has used the way of 
    test and test_and_set to reduce the useless lock movement in the spinning 
    state.
    
    See
    glibc/nptl/pthread_spin_lock.c
    glibc/sysdeps/x86_64/nptl/pthread_spin_lock.S
  
    What MCS-spinlock really helps is to accelerate lock release and lock acquisition
    by reducing lots of cache line bouncing.
  Ling: 
	Thanks for your comments.
	1.in spinning stage current generic spinlock will read lock, then lock is stored in private cache among cores with shared state.
     when one core update the lock ,those cores containing the shared cache line will be noted ,invalidated lock then response to the cache controller
	 the messages transmission spend much time, but they can be reduced by mcs lock
	2. atomic_compare_exchange_weak_acquire cause plenty of useless lock movement because only one core can acquire lock 
    
	mcs will transmit the lock one by one with private data, so we say it reduce useless lock movement from above scenario 1 and 2.

    > NUMA spinlock can greatly speed up critical section on multi-socket
    > systems.  It should improve spinlock performance on all multi-socket
    > systems. 
    > 
    
    This is out-of-question that NUMA spinlock helps a lot in case of heavy lock
    contention. But, we should also propose the data for non-contented case and slight
    contended case.

   Ling: we will also present report hashwork like adaptive-mcs patch.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]