]> git.baikalelectronics.ru Git - kernel.git/commit
kselftest: fix OOM in memory compaction test
authorArnd Bergmann <arnd@arndb.de>
Tue, 9 Jan 2018 16:26:24 +0000 (17:26 +0100)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 10 Jan 2018 15:22:47 +0000 (08:22 -0700)
commitd496cc4f0e012d95af41c041933c473bede0fab6
tree47b232153aab074ebc41a6bb2bc71fd31ae8f02f
parent982b5e7e0d8a5dc3b86e25cf786ed5794e93163e
kselftest: fix OOM in memory compaction test

Running the compaction_test sometimes results in out-of-memory
failures. When I debugged this, it turned out that the code to
reset the number of hugepages to the initial value is simply
broken since we write into an open sysctl file descriptor
multiple times without seeking back to the start.

Adding the lseek here fixes the problem.

Cc: stable@vger.kernel.org
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Link: https://bugs.linaro.org/show_bug.cgi?id=3145
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/vm/compaction_test.c