操作系统如何努力尽量减少 TLB 刷新?
我想知道操作系统中是否实现了一种通用机制来最小化 TLB 刷新,例如将同一进程中的线程分组到“待调度”列表中。
我认为在决定使用进程还是线程时,这是一个重要因素。 如果操作系统不关心下一个线程是否在同一进程空间中,那么所谓的线程“最小化 TLB 刷新”的优点可能会被高估。 是这样吗?
考虑一个具有数百个线程和数十个进程的系统。 如果这些没有以串联调度同一进程中的线程的方式进行优化,我们对线程性能的期望可能不会那么大。
如果问题不太清楚,我会举一些例子。
I wonder if there is a common mechanism implemented in operating systems to minimize TLB flushes, by for instance grouping threads in the same process together in a "to be scheduled" list.
I think this is an important factor when deciding between using processes against threads. If OS doesn't care whether the next thread is in the same process space or not, the so called advantage of threads "minimizing TLB flushes" might be overrated. Is that the case?
Consider a system with hundreds of threads and tens of processes. If these are not optimized in a way to schedule threads in same process in tandem, our expectations on thread performance may not be that big.
I'll give examples if question isn't that clear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CPU 设计似乎正在向硬件发展支持标记的 TLB 条目。 这样就无需刷新 TLB。 因此,即使假设 TLB 刷新是当今处理器关注的问题,几年后它可能不再相关。 我不会基于它做出任何设计决策。
CPU designs appear to be evolving towards hardware support for tagged TLB entries. This eliminates the need to flush the TLB. So even assuming that TLB flushing is a concern for today's processors, it may not be relevant anymore in a few years. I wouldn't base any design decisions on it.