From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Christoph Lameter <cl@linux.com>
Cc: Sarah Sharp <sarah@minilop.net>,
ksummit-discuss@lists.linuxfoundation.org,
Greg KH <gregkh@linuxfoundation.org>,
Julia Lawall <julia.lawall@lip6.fr>,
Darren Hart <darren@dvhart.com>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [Ksummit-discuss] [CORE TOPIC] Kernel tinification: shrinking the kernel and avoiding size regressions
Date: Fri, 09 May 2014 10:42:23 -0700 [thread overview]
Message-ID: <1399657343.2166.61.camel@dabdike.int.hansenpartnership.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1405091150410.11810@gentwo.org>
On Fri, 2014-05-09 at 11:55 -0500, Christoph Lameter wrote:
> On Fri, 9 May 2014, Steven Rostedt wrote:
>
> > > One improvement would be to sort the functions by functionality. All the
> > > important functions in the first 2M of the code covered by one huge tlb
> > > f.e.
> >
> > I thought pretty much all of kernel core memory is mapped in by huge
> > tlbs? At least for kernel core code (not modules), the size should not
> > impact tlbs.
>
> Yes, but processor only support a limited amount of 2m tlbs and
> applications also want to use them. A large 100M sized kernel would
> require 50 tlbs and cause tlb trashing if functions are accessed over all
> the code. Loadable modules are using vmalloc areas that use 4k pages which
> is another issue.
In theory, we could use link time optimization to place all the most
used functions in the first TLB entry. However, as Steve said, have you
got measurements showing this helps? If it's down in the noise, it's a
lot of work for no benefit.
> > > Maybe we could reduce the number of cachelines used by critical functions
> > > too? Arent there some tools that can automatize this in gcc?
> >
> > As I believe James has mentioned. This only helps if we keep the
> > critical functions tight in a cacheline. I did some benchmarks moving
> > the tracepoint code more out of line to help in cachelines, and I
> > haven't seen anything above the noise. Which is the reason I haven't
> > pushed that work further.
> >
> > Size may not be as important as having reuse of code. Perhaps if you
> > can tweak several functions to call one helper function, which may
> > actually increase the total size of the kernel, but having more helper
> > functions that live in cache longer may be of benefit.
>
> More helper functions means more use of l1 cache lines which reduces
> performance.
Not if the compiler inlines them. Plus if we have five critical
functions and we make them share a helper (which the compiler doesn't
inline) then we get a 4xsize of helper reduction in code which outweighs
the additional function call overhead ... this is what Steve is
referring to. Correct use of helper functions should reduce our L1
cache footprint, but the key is "correct".
> > > In general the ability to reduce the size of the kernel to a minimum is a
> > > desirable feature. I still see deployments of older kernels in the
> > > financial industry because they have a higher performance and lower
> > > latency. The only way to get those guys would be to keep the kernel size
> > > and the size of the data touched the same.
> >
> > I actually wonder if that performance is really on "size" of the kernel
> > and not just less features. Usually with features, we add more function
> > calls and branches, which I believe may be the culprit of the slowdowns
> > we are seeing.
>
> That too... But James said they were using static branching.
Cgroups are, yes ... after you complained a lot.
> Global optimization may allow the folding of small functions into a larger
> one when advantageous (which is not simple to determine).
It's possible, but complex ... I'd really like to see proof that it
helps before thinking about it.
James
next prev parent reply other threads:[~2014-05-09 17:42 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 16:24 Christoph Lameter
2014-05-09 0:31 ` James Bottomley
2014-05-09 14:48 ` Christoph Lameter
2014-05-09 16:24 ` Steven Rostedt
2014-05-09 16:55 ` Christoph Lameter
2014-05-09 17:21 ` josh
2014-05-09 17:42 ` James Bottomley [this message]
2014-05-09 17:52 ` Christoph Lameter
2014-05-09 18:32 ` Steven Rostedt
2014-05-09 19:02 ` Julia Lawall
2014-05-09 20:31 ` Steven Rostedt
2014-05-09 17:52 ` Matthew Wilcox
2014-05-12 18:06 ` Dave Hansen
2014-05-12 20:20 ` Roland Dreier
2014-05-14 2:37 ` Li Zefan
2014-05-15 19:41 ` H. Peter Anvin
2014-05-15 20:00 ` Greg KH
2014-05-15 20:29 ` Guenter Roeck
-- strict thread matches above, loose matches on Subject: below --
2014-05-02 16:44 Josh Triplett
2014-05-02 17:11 ` Dave Jones
2014-05-02 17:20 ` James Bottomley
2014-05-02 17:33 ` Dave Jones
2014-05-02 17:46 ` Josh Boyer
2014-05-02 18:50 ` H. Peter Anvin
2014-05-02 19:02 ` Josh Boyer
2014-05-02 19:03 ` Michael Kerrisk (man-pages)
2014-05-02 19:33 ` Theodore Ts'o
2014-05-02 19:38 ` Jiri Kosina
2014-05-02 19:49 ` Dave Jones
2014-05-02 20:06 ` Steven Rostedt
2014-05-02 20:41 ` Theodore Ts'o
2014-05-02 21:01 ` Dave Jones
2014-05-02 21:19 ` Josh Boyer
2014-05-02 21:23 ` Jiri Kosina
2014-05-02 21:36 ` Josh Boyer
2014-05-02 21:27 ` James Bottomley
2014-05-02 21:39 ` Josh Boyer
2014-05-02 22:35 ` Andy Lutomirski
2014-05-06 17:18 ` josh
2014-05-06 17:31 ` Andy Lutomirski
2014-05-09 18:22 ` H. Peter Anvin
2014-05-09 20:37 ` Andy Lutomirski
2014-05-09 22:50 ` Josh Triplett
2014-05-10 0:23 ` James Bottomley
2014-05-10 0:38 ` Andy Lutomirski
2014-05-10 3:44 ` Josh Triplett
2014-05-03 17:30 ` James Bottomley
2014-05-02 21:56 ` tytso
2014-05-02 20:45 ` Ben Hutchings
2014-05-02 21:03 ` Dave Jones
2014-05-03 13:37 ` Michael Kerrisk (man-pages)
2014-05-03 13:35 ` Michael Kerrisk (man-pages)
2014-05-03 13:32 ` Michael Kerrisk (man-pages)
2014-05-02 19:03 ` Mark Brown
2014-05-02 19:45 ` Luck, Tony
2014-05-02 21:03 ` Mark Brown
2014-05-02 21:08 ` Dave Jones
2014-05-02 21:14 ` Andy Lutomirski
2014-05-02 21:21 ` Luck, Tony
2014-05-02 21:38 ` H. Peter Anvin
2014-05-03 1:21 ` Mark Brown
2014-05-07 12:35 ` David Woodhouse
2014-05-09 15:51 ` Mark Brown
2014-05-02 17:33 ` Guenter Roeck
2014-05-02 17:44 ` Steven Rostedt
2014-05-07 11:32 ` David Woodhouse
2014-05-07 16:38 ` James Bottomley
2014-05-02 22:04 ` Jan Kara
2014-05-05 23:45 ` Bird, Tim
2014-05-06 2:14 ` H. Peter Anvin
2014-05-09 16:22 ` Josh Triplett
2014-05-09 16:59 ` Bird, Tim
2014-05-09 17:23 ` josh
2014-05-08 15:52 ` Christoph Lameter
2014-05-12 17:35 ` Wolfram Sang
2014-05-13 16:36 ` Bird, Tim
2014-05-13 18:00 ` josh
2014-05-14 1:04 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399657343.2166.61.camel@dabdike.int.hansenpartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=cl@linux.com \
--cc=dan.carpenter@oracle.com \
--cc=darren@dvhart.com \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=ksummit-discuss@lists.linuxfoundation.org \
--cc=sarah@minilop.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox