From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753245AbdHNNDf (ORCPT ); Mon, 14 Aug 2017 09:03:35 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:20314 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbdHNNDe (ORCPT ); Mon, 14 Aug 2017 09:03:34 -0400 Date: Mon, 14 Aug 2017 16:02:21 +0300 From: Dan Carpenter To: Catalin Marinas Cc: SF Markus Elfring , linux-mm@kvack.org, LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions Message-ID: <20170814130220.q5w4fsbngphniqzc@mwanda> References: <301bc8c9-d9f6-87be-ce1d-dc614e82b45b@users.sourceforge.net> <986426ab-4ca9-ee56-9712-d06c25a2ed1a@users.sourceforge.net> <20170814111430.lskrrg3fygpnyx6v@armageddon.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170814111430.lskrrg3fygpnyx6v@armageddon.cambridge.arm.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 14, 2017 at 12:14:32PM +0100, Catalin Marinas wrote: > On Mon, Aug 14, 2017 at 11:35:02AM +0200, SF Markus Elfring wrote: > > From: Markus Elfring > > Date: Mon, 14 Aug 2017 10:50:22 +0200 > > > > Omit an extra message for a memory allocation failure in these functions. > > > > This issue was detected by using the Coccinelle software. > > > > Signed-off-by: Markus Elfring > > --- > > mm/kmemleak.c | 5 +---- > > 1 file changed, 1 insertion(+), 4 deletions(-) > > > > diff --git a/mm/kmemleak.c b/mm/kmemleak.c > > index 7780cd83a495..c6c798d90b2e 100644 > > --- a/mm/kmemleak.c > > +++ b/mm/kmemleak.c > > @@ -555,7 +555,6 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, > > > > object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); > > if (!object) { > > - pr_warn("Cannot allocate a kmemleak_object structure\n"); > > kmemleak_disable(); > > I don't really get what this patch is trying to achieve. Given that > kmemleak will be disabled after this, I'd rather know why it happened. kmem_cache_alloc() will generate a stack trace and a bunch of more useful information if it fails. The allocation isn't likely to fail, but if it does you will know. The extra message is just wasting RAM. regards, dan carpenter