From: Cort Dougan <cort@fsmlabs.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: 7.52 second kernel compile
Date: Mon, 18 Mar 2002 12:37:22 -0700 [thread overview]
Message-ID: <20020318123722.B4155@host110.fsmlabs.com> (raw)
In-Reply-To: <20020313085217.GA11658@krispykreme> <20020316061535.GA16653@krispykreme> <a6uubq$uqr$1@penguin.transmeta.com> <15507.9919.92453.811733@argo.ozlabs.ibm.com>
In fact we _did_ do the second part. Rather, I did anyway. The zombie
reclaim code (used to live in idle.c before it was removed) would run much
like the zero-paged code I put in there. It ran with the cache off to
avoid blowing the entire contents of the L1/L2 in the idle task. It would
just invalidate (genuinely clearing the valid bit) for any hash table entry
that was stale (zombie was the term I used).
That method was a definite win in UP but didn't help terribly well for SMP
since once a processor bogs down it no longer gets the advantage of the
easy to find empty slot in the hash replacement code.
At this point, I think it would be worth throwing out the tlb invalidate
optimization (by changing VSID's) and benchmarking that against the code
with the optimization. A test a year ago that I did showed that they were
pretty much even. I'm betting the latest changes have made that
optimization an actual loss now.
Linus, shrinking that hash table was a very very bad thing. Early on we
used a very small hash table and it really put too much pressure on the
entries and we were throwing them out nearly constantly. Adding some code
to scatter the entries and use the table more efficient helped but a large
has table is a need, unfortunately.
The ultimate solution was actually not using the hash table on the 603's
that I added a few years ago. I documented how doing this actually
improved performance in a OSDI paper from '99 that I have on my web page.
Linux, It's worth a look - it actually supports most of your opinions of
the PPC MMU.
} > I wonder if you wouldn't be better off just getting rid of the TLB range
} > flush altogether, and instead making it select a new VSID in the segment
} > register, and just forgetting about the old TLB contents entirely.
} >
} > Then, when you do a TLB miss, you just re-use any hash table entries
} > that have a stale VSID.
}
} We used to do something a bit like that on ppc32 - flush_tlb_mm would
} just assign a new mmu context number to the task, which translates
} into a new set of VSIDs. We didn't do the second part, reusing hash
} table entries with stale VSIDs, because we couldn't see a good fast
} way to tell whether a given VSID was stale. Instead, when the hash
} bucket filled up, we just picked an entry to overwrite semi-randomly.
}
} It turned out that the stale VSIDs were causing us various problems,
} particularly on SMP, so I tried a solution that always cleared all the
} hash table entries, using a bit in the linux pte to say whether there
} was (or had ever been) a hash table entry corresponding to that pte as
} an optimization to avoid doing unnecessary hash lookups. To my
} surprise, that turned out to be faster, so that's what we do now.
}
} Your suggestion has the problem that when you get to needing to reuse
} one of the VSIDs that you have thrown away, it becomes very difficult
} and expensive to ensure that there aren't any stale hash table entries
} left around for that VSID - particularly on a system with logical
} partitioning where we don't control the size of the hash table. And
} there is a finite number of VSIDs so you have to reuse them sooner or
} later.
}
} [For those not familiar with the PPC MMU, think of the VSID as an MMU
} context number, but separately settable for each 256MB of the virtual
} address space.]
}
} > It would also be interesting to hear if you can just make the hash table
} > smaller (I forget the details of 64-bit ppc VM horrors, thank God!) or
}
} On ppc32 we use a hash table 1/4 of the recommended size and it works
} fine.
}
} > just bypass it altogether (at least the 604e used to be able to just
} > disable the stupid hashing altogether and make the whole thing much
} > saner).
}
} That was the 603, actually. In fact the newest G4 processors also let
} you do this. When I get hold of a machine with one of these new G4
} chips I'm going to try it again and see how much faster it goes
} without the hash table.
}
} One other thing - I would *love* it if we could get rid of
} flush_tlb_all and replace it with a flush_tlb_kernel_range, so that
} _all_ of the flush_tlb_* functions tell us what address(es) we need to
} invalidate, and let the architecture code decide whether a complete
} TLB flush is justified.
}
} Paul.
} -
} To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
} the body of a message to majordomo@vger.kernel.org
} More majordomo info at http://vger.kernel.org/majordomo-info.html
} Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2002-03-18 19:39 UTC|newest]
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-13 8:52 10.31 second kernel compile Anton Blanchard
2002-03-13 14:44 ` Martin J. Bligh
2002-03-13 21:44 ` [Lse-tech] " Dave Hansen
2002-03-14 1:07 ` Keith Owens
2002-03-14 11:27 ` Anton Blanchard
2002-03-14 13:16 ` [Lse-tech] " Dipankar Sarma
2002-03-17 13:12 ` some RCU dcache and ratcache results Anton Blanchard
2002-03-14 13:21 ` [Lse-tech] Re: 10.31 second kernel compile Momchil Velikov
2002-03-14 18:33 ` Daniel Phillips
2002-03-15 12:16 ` Chris Wedgwood
2002-03-16 5:12 ` Anton Blanchard
2002-03-15 18:20 ` Linus Torvalds
2002-03-16 11:55 ` Paul Mackerras
2002-03-16 17:25 ` Rik van Riel
2002-03-16 17:57 ` yodaiken
2002-03-16 18:06 ` Linus Torvalds
2002-03-16 18:35 ` yodaiken
2002-03-16 18:45 ` Linus Torvalds
2002-03-16 18:57 ` yodaiken
2002-03-16 19:16 ` Linus Torvalds
2002-03-16 19:43 ` David Mosberger
2002-03-16 19:58 ` Linus Torvalds
2002-03-16 20:08 ` yodaiken
2002-03-16 20:23 ` Linus Torvalds
2002-03-16 20:36 ` David Mosberger
2002-03-16 20:46 ` Linus Torvalds
2002-03-17 1:09 ` Paul Mackerras
2002-03-17 2:08 ` Linus Torvalds
2002-03-16 19:53 ` yodaiken
2002-03-16 20:02 ` Linus Torvalds
2002-03-16 20:25 ` yodaiken
2002-03-27 1:07 ` Richard Henderson
2002-03-16 20:53 ` Alan Cox
2002-03-18 3:07 ` David S. Miller
2002-03-16 15:24 ` Daniel Phillips
2002-03-16 19:01 ` Linus Torvalds
2002-03-16 22:25 ` Daniel Phillips
2002-03-19 16:35 ` Bill Davidsen
2002-03-14 19:05 ` Linus Torvalds
2002-03-19 16:40 ` Bill Davidsen
2002-03-14 18:21 ` Hanna Linder
2002-03-16 5:27 ` Anton Blanchard
2002-03-15 7:12 ` Chris Wedgwood
2002-03-16 6:15 ` 7.52 " Anton Blanchard
2002-03-16 6:42 ` [Lse-tech] " Gerrit Huizenga
2002-03-17 12:34 ` Anton Blanchard
2002-03-17 22:09 ` Theodore Tso
2002-03-18 7:04 ` Jeff Garzik
2002-03-19 18:28 ` Theodore Tso
2002-03-16 8:05 ` Linus Torvalds
2002-03-16 11:04 ` Paul Mackerras
2002-03-16 18:32 ` Linus Torvalds
2002-03-17 2:00 ` Paul Mackerras
2002-03-17 2:40 ` Linus Torvalds
2002-03-17 2:50 ` M. Edward Borasky
2002-03-18 15:08 ` 0.73 " snpe
2002-03-18 19:42 ` 7.52 " Cort Dougan
2002-03-18 20:04 ` Linus Torvalds
2002-03-18 20:23 ` Linus Torvalds
2002-03-18 21:50 ` Rene Herman
2002-03-18 22:36 ` Cort Dougan
2002-03-18 22:47 ` Linus Torvalds
2002-03-18 22:56 ` Cort Dougan
2002-03-18 23:52 ` Paul Mackerras
2002-03-19 0:57 ` Dave Jones
2002-03-19 3:35 ` Jeff Garzik
2002-03-19 0:22 ` David S. Miller
2002-03-19 0:27 ` Cort Dougan
2002-03-19 0:27 ` David S. Miller
2002-03-19 0:36 ` Cort Dougan
2002-03-19 0:38 ` David S. Miller
2002-03-19 1:28 ` Davide Libenzi
2002-03-19 2:42 ` Paul Mackerras
2002-03-27 2:53 ` Richard Henderson
2002-04-02 4:32 ` Linus Torvalds
2002-04-02 10:50 ` Pablo Alcaraz
2002-03-18 21:34 ` Cort Dougan
2002-03-18 22:00 ` Linus Torvalds
2002-03-18 19:37 ` Cort Dougan [this message]
2002-03-16 11:54 ` yodaiken
2002-03-16 17:37 ` [Lse-tech] " Martin J. Bligh
2002-03-16 18:57 ` Daniel Egger
2002-03-17 8:18 ` Mike Galbraith
2002-03-17 15:29 ` Martin J. Bligh
2002-03-17 1:45 ` Keith Owens
2002-03-17 13:54 ` David Woodhouse
2002-03-19 16:49 ` Bill Davidsen
-- strict thread matches above, loose matches on Subject: below --
2002-03-18 22:12 Dieter Nützel
2002-03-18 22:46 ` Linus Torvalds
2002-03-18 23:53 ` Davide Libenzi
2002-03-19 0:20 ` David S. Miller
2002-03-19 0:47 ` Davide Libenzi
2002-03-19 1:37 ` Andreas Ferber
2002-03-19 1:38 ` David S. Miller
2002-03-19 2:08 ` Linus Torvalds
2002-03-19 5:24 ` Erik Andersen
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=20020318123722.B4155@host110.fsmlabs.com \
--to=cort@fsmlabs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@transmeta.com \
/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