From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752718AbcERB1A (ORCPT ); Tue, 17 May 2016 21:27:00 -0400 Received: from g2t4622.austin.hp.com ([15.73.212.79]:60076 "EHLO g2t4622.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbcERB07 (ORCPT ); Tue, 17 May 2016 21:26:59 -0400 From: Waiman Long To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Davidlohr Bueso , Jason Low , Dave Chinner , Peter Hurley , "Paul E. McKenney" , Scott J Norton , Douglas Hatch , Waiman Long Subject: [PATCH v4 0/5] [PATCH v3 0/4] locking/rwsem: Add reader-owned state to the owner field Date: Tue, 17 May 2016 21:26:18 -0400 Message-Id: <1463534783-38814-1-git-send-email-Waiman.Long@hpe.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v3->v4: - Add a new patch 2 to use WRITE_ONCE() for all rwsem->owner stores to prevent store tearing. v2->v3: - Make minor code changes as suggested by PeterZ & Peter Hurley. - Add 2 minor patches (#2 & #3) to improve the rwsem code - Add a 4th patch to streamline the rwsem_optimistic_spin() code. v1->v2: - Add rwsem_is_reader_owned() helper & rename rwsem_reader_owned() to rwsem_set_reader_owned(). - Add more comments to clarify the purpose of some of the code changes. Patch 1 is the main patch of this series. Patch 2 protects against store tearing of rwsem->owner field which can cause problem when a reader tries to dereference it. Patch 3 eliminates redundant wakeup caused by a reader waking itself. Patch 4 improves the efficiency of the reader wakeup code. Patch 5 streamlines the rwsem_optimistic_spin() to make it simpler. Waiman Long (5): locking/rwsem: Add reader-owned state to the owner field locking/rwsem: Protect all writes to owner by WRITE_ONCE() locking/rwsem: Don't wake up one's own task locking/rwsem: Improve reader wakeup code locking/rwsem: Streamline the rwsem_optimistic_spin() code kernel/locking/rwsem-xadd.c | 75 ++++++++++++++++++++++++------------------ kernel/locking/rwsem.c | 8 +++- kernel/locking/rwsem.h | 52 ++++++++++++++++++++++++++++- 3 files changed, 99 insertions(+), 36 deletions(-)