Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752162AbbDVUTa (ORCPT ); Wed, 22 Apr 2015 16:19:30 -0400 Received: from g4t3426.houston.hp.com ([15.201.208.54]:42545 "EHLO g4t3426.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbbDVUT3 (ORCPT ); Wed, 22 Apr 2015 16:19:29 -0400 Message-ID: <5538024B.9040109@hp.com> Date: Wed, 22 Apr 2015 16:19:23 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Jason Low CC: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Subject: Re: [PATCH] locking/rwsem: reduce spinlock contention in wakeup after up_read/up_write References: <1429322598-44362-1-git-send-email-Waiman.Long@hp.com> <1429561424.8820.24.camel@j-VirtualBox> In-Reply-To: <1429561424.8820.24.camel@j-VirtualBox> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1178 Lines: 30 On 04/20/2015 04:23 PM, Jason Low wrote: > On Fri, 2015-04-17 at 22:03 -0400, Waiman Long wrote: > >> diff --git a/include/linux/osq_lock.h b/include/linux/osq_lock.h >> index 3a6490e..703ea5c 100644 >> --- a/include/linux/osq_lock.h >> +++ b/include/linux/osq_lock.h >> @@ -32,4 +32,9 @@ static inline void osq_lock_init(struct optimistic_spin_queue *lock) >> extern bool osq_lock(struct optimistic_spin_queue *lock); >> extern void osq_unlock(struct optimistic_spin_queue *lock); >> >> +static inline bool osq_is_locked(struct optimistic_spin_queue *lock) >> +{ >> + return atomic_read(&lock->tail) != OSQ_UNLOCKED_VAL; >> +} > Would it be better to separate the addition of osq_is_locked() into its > own patch, since this can be useful for other situations and isn't just > specific to the rwsem optimization. > I think the osq_lock.h change is too simple and straight forward to warrant a separate patch. Cheers, Longman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/