From: Andrew Morton <akpm@linux-foundation.org>
To: Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: Shuah Khan <shuah@kernel.org>,
Wei Yang <richard.weiyang@gmail.com>,
Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Subject: Re: [PATCH] selftests/core: fix unshare_test with large fs.nr_open
Date: Sat, 29 Aug 2026 18:26:22 -0700 [thread overview]
Message-ID: <20260829182622.401275404893ef640e8c81e1@linux-foundation.org> (raw)
In-Reply-To: <20260814165709.513263-1-khorenko@virtuozzo.com>
On Fri, 14 Aug 2026 18:57:09 +0200 Konstantin Khorenko <khorenko@virtuozzo.com> wrote:
> The test assumes fs.nr_open is close to the default 1048576, but some
> systems set it much higher (e.g. 1073741816). This is systemd's doing:
> since systemd v240 (2018), PID 1 bumps fs.nr_open and fs.file-max to
> their largest possible values on boot, as file descriptors are already
> accounted for by memcg [1].
>
> In that case, dup2() to nr_open + 64 requires the kernel to allocate a
> file descriptor table with ~1 billion entries, which fails with ENOMEM.
2018. Can you suggest why we (or I) haven't heard about this?
> Cap the nr_open value used for the test's own arithmetic to a known
> reasonable base value (1048576) and restore the true original value
> once the test has completed.
>
> [1] https://github.com/systemd/systemd/commit/a8b627aaed409a15260c25988970c795bf963812
> ("main: bump fs.nr_open + fs.max-file to their largest possible values")
Well, we do want selftests to run well on the kernel with which they
are shipped, so I'm thinking we should backport this into -stable
kernels. We can probably skip the Fixes:, but a cc:stable should be
added to capture this.
Thoughts?
next prev parent reply other threads:[~2026-08-30 1:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 16:57 [PATCH] selftests/core: fix unshare_test with large fs.nr_open Konstantin Khorenko
2026-08-30 1:26 ` Andrew Morton [this message]
2026-09-01 19:58 ` Konstantin Khorenko
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=20260829182622.401275404893ef640e8c81e1@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=eva.kurchatova@virtuozzo.com \
--cc=khorenko@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reddybalavignesh9979@gmail.com \
--cc=richard.weiyang@gmail.com \
--cc=shuah@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