Uiomove can only block when the segflag is UIO_USERSPACE,
otherwise we end up just doing a bcopy (or nothing) and
moving cursors. So only emit witness warnings and
set deadlock thread flags in the UIO_USERSPACE case.
Details
- Reviewers
jhb kib - Commits
- rS320738: Simplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/kern/subr_uio.c | ||
---|---|---|
221 ↗ | (On Diff #30438) | This re-enables witness warning for nofault case. I do not think this is correct. Simplest fix is to move the warning into else part of the if (nofault) statement below. |
223 ↗ | (On Diff #30438) | I wonder if we can remove this flag already. Probably not until all buffer cache consumers, like cd9660 and other filesystems, are fixed to use vn_io_fault(). |
224 ↗ | (On Diff #30438) | nofault is now silently ignored for kernel space. Might be, assert that nofault implies UIO_USERSPACE. |
sys/kern/subr_uio.c | ||
---|---|---|
221 ↗ | (On Diff #30438) | UIO_USERSPACE path calls maybe_yield() no matter what nofault is set to. I had assumed that required the witness warning. Is this assumption incorrect? |
223 ↗ | (On Diff #30438) | I was wondering about this. In a quick search, I could not find any callers of uiomove_nofault(), and uiomove_faultflag() is static, I thought I must be missing something. |
sys/kern/subr_uio.c | ||
---|---|---|
223 ↗ | (On Diff #30438) | The nofault facility AKA TDP_NOFAULTING is actively used. Perhaps the uiomove_nofault() way of entering the nofault thread state became unused due to circumstances and code changes. I do not think that it should be removed now, because the interface itself is potentially useful and can become utilized again in tree. |
sys/kern/subr_uio.c | ||
---|---|---|
223 ↗ | (On Diff #30438) | OK. To be clear, I meant the uiomove_nofault() entry point, not TDP_NOFAULTING. If you feel it should be preserved, I'm fine with that. Thanks for the quick feedback! |