From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932518AbcKGQG6 (ORCPT ); Mon, 7 Nov 2016 11:06:58 -0500 Received: from one.firstfloor.org ([193.170.194.197]:56601 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932327AbcKGQG4 (ORCPT ); Mon, 7 Nov 2016 11:06:56 -0500 Date: Mon, 7 Nov 2016 08:06:53 -0800 From: Andi Kleen To: Vitaly Wool Cc: Andi Kleen , Linux-MM , LKML , Dan Streetman , Andrew Morton Subject: Re: [PATCH/RFC] z3fold: use per-page read/write lock Message-ID: <20161107160652.GJ26852@two.firstfloor.org> References: <20161105144946.3b4be0ee799ae61a82e1d918@gmail.com> <87lgwxo5u9.fsf@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I understand the reinvention part but you're not quite accurate here > with the numbers. > > E. g. on x86_64: > (gdb) p sizeof(rwlock_t) > $1 = 8 I was talking about spinlocks which are 4 bytes. Just use a spinlock then. rwlocks are usually a bad idea anyways because they often scale far worse than spinlocks due to the bad cache line bouncing behavior, and it doesn't make much difference unless your critical section is very long. -Andi