[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1203010901020.5004@router.home>
Date: Thu, 1 Mar 2012 09:03:16 -0600 (CST)
From: Christoph Lameter <cl@...two.org>
To: Namhyung Kim <namhyung@...il.com>
cc: Namhyung Kim <namhyung.kim@....com>,
Pekka Enberg <penberg@...nel.org>,
Matt Mackall <mpm@...enic.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] slub: set PG_slab on all of slab pages
On Thu, 1 Mar 2012, Namhyung Kim wrote:
> > You cannot free a tail page of a compound higher order page independently.
> > You must free the whole compound.
> >
>
> I meant freeing a *slab object* resides in a compound page using buddy
> system API (e.g. free_pages). I know it's definitely a programming
> error. However there's no safety net to protect and/or warn such a
> misbehavior AFAICS - except for head page which has PG_slab set - when
> it happened by any chance.
?? One generally passed a struct page pointer to the page allocator. Slab
allocator takes pointers to object. The calls that take a pointer to an
object must have a page aligned value.
> Without it, it might be possible to free part of tail pages silently,
> and cause unexpected not-so-funny results some time later. It should be
> hard to find out.
Ok then fix the page allocator to BUG() on tail pages. That is an issue
with the page allocator not the slab allocator.
Adding PG_tail to the flags checked on free should do the trick (at least
for 64 bit).
--
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