NetBSD-Bugs archive


kern/47672: tmpfs fails to mount

>Number:         47672
>Category:       kern
>Synopsis:       tmpfs fails to mount
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 20 02:25:01 +0000 2013
>Originator:     Julio Merino
>Release:        NetBSD 6.99.17
System: NetBSD 6.99.17 NetBSD 6.99.17 (GENERIC) #15: Mon 
Mar 18 22:07:41 JST 2013
Architecture: x86_64
Machine: amd64
        When running the NetBSD test suite with Kyua on my machine (not
        in QEMU), all the tests that need to mount a tmpfs fail.  In fact,
        mounting a tmpfs after the test suite has run fails as well
        indefinitely and the only solution I've found is to reboot the

        I'm running current amd64 on a VMware virtual machine that has 2
        cores and 1GB of RAM.

        The way mount_tmpfs fails is due to an EINVAL error returned from
        mount(2).  Upon further investigation, I found that this is being
        returned from tmpfs_mount() in:

        if (tmpfs_mem_info(true) < TMPFS_PAGES_RESERVED)
                return EINVAL;

        The tmpfs_mem_info(true) call is returning 0 and TMPFS_PAGES_RESERVED
        is 1024, which of course makes this test fail.

        Additionally, I have found the following messages in my dmesg that
        might be related:

        pmap_unwire: wiring for pmap 0xfffffe800c802670 va 0x7f7ff7b0a000 did 
not change!
        pmap_unwire: wiring for pmap 0xfffffe800c802670 va 0x7f7ff7b0c000 did 
not change!
        pmap_unwire: wiring for pmap 0xfffffe800c802670 va 0x7f7ff7b0f000 did 
not change!

        They appear right before my debugging printf()s in tmpfs_mount(), and
        they appeared only once in all my debugging efforts.  Probably a
        red herring...

        If I change the order of the tests in the test suite so that fs/tmpfs/
        runs earlier, then the tests pass because mount_tmpfs just works.
        So I deduce that either some specific test in the test suite is
        messing up the memory (very memory aggressive?), or the amount of
        tests run beforehand mess up the memory somehow.
        Build NetBSD with MKKYUA=yes and run "kyua test" within /usr/tests.
        Maybe run it twice.

        Interestingly, I cannot get this to fail in qemu but maybe it's
        because the qemu VM is quiescent otherwise and nothing interferes
        with the tests.

        One reason that might explain why this triggers with Kyua and not
        with atf-run is that Kyua spawns way more subprocesses while running
        tests, which in turn cause more churn on the memory and might explain
        this.  But if this was the case, running the tests twice in atf-run
        should reproduce this (haven't tried).  I have verified that Kyua
        does not use huge amounts of memory, so this is not the issue.
        Dunno, but something is wrong in tmpfs.


Home | Main Index | Thread Index | Old Index