Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757133AbXFDWa5 (ORCPT ); Mon, 4 Jun 2007 18:30:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758144AbXFDWaW (ORCPT ); Mon, 4 Jun 2007 18:30:22 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:43457 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757991AbXFDWaU (ORCPT ); Mon, 4 Jun 2007 18:30:20 -0400 Message-ID: <46646747.2080803@cs.helsinki.fi> Date: Mon, 04 Jun 2007 22:25:59 +0300 From: Pekka Enberg User-Agent: Thunderbird 1.5.0.12 (Macintosh/20070509) MIME-Version: 1.0 To: Christoph Lameter CC: Linus Torvalds , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Jeremy Fitzhardinge Subject: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0) References: <84144f020706041213x1d241794u98e9b3ca29865033@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1017 Lines: 26 Christoph Lameter wrote: > That is another patchset. See > http://marc.info/?l=linux-kernel&w=2&r=1&s=DEVELKERNEL&q=b Oh my, I am totally confused now. First you fix kmalloc(0) to be legal and safe. And then you want to DEVEL_WARN_ON_ONCE when size is zero so people can fix their code? I don't get it. I thought we wanted to support kmalloc(0) so that as long as you don't dereference the pointer, it's all legal and good. Right? So we obviously should shut up the WARN_ON because if you do oops, you can clearly see that it happened at ZERO_SIZE_PTR and have a nice stack trace anyway... Btw, if I am again missing something totally obvious, could you please be so kind to send me a batch of the same pills that the smart people take. I am all out. Pekka - 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/