Page MenuHomeFreeBSD

ffs_syncvnode: Remove spammy print
ClosedPublic

Authored by cem on Jul 13 2018, 5:57 PM.
Tags
None
Referenced Files
F106113160: D16258.diff
Wed, Dec 25, 2:51 PM
Unknown Object (File)
Tue, Dec 10, 6:08 AM
Unknown Object (File)
Oct 21 2024, 4:40 AM
Unknown Object (File)
Oct 19 2024, 2:43 PM
Unknown Object (File)
Oct 4 2024, 10:46 PM
Unknown Object (File)
Oct 2 2024, 12:14 PM
Unknown Object (File)
Oct 2 2024, 11:01 AM
Unknown Object (File)
Sep 30 2024, 11:39 PM
Subscribers
None

Details

Summary

It is relatively common for new writes to occur to a file concurrent with
fsync(2) on that file. Do not produce a spammy warning in that case, even
in INVARIANTS mode.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18013
Build 17765: arc lint + arc unit

Event Timeline

It is not common for new writes to occur, because fsync() locks the vnode and that blocks writers. It is usually softdep re-dirtying the buffers which cause ffs_syncvnode() to loop long.

But I did not see any use for this messages anyway.

This revision is now accepted and ready to land.Jul 13 2018, 8:31 PM
In D16258#344889, @kib wrote:

It is not common for new writes to occur, because fsync() locks the vnode and that blocks writers.

Oh, good point. I had forgotten about that. Does that also block mmap writes?

It is usually softdep re-dirtying the buffers which cause ffs_syncvnode() to loop long.

But I did not see any use for this messages anyway.

Can it occur in other situations? We have seen it a few times over the last decade, even with SU disabled. Often the associated process was syslogd.

In D16258#345031, @cem wrote:
In D16258#344889, @kib wrote:

It is not common for new writes to occur, because fsync() locks the vnode and that blocks writers.

Oh, good point. I had forgotten about that. Does that also block mmap writes?

It cannot block writes to the mmaped pages. But running fsync does not see them.

Dirty pages needs to be converted to the dirty buffers, this is done by the vm_object_clean_pages() function, which is typically called by the syncer, see vfs_msync(). Since the function needs the vnode locked, it is blocked by the running fsync.

OTOH, when the buffer is prepared for write, all its pages are remapped r/o, see vfs_busy_pages(). So the pages of the dirty buffer found by the loop cannot be modified while write is performed.

It is usually softdep re-dirtying the buffers which cause ffs_syncvnode() to loop long.

But I did not see any use for this messages anyway.

Can it occur in other situations? We have seen it a few times over the last decade, even with SU disabled. Often the associated process was syslogd.

I can only think about failing writes re-dirtying the buffers with error.

In D16258#345051, @kib wrote:
In D16258#345031, @cem wrote:
In D16258#344889, @kib wrote:

It is not common for new writes to occur, because fsync() locks the vnode and that blocks writers.

Oh, good point. I had forgotten about that. Does that also block mmap writes?

It cannot block writes to the mmaped pages. But running fsync does not see them.

Dirty pages needs to be converted to the dirty buffers, this is done by the vm_object_clean_pages() function, which is typically called by the syncer, see vfs_msync(). Since the function needs the vnode locked, it is blocked by the running fsync.

OTOH, when the buffer is prepared for write, all its pages are remapped r/o, see vfs_busy_pages(). So the pages of the dirty buffer found by the loop cannot be modified while write is performed.

It is usually softdep re-dirtying the buffers which cause ffs_syncvnode() to loop long.

But I did not see any use for this messages anyway.

Can it occur in other situations? We have seen it a few times over the last decade, even with SU disabled. Often the associated process was syslogd.

I can only think about failing writes re-dirtying the buffers with error.

Thanks!

In D16258#345051, @kib wrote:

I can only think about failing writes re-dirtying the buffers with error.

...and that code is likely to disappear soon.

This revision was automatically updated to reflect the committed changes.