Whamcloud - gitweb
LU-12394 llite: Fix extents_stats 75/35075/8
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 11 Jun 2019 18:54:20 +0000 (14:54 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Aug 2019 04:56:33 +0000 (04:56 +0000)
commitd31a4dad4e698c537dff3d018fd67f196b2b293f
tree4dc83b048681d5fb15df9e7b3142b7882a6fc81c
parent92c4ad14d4b1e77e1566c8481195bb623472f149
LU-12394 llite: Fix extents_stats

Patch 32517 from LU-8066 changed:
        (1 << LL_HIST_START << i)

To:

        BIT(LL_HIST_START << i)

But these are not equivalent because this changes the order
of operations.  The earlier one does the operations in this
order:
        (1 << LL_HIST_START) << i

The new one is this order:
        1 << (LL_HIST_START << i)

Which is quite different, as it's left shifting
LL_HIST_START directly, and LL_HIST_START is a number of
bits.

The goal is really just to start with BIT(LL_HIST_START)
and left shift by one (going from 4K, to 8K, etc) each
time, so just use:
        BIT(LL_HIST_START + i)

The result of this was that all i/os over 8K were placed in
the 4K-8K stat bucket, because the loop exited early.

Also add mmap'ed reads & writes to extents_stats.

Add test for extents_stats.

Fixes: adb5aca3d673 ("LU-8066 llite: Move all remaining procfs entries
                     to debugfs")

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Iab4dc097234d411601a18d501075df45791d1138
Reviewed-on: https://review.whamcloud.com/35075
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/llite/llite_mmap.c
lustre/llite/lproc_llite.c
lustre/llite/vvp_io.c
lustre/tests/sanity.sh