Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 1 Jun 2007, Christoph Lameter wrote:
> 
> A too large alloc is >32MB or MAX_ORDER << PAGE_SIZE. A BUG_ON in 
> kmalloc_slab() will trigger.

Did we use to BUG_ON()? I think that's wrong. There are ways for users to 
potentially ask the kernel to do big allocations, and the correct response 
is to say "no can do", not to crash!

> Here is the updated patch. It works fine here:
> 
> SLUB: Return BADPTR instead of warning for kmalloc(0)

Looks fine to me. My only comment is that

> -	if (!x)
> +	if (!x || x == BADPTR)
>  		return;

This could be micro-optimized (again, non-standard, but it should be 
"practically portable") to have just a single test using something like

	if ((unsigned long)x <= 16)
		return;

but I guess it doesn't really matter much.

I think this is better than what we have now, but I also suspect it's 
*not* something we should try this late in the -rc sequence ;)

Andrew, want to take this patch to -mm to see if it triggers anything?

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux