lkml.org 
[lkml]   [2013]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] coredump: kill call_count, add core_name_size
On Wed, 15 May 2013 22:12:32 +0200 Oleg Nesterov <oleg@redhat.com> wrote:

> Imho, "atomic_t call_count" is ugly and should die. It buys
> nothing and in fact it can grow more than necessary, expand
> doesn't check if it was already incremented by another task.
>
> Kill it, and introduce "static int core_name_size" updated by
> expand_corename(). This is obviously racy too but harmless,
> and core_name_size never grows for no reason.
>
> We do not bother to to calculate the "right" new size, we
> simply do kmalloc(size_we_need) and use ksize() to rely on
> kmalloc_index's decision.
>
> Finally change format_corename() to use expand_corename(),
> krealloc(NULL) is fine.

The code still looks like a bunch of fluff. I look at it and think
"wtf, why doesn't it just use kasprintf()".

If there were any comments in there at all which explained the reason
for the code's existence, perhaps I wouldn't think that. But there
aren't, so I do.



\
 
 \ /
  Last update: 2013-05-24 22:41    [W:0.113 / U:1.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site