History

mm: Introduce mm_struct.has_pinned

(Commit message majorly collected from Jason Gunthorpe) Reduce the chance of false positive from page_maybe_dma_pinned() by keeping track if the mm_struct has ever been used with pin_user_pages(). This allows cases that might drive up the page ref_count to avoid any penalty from handling dma_pinned pages. Future work is planned, to provide a more sophisticated solution, likely to turn it into a real counter. For now, make it atomic_t but use it as a boolean for simplicity.

Peter Xu committed 6 years ago

Commit 008cfe41 parent a1bffa43 files · +17 −0Browse files

Showing the changes to kernel (1 of 3 files). Show all

Unified · Split

kernel/fork.c+1−0
@@ -1011,6 +1011,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, · 1010 unmodified lines
1011 mm_pgtables_bytes_init(mm);1011 mm_pgtables_bytes_init(mm);
1012 mm->map_count = 0;1012 mm->map_count = 0;
1013 mm->locked_vm = 0;1013 mm->locked_vm = 0;
1014 atomic_set(&mm->has_pinned, 0);
1014 atomic64_set(&mm->pinned_vm, 0);1015 atomic64_set(&mm->pinned_vm, 0);
1015 memset(&mm->rss_stat, 0, sizeof(mm->rss_stat));1016 memset(&mm->rss_stat, 0, sizeof(mm->rss_stat));
1016 spin_lock_init(&mm->page_table_lock);1017 spin_lock_init(&mm->page_table_lock);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t