[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100520161324.5b4b146d.akpm@linux-foundation.org>
Date: Thu, 20 May 2010 16:13:24 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: tim <tim.c.chen@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH 2/2] tmpfs: Make tmpfs scalable with caches for free
blocks
On Tue, 18 May 2010 16:34:32 -0700
tim <tim.c.chen@...ux.intel.com> wrote:
> The current implementation of tmpfs is not scalable.
> The stat_lock is contended whenever we need to get a
> new page, leading to lots of lock contentions. This patch
> makes use of the qtoken library to maintain local
> caches of free pages to speed up getting and returning
> of pages without acquisition of stat_lock. It
> improved the performance of tmpfs by 270% for Aim7 fserver
> workload.
>
> ...
>
> - spin_lock(&sbinfo->stat_lock);
> - sbinfo->free_blocks += pages;
> + spin_lock(&inode->i_lock);
> + qtoken_return(&sbinfo->token_jar, pages);
> inode->i_blocks -= pages*BLOCKS_PER_PAGE;
> - spin_unlock(&sbinfo->stat_lock);
> + spin_unlock(&inode->i_lock);
Well most of the calls into the qtoken layer occur under inode->i_lock.
So did we really need that spinlock inside the qtoken library code?
It is a problem when library code such as qtoken performs its own
internal locking. We have learned that such code is much more useful
and flexible if it performs no locking at all, and requires that
callers provide the locking (lib/rbtree.c, lib/radix-tree.c,
lib/prio_heap.c, lib/flex_array.c, etcetera). Can we follow this
approach with qtoken?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists