From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Song Hu <husong@kylinos.cn>,
akpm@linux-foundation.org, usama.anjum@arm.com
Cc: linux-mm@kvack.org, shuah@kernel.org, ljs@kernel.org,
liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, peterx@redhat.com,
sarthak.sharma@arm.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] selftests/mm: restore enable_soft_offline in hugetlb-soft-offline
Date: Thu, 10 Sep 2026 11:36:13 +0200 [thread overview]
Message-ID: <54242581-c5e4-433e-8fd8-e83da1383f42@kernel.org> (raw)
In-Reply-To: <20260825085756.63030-4-husong@kylinos.cn>
On 8/25/26 10:57, Song Hu wrote:
> hugetlb-soft-offline toggles /proc/sys/vm/enable_soft_offline between 1
> and 0 (test_soft_offline_common(1) then (0)) and leaves it at 0 when it
> finishes, silently disabling soft offlining for the whole system after
> the run.
>
> Save the original value before the test and restore it from an
> atexit() handler, as hugepage_restore_settings_atexit() in
> hugepage_settings.c already does. Use read_num()/write_num() from
> vm_util instead of hand-rolled popen()/fopen() helpers.
>
> The restore handler must not call write_num(): on failure it
> re-enters exit() through ksft_exit_fail_msg(), which is undefined
> behavior from inside an atexit handler. A non-root run hits it
> directly - the restore write fails the same way the write that
> triggered the exit did. Restore with plain open()/write(), best
> effort.
>
> Signed-off-by: Song Hu <husong@kylinos.cn>
>
> ---
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
prev parent reply other threads:[~2026-09-10 9:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 8:57 [PATCH v4 0/3] selftests/mm: TAP output and global-state fixes Song Hu
2026-08-25 8:57 ` [PATCH v4 1/3] selftests/mm: emit TAP header in uffd-wp-mremap Song Hu
2026-09-10 9:28 ` David Hildenbrand (Arm)
2026-08-25 8:57 ` [PATCH v4 2/3] selftests/mm: emit TAP header and use TAP skip in mremap_test Song Hu
2026-09-10 9:33 ` David Hildenbrand (Arm)
2026-08-25 8:57 ` [PATCH v4 3/3] selftests/mm: restore enable_soft_offline in hugetlb-soft-offline Song Hu
2026-08-25 9:06 ` Song Hu
2026-08-25 9:24 ` Muhammad Usama Anjum
2026-09-10 9:36 ` David Hildenbrand (Arm) [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=54242581-c5e4-433e-8fd8-e83da1383f42@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=husong@kylinos.cn \
--cc=liam@infradead.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=peterx@redhat.com \
--cc=rppt@kernel.org \
--cc=sarthak.sharma@arm.com \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=usama.anjum@arm.com \
--cc=vbabka@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®