diff options
author | Andrey Ryabinin <a.ryabinin@samsung.com> | 2014-07-30 16:08:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-30 17:16:13 -0700 |
commit | b4903d6e8408e6137ee4666ee67ec566b74a0f05 (patch) | |
tree | 2db6b545dd1e56bac8602974fe74ca0cc773d67a /mm/filemap.c | |
parent | 2bcf2e92c3918ce62ab4e934256e47e9a16d19c3 (diff) | |
download | linux-stable-b4903d6e8408e6137ee4666ee67ec566b74a0f05.tar.gz linux-stable-b4903d6e8408e6137ee4666ee67ec566b74a0f05.tar.bz2 linux-stable-b4903d6e8408e6137ee4666ee67ec566b74a0f05.zip |
mm: debugfs: move rounddown_pow_of_two() out from do_fault path
do_fault_around() expects fault_around_bytes rounded down to nearest page
order. Instead of calling rounddown_pow_of_two every time in
fault_around_pages()/fault_around_mask() we could do round down when user
changes fault_around_bytes via debugfs interface.
This also fixes bug when user set fault_around_bytes to 0. Result of
rounddown_pow_of_two(0) is not defined, therefore fault_around_bytes == 0
doesn't work without this patch.
Let's set fault_around_bytes to PAGE_SIZE if user sets to something less
than PAGE_SIZE
[akpm@linux-foundation.org: tweak code layout]
Fixes: a9b0f861("mm: nominate faultaround area in bytes rather than page order")
Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: <stable@vger.kernel.org> [3.15.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
0 files changed, 0 insertions, 0 deletions