Page MenuHomeFreeBSD

zfs: use VOP_NEED_INACTIVE
ClosedPublic

Authored by mjg on Oct 23 2019, 5:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 10, 5:43 AM
Unknown Object (File)
Thu, Mar 28, 11:21 PM
Unknown Object (File)
Thu, Mar 28, 4:29 PM
Unknown Object (File)
Mar 6 2024, 1:50 PM
Unknown Object (File)
Feb 12 2024, 12:45 AM
Unknown Object (File)
Feb 10 2024, 7:25 PM
Unknown Object (File)
Jan 12 2024, 4:02 PM
Unknown Object (File)
Dec 31 2023, 2:46 PM

Details

Summary

See r351584 for reasoning.

Sample results from make -j 40 bzImage:

beforeafter
96630750 (lockmgr:zfs)17400445 (rw:vm object)
19971882 (rw:vm object)9008902 (sleep mutex:zio_write_issue)
10328270 (spin mutex:sleepq chain)8802655 (spin mutex:sleepq chain)
6159891 (sleep mutex:vnode interlock)4737875 (sx:zp->z_acl_lock)
5128765 (spin mutex:sched lock 33)4459105 (rw:pmap pv list)
4995571 (spin mutex:sched lock 11)4343860 (sx:rrl->rr_lock)
4942302 (rw:pmap pv list)2906398 (lockmgr:zfs)

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I've been testing this patch for a while and it seems like…

it causes files written by LLD >= 9.0 (which uses ftruncate→mmap→rename→close)…

to become all zeroes after reboot.

(and possibly hangs on poweroff/reboot after the bufspacethings are done)

I see why, it misses one check. I'm probably going to fix this in a very different manner though. Thanks for the report!

  • perform a locked check for all conditions

@greg_unrelenting.technology does the updated patch work for you?

  • trylock since the routine is called with the interlock held

@greg_unrelenting.technology can you please retest on top fresh head? (specifically after r357070)

In D22130#512307, @mjg wrote:

@greg_unrelenting.technology can you please retest on top fresh head? (specifically after r357070)

No longer hangs on reboot, but zeroed files still happen :(

Can you prepare a short reproducer? Preferably few commands in total.

I ran into problems with previous of the patch but everything works fine for me with this one.

In D22130#512369, @mjg wrote:

Can you prepare a short reproducer? Preferably few commands in total.

echo 'int main() {}' > hello.c
clang90 -o hello hello.c
./hello # should work
reboot
# cd to same directory
./hello # should report an exec format error or whatever it is, the file will be all zeros

(cc should work as well, current has clang 9.x in base)

Thanks a lot, I'll look into it.

  • handle mmap

The problem was that the following was not taken into consideration:

if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 &&
    vm_object_mightbedirty(obj)) {
        VM_OBJECT_WLOCK(obj);
        vm_object_page_clean(obj, 0, 0, 0);
        VM_OBJECT_WUNLOCK(obj);
}

Now the testcase passes. Thanks a lot for testing.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 30 2020, 2:14 AM
Closed by commit rS357281: zfs: use VOP_NEED_INACTIVE (authored by mjg). · Explain Why
This revision was automatically updated to reflect the committed changes.