Re: How can I bypass the buffer cache or disable it for a process?
Date: Thu, 06 Aug 2026 05:53:08 UTC
On 8/5/26 22:39, Michael Schuster wrote: > > > On Thu, 6 Aug 2026, 01:24 Bob Bishop, <rb@gid.co.uk > <mailto:rb@gid.co.uk>> wrote: > > Hi, > >> On 4 Aug 2026, at 23:45, Friedrich Doku >> <friedrichdoku2030@u.northwestern.edu >> <mailto:friedrichdoku2030@u.northwestern.edu>> wrote: >> >> Hello, >> >> Is there a way to reliably run a single userspace process such >> that all of its I/O (reads and writes) bypasses the UFS buffer cache? > > The short answer is probably “no”. > > > Doesn't FreeBSD support direct I/O? > It has O_DIRECT for the open() system. That may or may not help. OP has not stated if his interest is a single specific executable, which he may adapted for O_DIRECT, or for any generic executable that he may wish to run. Also, note that O_DIRECT does not mean caching will never happen. See open(2) for more info. -- steve