From: Sarthak Sharma <sarthak.sharma@arm.com>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org,
liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, shuah@kernel.org,
skhan@linuxfoundation.org, corbet@lwn.net, jgg@ziepe.ca,
jhubbard@nvidia.com, peterx@redhat.com, leon@kernel.org,
ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com,
ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org,
broonie@kernel.org, anshuman.khandual@arm.com,
usama.anjum@arm.com, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 1/6] selftests/mm: make file helpers return errors
Date: Mon, 31 Aug 2026 10:46:05 +0530 [thread overview]
Message-ID: <f72b2d38-0999-421a-a5de-1573b0f83e71@arm.com> (raw)
In-Reply-To: <20260831045241.25826-1-lance.yang@linux.dev>
Hi Lance!
On 8/31/26 10:22 AM, Lance Yang wrote:
>
> On Mon, Aug 31, 2026 at 09:50:56AM +0530, Sarthak Sharma wrote:
> [...]
>> diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h
>> index 9a49af88702e..62f6f5b42649 100644
>> --- a/tools/testing/selftests/mm/vm_util.h
>> +++ b/tools/testing/selftests/mm/vm_util.h
>> @@ -166,11 +166,11 @@ int unpoison_memory(unsigned long pfn);
>> #define PAGEMAP_PRESENT(ent) (((ent) & (1ull << 63)) != 0)
>> #define PAGEMAP_PFN(ent) ((ent) & ((1ull << 55) - 1))
>>
>> -void write_file(const char *path, const char *buf, size_t buflen);
>> +int write_file(const char *path, const char *buf, size_t buflen);
>> int read_file(const char *path, char *buf, size_t buflen);
>> -unsigned long read_num(const char *path);
>> -void write_num(const char *path, unsigned long num);
>> -void write_num_ignore_einval(const char *path, unsigned long num);
>> +int read_num(const char *path, unsigned long *num);
>> +int write_num(const char *path, unsigned long num);
>> +int write_num_ignore_einval(const char *path, unsigned long num);
>
> Ouch ...
>
> Looks like this conversion misses hugetlb-soft-offline.c ...
>
> TEST_GEN_FILES += hugetlb-soft-offline
>
> int main(int argc, char **argv)
> {
> ...
> orig_enable_soft_offline = read_num(ENABLE_SOFT_OFFLINE_PATH);
Thanks for pointing it out.
This call was added very recently, and I missed to update it while
rebasing. I'll fix this.
> ...
> }
>
> And the compiler isn't happy:
>
> tools/testing/selftests/mm/hugetlb-soft-offline.c:199:36:
> error: too few arguments to function 'read_num'
> 199 | orig_enable_soft_offline = read_num(ENABLE_SOFT_OFFLINE_PATH);
> tools/lib/mm/file_utils.h:9:5: note: declared here
> 9 | int read_num(const char *path, unsigned long *num);
>
> Cheers, Lance
>
> [...]
next prev parent reply other threads:[~2026-08-31 5:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 4:20 [PATCH v8 0/6] selftests/mm: separate GUP microbenchmarking from functional testing Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 1/6] selftests/mm: make file helpers return errors Sarthak Sharma
2026-08-31 4:52 ` Lance Yang
2026-08-31 5:16 ` Sarthak Sharma [this message]
2026-08-31 4:20 ` [PATCH v8 2/6] tools/lib/mm: add shared file helpers Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 3/6] tools/lib/mm: move hugepage_settings out of selftests Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 4/6] tools/mm: move gup_test from selftests/mm to tools/mm Sarthak Sharma
2026-08-31 4:21 ` [PATCH v8 5/6] tools/mm: make gup_bench a benchmark only tool Sarthak Sharma
2026-08-31 4:21 ` [PATCH v8 6/6] selftests/mm: add a GUP selftest Sarthak Sharma
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=f72b2d38-0999-421a-a5de-1573b0f83e71@arm.com \
--to=sarthak.sharma@arm.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=lance.yang@linux.dev \
--cc=leon@kernel.org \
--cc=liam@infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=npache@redhat.com \
--cc=peterx@redhat.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=usama.anjum@arm.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/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