On Thu, Oct 01, 2026 at 09:08:33AM +0200, David Hildenbrand (Arm) wrote:
> On 9/30/26 01:57, Hajime Tazaki wrote:
> > Architectures lacking MMU don't support fork(2) syscall and only
> > vfork(2) is available with limitations.  Thus, we cannot run kselftest
> > on nommu architecture as is.
> >
> > This commit addresses this issue with the following changes:
> >
> > - on test run stage, avoid calling timeout command when NOMMU=1 variable
> >   added to environmental variable, since timeout command uses fork
> >   syscall which nommu platform doesn't support.
> > - describe the difference of nommu tests in the document.
> >
> > So command line to build/execute tests for nommu should be like below:
> >
> >  $ make ARCH=um NOMMU=1 O=build kselftest-all TARGETS=nommu
> >  $ make ARCH=um NOMMU=1 O=build kselftest-install TARGETS=nommu
> >  $ NOMMU=1 ./build/kselftest/kselftest_install/run_kselftest.sh -p \
> >    -c nommu
>
> Is there a way we could derive that from the environment in one of these 
> cases?

I thought maybe uname could help but our LLM overlords tell me no.

It pointed at something though.

In fs/proc/meminfo.c:

#ifndef CONFIG_MMU
        show_val_kb(m, "MmapCopy:       ",
                    (unsigned long)atomic_long_read(&mmap_pages_allocated));
#endif

So MmapCopy in /proc/meminfo tells us definitively, weirdly enough.

Therefore you could have:

function is_nommu()
{
        grep -q "^MmapCopy:" /proc/meminfo
}

if is_nommu; then
        ...
fi

>
> I'd assume once could compile and run the nommu um variant, and within there
> simply build the selftests and run them?

Yeah be nice to have something that made it easy.

I'm quite excited about nommu uml in general for the purposes of easily testing
nommu stuff!

>
> --
> Cheers,
>
> David

--
Cheers, Lorenzo

Reply via email to