[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080508054931.GB8276@duo.random>
Date: Thu, 8 May 2008 07:49:31 +0200
From: Andrea Arcangeli <andrea@...ranet.com>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Christoph Lameter <clameter@....com>,
Andrew Morton <akpm@...ux-foundation.org>, steiner@....com,
holt@....com, npiggin@...e.de, a.p.zijlstra@...llo.nl,
kvm-devel@...ts.sourceforge.net, kanojsarcar@...oo.com,
rdreier@...co.com, swise@...ngridcomputing.com,
linux-kernel@...r.kernel.org, avi@...ranet.com, linux-mm@...ck.org,
general@...ts.openfabrics.org, hugh@...itas.com,
rusty@...tcorp.com.au, aliguori@...ibm.com, chrisw@...hat.com,
marcelo@...ck.org, dada1@...mosbay.com, paulmck@...ibm.com
Subject: Re: [PATCH 08 of 11] anon-vma-rwsem
On Thu, May 08, 2008 at 08:30:20AM +0300, Pekka Enberg wrote:
> On Thu, May 8, 2008 at 8:27 AM, Pekka Enberg <penberg@...helsinki.fi> wrote:
> > You might want to read carefully what Linus wrote:
> >
> > > The one that already has a 4 byte padding thing on x86-64 just after the
> > > spinlock? And that on 32-bit x86 (with less than 256 CPU's) would have two
> > > bytes of padding if we didn't just make the spinlock type unconditionally
> > > 32 bits rather than the 16 bits we actually _use_?
> >
> > So you need to add the flag _after_ ->lock and _before_ ->head....
>
> Oh should have taken my morning coffee first, before ->lock works
> obviously as well.
Sorry, Linus's right: I didn't realize the "after the spinlock" was
literally after the spinlock, I didn't see the 4 byte padding when I
read the code and put the flag:1 in. If put between ->lock and ->head
it doesn't take more memory on x86-64 as described literlly. So the
next would be to find another place like that in the address
space. Perhaps after the private_lock using the same trick or perhaps
the slab alignment won't actually alter the number of slabs per page
regardless.
I leave that to Christoph, he's surely better than me at doing this, I
give it up entirely and I consider my attempt to merge a total failure
and I strongly regret it.
On a side note the anon_vma will change to this when XPMEM support is
compiled in:
struct anon_vma {
- spinlock_t lock; /* Serialize access to vma list */
+ atomic_t refcount; /* vmas on the list */
+ struct rw_semaphore sem;/* Serialize access to vma list */
struct list_head head; /* List of private "related" vmas
*/
};
not sure if it'll grow in size or not after that but let's say it's
not a big deal.
--
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