lkml.org 
[lkml]   [2006]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel BUGs when removing largish files with the SLOB allocator
David Howells wrote:
> Matt Mackall <mpm@selenic.com> wrote:
>
>
>>>+ for (i = 0; i < (1 << bb->order); i++) {
>>>+ SetPageSlab(page);
>>>+ page++;
>>>+ }
>>
>>for ( ; page < page + (1 << bb->order), page++)
>> SetPageSlab(page);
>
>
> Ugh. No. You can't do that. "page < page + X" will be true until "page + X"
> wraps the end of memory.
>
>
>>>+ for (i = 0; i < (1 << bb->order); i++) {
>>>+ if (!TestClearPageSlab(page))
>>>+ BUG();
>>>+ page++;
>>>+ }
>>
>>Please drop the BUG. We've already established it's on our lists by
>>this point.
>
>
> I disagree. Let's catch accidental reuse of pages. It should, however, be
> marked unlikely().

If you do this, the biggest problem with those ops is that they are atomic,
and the latter also requires strong memory barriers. Don't use RMW variants,
and use __ prepended iff you are the only user of the page at this point.

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-13 04:19    [W:0.278 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site