mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blockgroup_lock: hashed spinlocks for ext2 and ext3
Date: Mon, 14 Apr 2003 14:38:13 -0700	[thread overview]
Message-ID: <20030414143813.329609a6.akpm@digeo.com> (raw)
In-Reply-To: <1050350782.7912.400.camel@averell>

Andi Kleen <ak@suse.de> wrote:
>
> > +
> > +struct bgl_lock {
> > +	spinlock_t lock;
> > +} ____cacheline_aligned_in_smp;
> > +
> > +struct blockgroup_lock {
> > +	struct bgl_lock locks[NR_BG_LOCKS];
> > +};
> 
> Why don't you use per_cpu data for this ? It can be indexed as well
> with per_cpu() and it would safe a lot of space because the padding
> would not be all wasted. If you want more than NR_CPUS locks it could be
> done using a simple two level index scheme.

per_cpu data is statically allocated, at compile-time.  And it doesn't work
for modules.

These hashed locks need to be dynamically allocated (one per filesystem) and
they need to work from modules.

And this hashed lock is not a per-cpu thing.  (No locks are!) It just uses
NR_CPUS to decide how big the hash should be.


  reply	other threads:[~2003-04-14 21:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200304131113.h3DBDvj2004773@hera.kernel.org>
2003-04-14 20:06 ` Andi Kleen
2003-04-14 21:38   ` Andrew Morton [this message]
2003-04-14 21:46     ` Andi Kleen
2003-04-14 21:58       ` Andrew Morton

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=20030414143813.329609a6.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®