[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A225ADD.5070605@cs.helsinki.fi>
Date: Sun, 31 May 2009 13:24:29 +0300
From: Pekka Enberg <penberg@...helsinki.fi>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
CC: Rik van Riel <riel@...hat.com>, Ingo Molnar <mingo@...e.hu>,
"Larry H." <research@...reption.com>, linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...l.org>, linux-mm@...ck.org,
Ingo Molnar <mingo@...hat.com>, pageexec@...email.hu,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [patch 0/5] Support for sanitization flag in low-level page
allocator
Hi Alan,
On Sun, May 31, 2009 at 2:10 AM, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
>>> #2 Using kzfree() to clear specific bits of memory (and I question the
>>> kzfree implementation as it seems ksize can return numbers much much
>>> bigger than the allocated space you need to clear - correct but oversize)
>>> or using other flags. I'd favour kzfree personally (and fixing it to work
>>> properly)
>> Well, yes, that's what kzfree() needs to do given the current API. I
>> am not sure why you think it's a problem, though. Adding a size
>> argument to the function will make it more error prone.
Alan Cox wrote:
> Definitely - am I right however that
>
> x = kzalloc(size, flags)
> blah
> kzfree(x)
>
> can memset a good deal more memory (still safely) than "size" to zero ?
Yes because we actually _allocate_ more than requested the 'size' and
the generic allocator has no way of knowing whether how much of the
allocated region was actually used by the caller.
Alan Cox wrote:
> That has performance relevance if so and it ought to at least be
> documented.
Makes sense.
Pekka
--
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