Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to limit amount of virtual memory used for files (was: Re: Tuning ZFS memory usage on NetBSD - call for advice)



On Tue, 20 Sep 2022, Matthias Petermann wrote:

In theory this looked exactly what I was looking for... unfortunately I can observe the same effect like I was doing before with the simple redirection. "File" grows to a maximum, the system starts to swap.


The system is still buffering even with `oflag=direct' because:

In sys/miscfs/genfs/genfs_io.c (-HEAD):

   1789  /*
   1790   * If the next chunk is smaller than DEV_BSIZE or extends past
   1791   * the current EOF, then fall back to buffered I/O.
   1792   */
   1793
   1794   if (len == 0 || uio->uio_offset + len > vp->v_size) {
   1795   	break;
   1796   }

So, O_DIRECT (for writes) on NetBSD only takes effect when _overwriting_
existing data--which is not very useful for regular files...

I don't know what to recommend now (various complicated schemes come to mind).
Maybe `oflag=dsync' to force writes?

-RVP


Home | Main Index | Thread Index | Old Index