From 0a9fcf5f8a8aa61559f545f32ddca0d3db082380 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 1 Mar 2017 08:49:10 +0100 Subject: [PATCH] copy: speed up the speedup --- kernel/mars_copy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/mars_copy.c b/kernel/mars_copy.c index cade8cf3..6c10a094 100644 --- a/kernel/mars_copy.c +++ b/kernel/mars_copy.c @@ -223,7 +223,11 @@ void copy_endio(struct generic_callback *cb) brick = mref_a->brick; CHECK_PTR(brick, err); - brick->check_hint = mref->ref_pos; + /* This is racy, but affects only a _hint_ for + * performance optimization. + */ + if (!brick->check_hint || mref->ref_pos < brick->check_hint) + brick->check_hint = mref->ref_pos; queue = mref_a->queue; index = GET_INDEX(mref->ref_pos);