Skip to content
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

Kmem rework #2796

Closed
wants to merge 3 commits into from
Closed

Kmem rework #2796

wants to merge 3 commits into from

Conversation

ryao
Copy link
Contributor

@ryao ryao commented Oct 13, 2014

This is the accessory pull request for openzfs/spl#369.

@ryao ryao force-pushed the kmem-rework branch 2 times, most recently from 96e6306 to 67068fb Compare October 13, 2014 11:21
@ryao ryao mentioned this pull request Oct 13, 2014
@ryao
Copy link
Contributor Author

ryao commented Oct 13, 2014

Additional work is necessary to revert patches that changed KM_SLEEP to KM_PUSHPAGE, but that can be done independently of marking transactions with PF_TRANS.

ryao added 2 commits October 23, 2014 14:41
We store the bdi in the superblock. This is accessed using virt_to_page
in bit_waitqueue(), which does not work on kernel virtual memory. We
switch to kzalloc()/kfree() to fix this.

Signed-off-by: Richard Yao <[email protected]>
It was thought that we could ensure forward progress by avoiding memory
allocations during transaction processing and avoiding KM_SLEEP in the
few instances in which we could not.

Recent tests involving L2ARC on systems without swap have shown that
this is not enough. VMWare's bencharmk on a system with 8GB of RAM and
200GB of L2ARC will reliably deadlock when atime is enabled, but will
run fine when atime is not enabled. This was initially thought to be a
mix of an extreme case of ARC contention and atime updates somehow
blocking on transaction group commit, but further examination showed
that only 137MB of RAM were in use by L2ARC's headers and additional
testing showed no deadlocks occurred with 24GB of RAM when atime was
enabled.

Subsequent review of the code revealed that the only change was that
direct reclaim no longer started transactions to perform atime updates.
The logical conclusion is that direct reclaim can occur in locations
that hold locks that block an open transaction through some unforeseen
dependency chain. This patch attempts to address that by modifying the
KM_SLEEP avoidance mechanism to be used in all transaction processing,
rather than just operations on zvols. We also take the opportunity to do
some cleanup by replacing PF_NOIO with PF_FSTRANS, which is the proper
Linux flag for this.

Signed-off-by: Richard Yao <[email protected]>
The initial port of ZFS to Linux required a way to identify virtual
memory to make IO to virtual memory backed slabs work, so kmem_virt()
was created. Linux 2.6.25 introduced is_vmalloc_addr(), which is
logically equivalent to kmem_virt(). Support for kernels before 2.6.26
was later dropped and more recently, support for kernels before Linux
2.6.32 has been dropped. We retire kmem_virt() in favor of
is_vmalloc_addr() to cleanup the code.

Signed-off-by: Richard Yao <[email protected]>
@edillmann
Copy link
Contributor

@ryao Hi, is there any progress on this PR ?

@behlendorf
Copy link
Contributor

@edillmann It's dependent on its spl counterpart which we're making steady progress on. It's getting close and I expect it will be part of the next tag.

@behlendorf behlendorf added this to the 0.6.4 milestone Nov 19, 2014
@edillmann
Copy link
Contributor

@behlendorf thanks for this update

@behlendorf behlendorf mentioned this pull request Nov 21, 2014
@behlendorf
Copy link
Contributor

Replaced by #2918

@behlendorf behlendorf closed this Dec 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Memory Management kernel memory management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants