lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 4 Feb 2013 17:40:47 -0300
From:	Ezequiel Garcia <elezegarcia@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	gregkh <gregkh@...uxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	kernelnewbies <kernelnewbies@...nelnewbies.org>,
	kernel-janitors@...r.kernel.org,
	linux-media <linux-media@...r.kernel.org>,
	devel@...verdev.osuosl.org
Subject: Re: Question about printking

Hi Joe,

On Sat, Feb 2, 2013 at 4:43 PM, Joe Perches <joe@...ches.com> wrote:
> On Sat, 2013-02-02 at 16:30 -0300, Ezequiel Garcia wrote:
>> ptr = kmalloc(sizeof(foo));
>> if (!ptr) {
>>         pr_err("Cannot allocate memory for foo\n");
>>         return -ENOMEM;
>> }
>> His argue against it was that kmalloc already takes care of reporting/printking
>> a good deal of interesting information when this happens.
>
>> Can someone expand a bit on this whole idea? (of abuse of printing,
>> or futility of printing).
>
> k.alloc() takes a GFP_ flag as an arg.
>
> One of those GFP flags is __GFP_NOWARN.
>
> For all failed allocs without GFP_NOWARN
> a message is emitted and a dump_stack is
> done.
>
> (see: mm/page_alloc.c warn_alloc_failed())
>
> So, most all of these printks after
> k.alloc()'s are not necessary.
>
>

Thanks for the explanation.

BTW, I see you've made some patches to fix exactly this.
Nice job.

Regards,

-- 
    Ezequiel
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