From: Shuah Khan <shuah@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Sri Jayaramappa <sjayaram@akamai.com>,
stable@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <shuahkh@osg.samsung.com>,
Shuah Khan <shuah.kh@samsung.com>
Subject: Re: [PATCH] kselftest: fix OOM in memory compaction test
Date: Wed, 10 Jan 2018 10:04:21 -0700 [thread overview]
Message-ID: <1e1f540c-fe13-e95e-6ecb-4d88c03ac9e7@kernel.org> (raw)
In-Reply-To: <7f319aac-ef79-a7b0-372c-b52062063f97@kernel.org>
On 01/09/2018 09:47 AM, Shuah Khan wrote:
> On 01/09/2018 09:26 AM, Arnd Bergmann wrote:
>> 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>
>> ---
>> tools/testing/selftests/vm/compaction_test.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
>> index a65b016d4c13..1097f04e4d80 100644
>> --- a/tools/testing/selftests/vm/compaction_test.c
>> +++ b/tools/testing/selftests/vm/compaction_test.c
>> @@ -137,6 +137,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
>> printf("No of huge pages allocated = %d\n",
>> (atoi(nr_hugepages)));
>>
>> + lseek(fd, 0, SEEK_SET);
>> +
>> if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
>> != strlen(initial_nr_hugepages)) {
>> perror("Failed to write value to /proc/sys/vm/nr_hugepages\n");
>>
>
>
> Thanks for the patch. I will get this into 4.16-rc1
>
Applied to linux-kselftest next for 4.16-rc1
thanks,
-- Shuah
prev parent reply other threads:[~2018-01-10 17:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 16:26 Arnd Bergmann
2018-01-09 16:47 ` Shuah Khan
2018-01-10 17:04 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e1f540c-fe13-e95e-6ecb-4d88c03ac9e7@kernel.org \
--to=shuah@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah.kh@samsung.com \
--cc=shuahkh@osg.samsung.com \
--cc=sjayaram@akamai.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®