Page MenuHomeFreeBSD

ffs_syncvnode: Remove spammy print
ClosedPublic

Authored by cem on Jul 13 2018, 5:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 3:56 AM
Unknown Object (File)
Dec 11 2023, 10:45 PM
Unknown Object (File)
Nov 27 2023, 8:09 AM
Unknown Object (File)
Nov 22 2023, 8:17 PM
Unknown Object (File)
Oct 19 2023, 10:51 PM
Unknown Object (File)
Jul 5 2023, 7:11 AM
Unknown Object (File)
Jul 5 2023, 7:10 AM
Unknown Object (File)
Jul 5 2023, 7:06 AM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.