wbt: add general throttling mechanism
authorJens Axboe <axboe@fb.com>
Mon, 25 Apr 2016 20:49:34 +0000 (14:49 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 26 Apr 2016 15:51:21 +0000 (09:51 -0600)
commit3cd16ff982aafeb88a259d3846c8113feb4bbf28
treea874a486f9d63bf01c37719fdc6c98308c513f13
parentcd6f0baed7c95f8c2ce8abdc6144715adf00149b
wbt: add general throttling mechanism

We can hook this up to the block layer, to help throttle buffered
writes. Or NFS can tap into it, to accomplish the same.

wbt registers a few trace points that can be used to track what is
happening in the system:

wbt_lat: 259:0: latency 2446318
wbt_stat: 259:0: rmean=2446318, rmin=2446318, rmax=2446318, rsamples=1,
               wmean=518866, wmin=15522, wmax=5330353, wsamples=57
wbt_step: 259:0: step down: step=1, window=72727272, background=8, normal=16, max=32

This shows a sync issue event (wbt_lat) that exceeded it's time. wbt_stat
dumps the current read/write stats for that window, and wbt_step shows a
step down event where we now scale back writes. Each trace includes the
device, 259:0 in this case.

Signed-off-by: Jens Axboe <axboe@fb.com>
include/linux/wbt.h [new file with mode: 0644]
include/trace/events/wbt.h [new file with mode: 0644]
lib/Kconfig
lib/Makefile
lib/wbt.c [new file with mode: 0644]