FBSD: Skip page flush in afs_DoPartialWrite 63/14163/6
authorAndrew Deason <adeason@dson.org>
Thu, 2 Jan 2020 02:11:35 +0000 (20:11 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 2 Sep 2021 03:54:54 +0000 (23:54 -0400)
commit93b1d97986c6bc4c70743ca8f25f1f717dc71e94
treea85fc337cfcdbf99e0246d89cbccc3b17374c257
parent8333e8e6020331013af912acb92a308e4f5a1dd2
FBSD: Skip page flush in afs_DoPartialWrite

Currently, the FBSD afs_vop_putpages() will call afs_write(), which
can then go through afs_DoPartialWrite -> afs_StoreAllSegments ->
osi_VM_StoreAllSegments -> vm_object_page_clean, which will then try
to go through afs_vop_putpages() again.

In this call stack, we're only calling afs_StoreAllSegments to reduce
our dirty cache chunks (afs_StoreAllSegments does nothing if we don't
have that many dirty cache chunks); we don't need to reduce dirty
pages, so calling osi_VM_StoreAllSegments is not needed.

To avoid calling osi_VM_StoreAllSegments in this situation, add a new
flag AFS_NOVMSYNC, which skips the osi_VM_StoreAllSegments call and
just flushes the dirty cache chunks. Use this flag in
afs_DoPartialWrite on FBSD, and slightly refactor the ifdefs to reduce
some code duplication.

Change-Id: Id6bf9a7f4ac6d5f09b0249ca6ed11674d556e909
Reviewed-on: https://gerrit.openafs.org/14163
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs.h
src/afs/afs_segments.c