From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760013AbcIWUUq (ORCPT ); Fri, 23 Sep 2016 16:20:46 -0400 Received: from fallback1.mail.ru ([94.100.181.184]:55274 "EHLO fallback1.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759300AbcIWUUp (ORCPT ); Fri, 23 Sep 2016 16:20:45 -0400 Subject: Re: [PATCH v2] signals: Avoid unnecessary taking of sighand->siglock To: Waiman Long , Andrew Morton , Ingo Molnar , Oleg Nesterov , Thomas Gleixner References: <1474649774-48834-1-git-send-email-Waiman.Long@hpe.com> Cc: linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch From: Stas Sergeev Message-ID: Date: Fri, 23 Sep 2016 22:43:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1474649774-48834-1-git-send-email-Waiman.Long@hpe.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp40.i.mail.ru; auth=pass smtp.auth=stsp@list.ru smtp.mailfrom=stsp@list.ru X-Mailru-Sender: 93A3050EDC2B741E47B042B830B848C5B2F6AAEB326EED222F7778A9DAC248425BB4C05F55CDB697CE06B70447BA4CE8 X-Mras: OK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 23.09.2016 19:56, Waiman Long пишет: > When running certain database workload on a high-end system with many > CPUs, it was found that spinlock contention in the sigprocmask syscalls > became a significant portion of the overall CPU cycles as shown below. Hi, I was recently facing the same problem, and my solution was to extract swapcontext() from libtask - it has better semantic and does not do sigprocmask. How much you hack sigprocmask, it is still faster to just not call it at all. Alternatively, perhaps the speed-up can be achieved if the current mask is exported to glibc via vdso. Just my 2 cents.