lkml.org 
[lkml]   [2019]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 1/2] fork: add clone3
Date
From: Christian Brauner
> Sent: 04 June 2019 10:43
...
> > > + u64 clone_flags = args->flags;
> > > + int __user *child_tidptr = args->child_tid;
> > > + unsigned long tls = args->tls;
> > > + unsigned long stack_start = args->stack;
> > > + unsigned long stack_size = args->stack_size;
> >
> > Some of these are only used once, so it's probably not worth sticking them in
> > local variables.
>
> [1]:
> Ok, will double check.
> This was just to minimize copy-paste erros for variables which were used
> multiple times.

Even the ones that are used multiple times may be better being
repeatedly read from args->xxx.

If you are "lucky" 'args' will be in a register variables
so all the accesses are cheap.
With too many locals everything gets copied onto the actual
stack - especially likely if there are any function calls
(that might conceivably change *args) after the locals
are initialised.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2019-06-04 12:42    [W:0.131 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site