Re: [PATCH 1/2] selftests/mm: compaction_test: Fix incorrect write of zero to nr_hugepages

From: Dev Jain
Date: Mon May 20 2024 - 01:28:30 EST



On 5/20/24 05:30, Andrew Morton wrote:
On Wed, 15 May 2024 15:06:32 +0530 Dev Jain <dev.jain@xxxxxxx> wrote:

nr_hugepages is not set to zero because the file offset has not been reset
after read(). Fix that using lseek().

Please fully describe the runtime effects of this bug.


This is not a "bug", but a discrepancy; the following comment

by the author says "Start with the initial condition of 0 huge

pages", I am just ensuring that that is actually done. Although,

I am not sure about the utility of doing this in the first place,

since we are anyways trying to increase hugepages after that.

In the second patch, I have moved away this entire logic of

setting nr_hugepages to zero, to the place before we start

filling up memory; if you feel that this patch is unnecessary,

we may squash it.