public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: James <wireless@tampabay.rr.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] Re: CFLAGs for kernel compilation
Date: Fri, 1 May 2015 17:21:26 +0000 (UTC)	[thread overview]
Message-ID: <loom.20150501T182640-190@post.gmane.org> (raw)
In-Reply-To: 20150501104402.27d943c901f638942262d3d1@gentoo.org

Andrew Savchenko <bircoph <at> gentoo.org> writes:


> > I can hardly imagine that otherwise the compiler converts integer
> > or pointer arithmetic into floating point arithmetics, or is
> > this really the case for certain flags?  If yes, why should these
> > flags *ever* be useful?
> > I mean: The context switching happens for non-kernel code as well,
> > doesn't it?


First off, reading this thread, I cannot really tell what the intended use
of the the "highly tuned" kernels is to be. For almost all workstation
and server proposes, what has been previously stated is mostly correct. If
you really want test these waters, do it on a system that is not in your
critical path. You tune and experiment, you are going to bork your box.
Water coolers on the CPUs is a good idea when taxing FPU and other simd
hareware on the CPU, imho. sys-power/Powertop is your friend.


> Yes, context switching happens for all code and have its costs. But
> for userspace code context switching happens for many other
> reasons, e.g. on each syscall (userspace <-> kernelspace switching).
> Also some user applications may need high precision or context
> switching pays off due to mass parallel data processing, e.g. SIMD
> instructions in scientific or multimedia applications. 

 (
Here here, I knew we had an LU expert int he crowd. Most scientific
or highly parallelized number cruncing does benefit from experimenting
with settings and *profiling* the results (trace-cdm + kernelshark)
are in portage and are very useful for analysis of hardware timings,
context switching and a myriad of other issues. Be careful, you can
sink a lifetime into such efforts with little to show for your efforts.
The best thing is to read up on specific optimizations for specific
codes as vetted by the specific hardware in your processors. Tuning for
one need will most likely retard other types of performances; that is
why before you delve into these waters, you really need to learn about
profiling both target (applicattion) and kernel codes, *BEFORE* randomly
tuning the advanced numerical intricacies of your hardware resources.
Start with memory and cgroups before worrying about the hardware inside
your processors (cpu and gpu).


> But unless special conditions mentioned above, fixed point is still 
> faster in userspace, some ffmpeg codecs have both fixed and floating 
> point implementations, you may compare them. Programming in fixed point
> is much harder, so most people avoid it unless they have a very
> goode reason to use it. And dont't forget that kernel is
> performance critical unlike most of userspace applications.

Video (mpeg, h.264 and such) massively benefits from the enhanced matrix
abilities of the simd hardware in your video card's GPU. These bare metal
resources are being integrated into gcc-5.1+ for experimentation. But,
it is likely going to take a year or so before ordinary users of linux
resources see these performance gains.  I would  encourage you
to experiment, but *never on your main workstation*. I'm purchasing
a new nvidia video card just to benchmark and tune some numerically
intesive codes that use sci-libs/magma. Although this will be my
currently fastest video card, it will sit in a box that not used
for visual eye candy (gaming, anime, ray_traces etc).


The mesos clustering codes (shark, storm, tachyon etc) and MP(I) codes are
going to fundamentally change the numerical processing landscape for even
small linux clusters. An excellent bit of code to get your feet_wet is
sys-apps/hwloc. More than FPU, MP(I)  {sys-cluster/openmpi} and other
clustering codes are going to allow you to use the  DDR(4|5) memory found in
many video cards (GPU) via *RDMA*. The world is rapidly changing and many
old "fixed point integer" folks do not see the Tsunami that is just
off_shore. Many computationally expensive codes have development project to
move to an "in-memory" [1] environment where  HD resources are avoided as
much as possible in a cluster environment. Clustered resources "tuned" for
such things as a video rendering farm, will have very different optimized
kernels than your KDE(G*) workstation or web server. medica-gfx/Blender is
another excellent collection of codes that benefits from all sorts of tuning
on a special_purpose system.

So do you really have a valid need to tune the FPU performance due to a
numerically demanding applications?       YMMV

> Best regards,
> Andrew Savchenko


hth,
James

[1] https://amplab.cs.berkeley.edu/




  reply	other threads:[~2015-05-01 17:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 11:31 [gentoo-user] CFLAGs for kernel compilation Ralf
2015-04-29 12:33 ` Neil Bothwick
2015-04-29 12:41   ` Emanuele Rusconi
2015-04-29 13:18     ` Ralf
2015-04-29 13:35       ` [gentoo-user] " Holger Hoffstätte
2015-04-29 23:52         ` Nikos Chantziaras
2015-04-30  0:01           ` Nikos Chantziaras
2015-04-30 16:27       ` [gentoo-user] " Volker Armin Hemmann
2015-04-30  7:11     ` Adam Carter
2015-04-30  9:38 ` Andrew Savchenko
2015-05-01  5:09   ` [gentoo-user] " Martin Vaeth
2015-05-01  7:44     ` Andrew Savchenko
2015-05-01 17:21       ` James [this message]
2015-05-02  5:04       ` Nikos Chantziaras
2015-05-02 11:19         ` Volker Armin Hemmann
2015-05-02 11:25           ` Nikos Chantziaras
2015-05-02 11:37             ` Volker Armin Hemmann
2015-05-02 12:06               ` Nikos Chantziaras
2015-05-02 12:10                 ` Volker Armin Hemmann
2015-05-02 12:38                   ` Nikos Chantziaras
2015-05-02 17:04                     ` Volker Armin Hemmann
2015-05-02 18:34                       ` James
2015-04-30 16:26 ` [gentoo-user] " Volker Armin Hemmann
2015-04-30 17:45   ` Andrew Savchenko
2015-04-30 18:11     ` Volker Armin Hemmann
2015-04-30 18:28       ` Andrew Savchenko

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=loom.20150501T182640-190@post.gmane.org \
    --to=wireless@tampabay.rr.com \
    --cc=gentoo-user@lists.gentoo.org \
    /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