From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbcKEXi0 (ORCPT ); Sat, 5 Nov 2016 19:38:26 -0400 Received: from mga11.intel.com ([192.55.52.93]:6628 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbcKEXiY (ORCPT ); Sat, 5 Nov 2016 19:38:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,450,1473145200"; d="scan'208";a="1064544517" From: Andi Kleen To: Vitaly Wool Cc: Linux-MM , linux-kernel@vger.kernel.org, Dan Streetman , Andrew Morton Subject: Re: [PATCH/RFC] z3fold: use per-page read/write lock References: <20161105144946.3b4be0ee799ae61a82e1d918@gmail.com> Date: Sat, 05 Nov 2016 16:38:22 -0700 In-Reply-To: <20161105144946.3b4be0ee799ae61a82e1d918@gmail.com> (Vitaly Wool's message of "Sat, 5 Nov 2016 14:49:46 +0100") Message-ID: <87lgwxo5u9.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Wool writes: > Most of z3fold operations are in-page, such as modifying z3fold > page header or moving z3fold objects within a page. Taking > per-pool spinlock to protect per-page objects is therefore > suboptimal, and the idea of having a per-page spinlock (or rwlock) > has been around for some time. However, adding one directly to the > z3fold header makes the latter quite big on some systems so that > it won't fit in a signle chunk. > + atomic_t page_lock; This doesnt make much sense. A standard spinlock is not bigger than 4 bytes either. Also reinventing locks is usually a bad idea: they are tricky to get right, you have no debugging support, hard to analyze, etc. -Andi