Subject: Re: direct I/O again
To: Chuck Silvers <chuq@chuq.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-kern
Date: 04/04/2006 20:53:25
chuq@chuq.com said:
> direct I/O is another transient case, it is very much like physio.

Ah, I see. Just had a look at your latest patch.
Uses phys_map and does the same as vmapbuf()... so why doesn't
it use vmapbuf()? Or looking from the other side, why is vmapbuf md?

> > check against uvmexp.wiredmax and/or
> > p_rlimit[RLIMIT_MEMLOCK].rlim_cur
> what cases do you see that need such a check that do not already have one?

There was one in sysctl(), and there is still the "rrunner" driver
which passes unchecked ranges to vslock() afaics.
My local data acquisition applications do vslock() a lot to get
data into user supplied buffers. (physio() isn't well suited because
MAXPHYS is too small for good performance)
Doing the checks separately is ugly, and integrating them into a vslock-
like call would give us a chance to avoid the inherent race condition.

While we are here... many drivers use DMA to transfer data, so wouldn't
it make sense to formalize this somehow and skip the "map into kvm"
if possible?

best regards
Matthias