lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 16/24] link_path_walk: kill the recursion
From
On Mon, Apr 20, 2015 at 11:13 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> */
> static int link_path_walk(const char *name, struct nameidata *nd)
> {
> + struct saved {
> + struct path link;
> + void *cookie;
> + const char *name;
> + } stack[MAX_NESTED_LINKS], *last = stack + nd->depth - 1;
> struct path next;
> int err;

I was going to complain about this, and suggest that you move it to
the nameidata, but I see that you did that later.

That said, you then introduce a stack-allocated "struct saved stack[]"
in path_mountpoint[] instead, *and* nameidata is saved on stack, so
this all ends up being very stack-intensive anyway.

I might have missed some patch here, but would it be possible to just
allocate a single per-thread nameidata, and just leave it at that?
Because allocating that thing on the stack when it contains what is
now one kilobyte of array data is *not* acceptable.

Other than that, my quick scan through this looked fine. And maybe
that quick scan missed where you already did that too.

Linus


\
 
 \ /
  Last update: 2015-04-20 23:21    [W:0.230 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site