Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbcJASxw (ORCPT ); Sat, 1 Oct 2016 14:53:52 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36279 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010AbcJASxf (ORCPT ); Sat, 1 Oct 2016 14:53:35 -0400 From: Manfred Spraul To: Peter Zijlstra , Andrew Morton , Davidlohr Bueso Cc: LKML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , 1vier1@web.de, felixh@informatik.uni-bremen.de, Manfred Spraul Subject: [PATCH 0/2] ipc/sem.c: sem_lock fixes Date: Sat, 1 Oct 2016 20:40:15 +0200 Message-Id: <1475347217-2143-1-git-send-email-manfred@colorfullife.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 679 Lines: 25 Hi Andrew, Hi Peter, Hi Davidlohr, New idea for ipc/sem: The ACQUIRE from spin_lock() will continue to apply only for the load, not for the store. Thus: If we don't want to add arch dependencies into ipc/sem, the only safe option is to use spin_lock()/spin_unlock() instead of spin_unlock_wait(). Or we must stay with the current code, which is a ~9% regression. Thus: - Patch 1 replaces spin_unlock_wait() with spin_lock()/spin_unlock() and removes all memory barriers that are then unnecessary. - Patch 2 adds the hysteresis code. What do you think? The patches passed stress-testing. Andrew: Could you add it into mmots? Perhaps aiming for 4.10. -- Manfred