Thread (8 messages) 8 messages, 4 authors, 2019-06-04

RE: [PATCH v2 1/2] fork: add clone3

flat view

From: David Laight <hidden>
Date: 2019-06-04 10:42:26
Also in: lkml

From: Christian Brauner
Sent: 04 June 2019 10:43
...
quoted
quoted
+	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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help