From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13906 invoked by alias); 14 Jan 2019 23:26:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 13893 invoked by uid 89); 14 Jan 2019 23:26:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Message-ID: <1c5330189c18781afec2db7b47158de2dea041b8.camel@redhat.com> Subject: Re: [PATCH] NUMA spinlock [BZ #23962] From: Torvald Riegel To: Ma Ling , libc-alpha@sourceware.org Cc: hongjiu.lu@intel.com, "ling.ma" , Wei Xiao Date: Mon, 14 Jan 2019 23:26:00 -0000 In-Reply-To: <20181226025019.38752-1-ling.ma@MacBook-Pro-8.local> References: <20181226025019.38752-1-ling.ma@MacBook-Pro-8.local> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00313.txt.bz2 On Wed, 2018-12-26 at 10:50 +0800, Ma Ling wrote: > 2. Critical Section Integration (CSI) > Essentially spinlock is similar to that one core complete critical > sections one by one. So when contention happen, the serialized works > are sent to the core who is the lock owner and responsible to execute > them, that can save much time and power, because all shared data are > located in private cache of the lock owner. I agree that this can improve performance because of potentially both increasing data locality for the critical sections themselves and decreasing contention in the lock. However, this will mess with thread- local storage and assumptions about what OS thread a critical section runs on. Maybe it's better to first experiment with this change in semantics in C++; ISO C++ Study Group 1 on parallelism and concurrency is much deeper into this topic than the glibc community is. This isn't really a typical lock anymore when you do that, but rather a special kind of execution service for small functions; the study group has talked about executors that execute in guaranteed sequential fashion.