Project

General

Profile

Bug #5498

kmem_reap does one xcall per page

Added by Matthew Ahrens almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
2014-12-30
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

We see performance problems due to kmem_reap() of ZFS's zio buf caches. The kmem_reap() causes a lot of cross-calls to tear down TLB entries, which is slow. It can also cause latency bubbles in concurrent zfs_read/zfs_write operations.

The problem is reliably triggered when a workload switches between accessing files of different blocksizes. This causes kmem to need to free lots of buffers of the old size in order to allocate ones of the new size.

We can improve on this in some cases by using one xcall per slab, to tear down all the virtually contiguous pages used to back the slab. The performance benefit will be most noticeable when reaping larger (e.g. 128KB) caches.


Related issues

Related to illumos gate - Bug #5601: regression in 5498, too many TLB pages invalidatedRejected2015-02-08

Actions

History

#1

Updated by Electric Monk almost 5 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit a6a74e0e62d62ff750cd4b790be5eacc99c3bb8c

commit  a6a74e0e62d62ff750cd4b790be5eacc99c3bb8c
Author: Matthew Ahrens <mahrens@delphix.com>
Date:   2015-01-16T02:21:04.000Z

    5498 kmem_reap does one xcall per page
    5514 hat_unload_callback passes the wrong length to segvn_hat_unload_callback
    Reviewed by: Adam Leventhal <ahl@delphix.com>
    Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
    Reviewed by: George Wilson <george.wilson@delphix.com>
    Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
    Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF