Lies, damn lies & SPEC results

Article: Poulson: The Future of Itanium Servers
By: Linus Torvalds (torvalds.delete@this.linux-foundation.org),
Room: Moderated Discussions
mpx (mpx@nomail.pl) on 5/29/11 wrote:
>
>Why are you mixing the topics of CPU pages, and caching files?

Because the caches aren't just some kernel internal
thing: they are also exposed directly to user space
through mmap.

Now, you can actually consider mmap() to be a separate
issue from caching - and Linux used to do it long ago.
We had a purely-internal "buffer cache" that was used for
disk caching, and then if somebody mmap'ed a file we
would allocate a page for the mmap.

The problem with that is that it's rather complicated,
and very fragile. Especially in the presence of shared
writable mappings (ie user-land actually writing to the
file through a memory mapping), having separate caches
and mappings is really a nasty piece of business.

Fundamental issue #1: cache coherency when you have two
different models and allocations. Not just the CPU caches
for the actual memory, but the coherency at a software
level when one process does a "write()" system call (or
"truncate()" - that really ends up being interesting),
while another one is accessing the thing just by reading
and writing to a mmap'ed area.

Fundamental issue #2: memory use. You actually want to
try to share the backing store memory, because it turns
out that mmap'ed file-backed memory is a big part of your
memory pressure under some loads - big executables. And
you want to share it naturally and easily, not just to
save memory, but because you want to build up and tear
down processes quickly - so you don't want to copy the
executable image around etc.

And don't get me wrong: "nasty piece of business" is not
the same thing as "cannot be done". I'm 100% sure that it
can be done. Can it be done well? I've never seen
it, and in Linux the solution was certainly "don't do
that then", and we unified the caching in the "page cache"
that does everything at a page granularity, rather than
the filesystem block granularity or whatever.

In other words, I've done it both ways, and I can attest
to the fact that personally I would never ever go
back to the bad old days when caching was somehow a
separate issue from the memory mapping support.

So you don't *have* to mix up the MMU page size with the
filesystem cache, but anybody who doesn't is either
incompetent, doesn't know what they are doing, or is
working on some OS that is irrelevant and specialized
and just never needs to worry too much about small
details like mmap.

