From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751494AbcGNQkR (ORCPT ); Thu, 14 Jul 2016 12:40:17 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36037 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbcGNQkN (ORCPT ); Thu, 14 Jul 2016 12:40:13 -0400 Subject: Re: [PATCH 0/2] ipc/sem.c: sem_lock fixes To: Andrew Morton References: <1468386412-3608-1-git-send-email-manfred@colorfullife.com> <20160713150525.8f703dfa5e83a534f8a51106@linux-foundation.org> Cc: "H. Peter Anvin" , Peter Zijlstra , Davidlohr Bueso , LKML , Thomas Gleixner , Ingo Molnar , 1vier1@web.de, felixh@informatik.uni-bremen.de From: Manfred Spraul Message-ID: <1c8a2159-ea79-efdd-9a6b-c49e0267b477@colorfullife.com> Date: Thu, 14 Jul 2016 18:40:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160713150525.8f703dfa5e83a534f8a51106@linux-foundation.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On 07/14/2016 12:05 AM, Andrew Morton wrote: > On Wed, 13 Jul 2016 07:06:50 +0200 Manfred Spraul wrote: > >> Hi Andrew, Hi Peter, >> >> next version of the sem_lock() fixes: >> The patches are again vs. tip. >> >> Patch 1 is ready for merging, Patch 2 is for review. >> >> - Patch 1 is the patch as in -next since January >> It fixes the race that was found by Felix. >> - Patch 2 removes the memory barriers that are part of the qspinlock >> code. >> - (The hysteresis patch would be patch 3. The risk of regressions >> can't be ruled out, thus it must wait for benchmarks from real >> workload tests) > I think you're saying that if these two patches cause performance > regressions, we will need ipc-sem-sem_lock-with-hysteresis.patch? No, the two patches will not cause any regressions. Commit 6062a8dc051 ("ipc,sem: fine grained locking for semtimedop") was a huge scalability improvement for 99% of the users, but introduced a regression for one workload. Noone complained about it, so the workload must be rare. Patch 3 now fixes the regression. But we live with the introduced regression for 3 years, so give me (and Davidlohr, and anyone else who wants to support) some more time. Also on my TODO list: The queue merge/unmerge logic, i.e. commit f269f40ad5ae ("ipc/sem.c: always use only one queue for alter operations") might also win from some hysteresis. My proposal: - patch 1: merge towards main tree. - patch 2: needs update. The barrier in sem_lock() is required. I'm not yet sure about complexmode_enter(), perhaps with #ifndef CONFIG_QUEUED_SPINLOCKS - patch 3 should wait. -- Manfred