From: Andrew Morton <akpm@linux-foundation.org>
To: tim <tim.c.chen@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH 2/2] tmpfs: Make tmpfs scalable with caches for free blocks
Date: Thu, 20 May 2010 16:13:24 -0700 [thread overview]
Message-ID: <20100520161324.5b4b146d.akpm@linux-foundation.org> (raw)
In-Reply-To: <1274225672.31973.8951.camel@mudge.jf.intel.com>
On Tue, 18 May 2010 16:34:32 -0700
tim <tim.c.chen@linux.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?
next prev parent reply other threads:[~2010-05-20 23:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-18 23:34 [PATCH 2/2] tmpfs: Make tmpfs scalable with caches for free blocks tim
2010-05-20 23:13 ` Andrew Morton [this message]
2010-05-26 19:33 ` Tim Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100520161324.5b4b146d.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ak@linux.intel.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tim.c.chen@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).