-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page fault in uiomove() causes deadlock #1689
Comments
It looks like reading from userland before we open the transaction will require a fair amount of refactoring. Solaris avoided the refactoring by implementing a hack that prefaults the pages before opening the transaction. ZFSOnLinux has that code commented out. Pre-faulting the pages causes a race between zfs_write and pageout where zfs_write must read the pages before page out removes them. It is quite likely that zfs_write() always wins the race on Solaris, but direct reclaim likely makes it easier to lose the race on Linux than on Solaris. Anyway, refactoring this to read from userland before opening the transaction is likely the right solution. |
This looks like yet another good reason to abandon using the virtual address space. If these buffers were mapped just as pages and not as part of the virtual address space we'd never take a page fault. @ryao have you tried just pulling the |
@behlendorf I have not yet had a chance to examine the backtraces to verify that the same lockup did not happen upon testing that deadlocked, but I can say that I already tried that and the system deadlocked anyway. What we have here a is kernel fault because a userland program's pages had been paged out. This is by design. We happen to be holding a lock that needs to be free to handle this fault, which what causes the problem. Our usage of the kernel virtual address space has no effect on this issue. In addition, we cannot wire down pages used in syscalls. I have been trying to get in touch with you to discuss this in IRC to discuss this. |
…IO writes; Apply locking fixes from Illumos; Reintroduce uio_prefaultpages() to minimize the possibility of hitting openzfs/zfs#1689; Add Linux 3.12 Support (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0xBEE84C64)
Closing as stale. |
I can reproducibly deadlock my desktop by running multiple instances of
python -c 'print 2**100**100'
. I did magic system request + t to get backtraces from my system's threads. In these backtraces, there are a few noticeable things.blocked on page-in.
This could be fixed by reading from userland before we open the transaction.
The text was updated successfully, but these errors were encountered: