RE: [PATCH 1/1] mm:improve the performance during fork

From: David Laight
Date: Tue Dec 22 2020 - 13:44:31 EST


From: qianjun
> Sent: 22 December 2020 12:19
>
> In our project, Many business delays come from fork, so
> we started looking for the reason why fork is time-consuming.
> I used the ftrace with function_graph to trace the fork, found
> that the vm_normal_page will be called tens of thousands and
> the execution time of this vm_normal_page function is only a
> few nanoseconds. And the vm_normal_page is not a inline function.
> So I think if the function is inline style, it maybe reduce the
> call time overhead.

Beware of taking timings from ftrace function trace.
The cost of the tracing is significant.

You can get sensible numbers if you only trace very specific
functions.
Slightly annoyingly the output format changes if you enable
the function exit trace - useful for the timestamp.
ISTR it is possible to get the process id traced if you fiddle
with enough options.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)