Linus
< Previous Post in ThreadNext Post in Thread >
Thread (208 posts)
TopicPosted ByPosted
Poulson Microarchitecture ArticleDavid Kanter
  Itanium achieved "incredibly high single threaded performance"?Mark Roulo
    Itanium achieved "incredibly high single threaded performance"?Daniel Bizo
      Itanium achieved "incredibly high single threaded performance"?David Kanter
        Itanium achieved "incredibly high single threaded performance"?Michael S
          Itanium achieved "incredibly high single threaded performance"?Michael S
        not reallyRichard Cownie
          you are just spouting anti-IPF propagandaDaniel Bizo
            you are just spouting anti-IPF propagandaRichard Cownie
              you are just spouting anti-IPF propagandaLlew
                you are just spouting anti-IPF propagandaLinus Torvalds
                  you are just spouting anti-IPF propagandaLlew
                    you are just spouting anti-IPF propagandaBrett
                      you are just spouting anti-IPF propagandasomeone
                        you are just spouting anti-IPF propagandaRakesh Malik
                          you are just spouting anti-IPF propagandaRichard Cownie
                            you are just spouting anti-IPF propagandaRakesh Malik
                              you are just spouting anti-IPF propagandaRichard Cownie
                                you are just spouting anti-IPF propagandaRakesh Malik
                                  you are just spouting anti-IPF propagandaMichael S
                                    POWERx and ItaniumDavid Kanter
                                    you are just spouting anti-IPF propagandasomeone
                                      you are just spouting anti-IPF propagandaDavid Kanter
                                        you are just spouting anti-IPF propagandasomeone
                                          you are just spouting anti-IPF propagandaMichael S
                                            Bandwidth in LLCDavid Kanter
                                              Bandwidth in LLCIntelUser2000
                                              Bandwidth in LLCMichael S
                                                Bandwidth in LLCDavid Kanter
                                you are just spouting anti-IPF propagandajrl
                                  you are just spouting anti-IPF propagandaMichael S
                                    obsess much?someone
                                      obsess much?Michael S
                                        obsess much?someone
                                    you are just spouting anti-IPF propagandajrl
                                      you are just spouting anti-IPF propagandaanonymous
                        you are just spouting anti-IPF propagandaBrett
                          you are just spouting anti-IPF propagandaDavid Kanter
                            you are just spouting anti-IPF propagandaRichard Cownie
                              Large cachesDavid Kanter
                                Large cachesRichard Cownie
                                  Large cachesanon
                                    Large cachesRichard Cownie
                                      Large cachesanon
                                        Large cachesRichard Cownie
                                          Large cachesanon
                                            Large cachesRichard Cownie
                                              Large cachesDavid Kanter
                                                Large cachesRichard Cownie
                                                  Large cachesAaron Spink
                                                    Large cachesRichard Cownie
                                                      Large cachessomeone
                                                        Large cachesRichard Cownie
                                                          WorkstationsDavid Kanter
                                                            WorkstationsRichard Cownie
                                                              WorkstationsMichael S
                                                          Large cachesAaron Spink
                                                    Large cachesCarlie Coats
                                                      Large cachesAaron Spink
                                              Large cachesanon
                                          Large cachesAaron Spink
                                            Large cachesLinus Torvalds
                                              Large cachesAaron Spink
                                                Large cachesLinus Torvalds
                                                  Miss distanceDavid Kanter
                                                    Miss distanceLlew
                                                      Miss distanceanon
                                                      Miss distancerwessel
                                                        Miss distanceLlew
                                                    Miss distanceLinus Torvalds
                                                      Miss distancea reader
                                                        Miss distanceLinus Torvalds
                                                          Miss distancea reader
                                                    Miss distanceajensen
                                                      Miss distanceLlew
                                                      Miss distancebakaneko
                                                  Run-ahead gives MLP for IOES. Rao
                                                    Run-ahead gives MLP for IOELinus Torvalds
                                                      Run-ahead gives MLP for IOES. Rao
                                                        Run-ahead gives MLP for IOELlew
                                                          Run-ahead gives MLP for IOEAaron Spink
                                                            Run-ahead gives MLP for IOEa reader
                                        Large cachesDavid Kanter
                                          Large cachesanon
                                            Large cachesRichard Cownie
                                              Large cachesanon
                                Large cachesBrett
                                  Large cachesDan Downs
                                    Large cachesDavid Kanter
                                      Large cachesMichael S
                                    Large cachesBrett
                                      Large cachesDan Downs
                                        Large cachesBrett
                            you are just spouting anti-IPF propagandampx
                        you are just spouting anti-IPF propagandaMichael S
                          you are just spouting anti-IPF propagandaanon
                      you are just spouting anti-IPF propagandaanon
                  you are just spouting anti-IPF propagandaDavid Kanter
                    you are just spouting anti-IPF propagandasomeone
                      Poulson power and perfDavid Kanter
                        Poulson power and perfsomeone
                        Poulson power and perfanon
                          Poulson power and perfDavid Kanter
                            Poulson power and perfanon
                              Poulson power and perfDavid Kanter
              you are just spouting anti-IPF propagandaDaniel Bizo
                you are just spouting anti-IPF propagandaRichard Cownie
                you are just spouting anti-IPF propagandampx
                  you are just spouting anti-IPF propagandaMichael S
                    you are just spouting anti-IPF propagandampx
            highest performing xx nm CPUsMichael S
      Itanium achieved "incredibly high single threaded performance"?Max
        Itanium achieved "incredibly high single threaded performance"?Daniel Bizo
    Itanium achieved "incredibly high single threaded performance"?David Kanter
      Itanium achieved "incredibly high single threaded performance"?Michael S
        Itanium achieved "incredibly high single threaded performance"?David Kanter
          Itanium achieved "incredibly high single threaded performance"?Thu Nguyen
            Itanium achieved "incredibly high single threaded performance"?David Kanter
              Itanium achieved "incredibly high single threaded performance"?Michael S
                Itanium achieved "incredibly high single threaded performance"?David Kanter
                  Itanium achieved "incredibly high single threaded performance"?Michael S
                  Itanium achieved "incredibly high single threaded performance"?Thu Nguyen
                    POWER7 vs. SNB SPECint_baseDavid Kanter
                      SNB SPECint linkDavid Kanter
                      Lies, damn lies & SPEC resultsPassing by
                        Lies, damn lies & SPEC resultsDavid Kanter
                          Lies, damn lies & SPEC resultsMichael S
                          Lies, damn lies & SPEC resultsanon
                        Lies, damn lies & SPEC resultsMichael S
                          Lies, damn lies & SPEC resultsLinus Torvalds
                            Lies, damn lies & SPEC resultsJouni Osmala
                              mem usage distributionMichael S
                                mem usage distributionJouni Osmala
                              Lies, damn lies & SPEC resultsLinus Torvalds
                                Lies, damn lies & SPEC resultsJouni Osmala
                                  Lies, damn lies & SPEC resultsLinus Torvalds
                                    Using larger translationsPaul A. Clayton
                                      Using larger translationsLinus Torvalds
                                        Using larger translationsanon
                                        Large pages still seem attractivePaul A. Clayton
                                          Large pages still seem attractiveLinus Torvalds
                                    Lies, damn lies & SPEC resultsDoug Siebert
                                      Lies, damn lies & SPEC resultsLinus Torvalds
                                        Lies, damn lies & SPEC resultsLinus Torvalds
                                        Lies, damn lies & SPEC resultsmpx
                                          Lies, damn lies & SPEC resultsLinus Torvalds
                                            Lies, damn lies & SPEC resultsgallier2
                                            Lies, damn lies & SPEC resultsmpx
                                        Lies, damn lies & SPEC resultsDoug Siebert
                                      Lies, damn lies & SPEC resultsanon
                                        Lies, damn lies & SPEC resultsnone
                                          How's that for compatibility?David Kanter
                                            How's that for compatibility?none
                                              How's that for compatibility?anon
                                                How's that for compatibility?Jouni Osmala
                                                  Larger caches with smaller pagesPaul A. Clayton
                                                How's that for compatibility?Wilco
                                                  How's that for compatibility?anon
                                                    How's that for compatibility?Wilco
                                                      How's that for compatibility?anon
                                                        How's that for compatibility?Michael S
                                                          How's that for compatibility?Wilco
                                                            How's that for compatibility?none
                                      Lies, damn lies & SPEC resultsanon
                                        Lies, damn lies & SPEC resultsDavid Kanter
                                        Lies, damn lies & SPEC resultsS. Rao
                                          Lies, damn lies & SPEC resultsanon
                                            Lies, damn lies & SPEC resultsS. Rao
                                              Lies, damn lies & SPEC resultsMichael S
                                                Lies, damn lies & SPEC resultsanon
                                                  Lies, damn lies & SPEC resultsanon
                                            Lies, damn lies & SPEC resultsJouni Osmala
                                              Lies, damn lies & SPEC resultsanon
                                                Lies, damn lies & SPEC resultsJouni Osmala
                                                  Lies, damn lies & SPEC resultsMichael S
                                                    Lies, damn lies & SPEC resultsJouni Osmala
                                                      Lies, damn lies & SPEC resultsMichael S
                                                  Lies, damn lies & SPEC resultsanon
                                              Lies, damn lies & SPEC resultsmpx
                                      Lies, damn lies & SPEC resultsGabriele Svelto
                          Lies, damn lies & SPEC resultsanon
                  Itanium achieved "incredibly high single threaded performance"?anon
    Itanium achieved "incredibly high single threaded performance"?someone
      Itanium achieved "incredibly high single threaded performance"?none
        Itanium achieved "incredibly high single threaded performance"?someone
      Itanium achieved "incredibly high single threaded performance"?Megol
      Itanium achieved "incredibly high single threaded performance"?Seni
        Itanium achieved "incredibly high single threaded performance"?someone
      Itanium achieved "incredibly high single threaded performance"?Mark Roulo
        P4 180 nm with L3anonymous
      Itanium achieved "incredibly high single threaded performance"?TA152H
  Thanks!Wouter Tinus
  Poulson Microarchitecture Articleajensen
    Poulson Microarchitecture ArticleDavid Kanter
      Poulson control queueajensen
        Poulson control queueDavid Kanter
  Some nitpicks and comments/questionsPaul A. Clayton
    Wide-Word [was: Some nitpicks and comments/questions]anon
    Some nitpicks and comments/questionsDavid Kanter
      Little technically keeps Xeon from true high-endPaul A. Clayton
        Little technically keeps Xeon from true high-endDavid Hess
          ChipKill implementation requirementsPaul A. Clayton
            ChipKill implementation requirementsDavid Hess
  spec int base referenceajensen
    spec int base referenceMichael S
    spec int base referenceMichael S
      spec int base referenceajensen
        spec int base referenceMichael S