Whamcloud - gitweb
LU-12394 llite: Fix extents_stats 66/35866/2
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 11 Jun 2019 18:54:20 +0000 (14:54 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Sep 2019 03:48:10 +0000 (03:48 +0000)
commitd62644e8cb7833012c6c5b4e06c21bed6dadddd9
tree1699d67ae0fa2705dc8cb522fb91d33a37545784
parent41e2bd9752851a7f3989c6edfe2134742d0ab59f
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")

Lustre-change: https://review.whamcloud.com/35075
Lustre-commit: d31a4dad4e698c537dff3d018fd67f196b2b293f

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Iab4dc097234d411601a18d501075df45791d1138
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35866
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@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