extend usage of lightweight mm counter operations
Subsystems (5)
PATCH 1/1 extend usage of lightweight mm counter operations
Extend usage of Nick's lightweight mm counter operations to:
- nr_dirty: in __set_page_dirty_nobuffers and __set_page_dirty_buffers, where interrupts are disabled due to acquision of mapping->tree_lock.
- nr_page_table_pages: which is never accessed from interrupt context.
- pgfault/pgmajfault: which are never accessed from interrupt context.
There are still a few more to go...
fs/buffer.c +1 -1
@@ -858,7 +858,7 @@ int __set_page_dirty_buffers(struct pagewrite_lock_irq (&mapping->tree_lock);if (page->mapping) {/* Race with truncate? */ if (mapping_cap_account_dirty (mapping)) -inc_page_state (nr_dirty); +__inc_page_state (nr_dirty);radix_tree_tag_set (&mapping->page_tree,page_index (page),PAGECACHE_TAG_DIRTY );
include/linux/page-flags.h +3 -1
@@ -93,7 +93,8 @@ struct page_state {unsigned long nr_dirty;/* Dirty writeable pages */ unsigned long nr_writeback;/* Pages under writeback */ unsigned long nr_unstable;/* NFS unstable pages */ -unsigned long nr_page_table_pages;/* Pages used for pagetables */ +unsigned long nr_page_table_pages;/* Pages used for pagetables. +* only modified from process ctx. */ unsigned long nr_mapped;/* mapped into pagetables. * only modified from process context */ unsigned long nr_slab;/* In slab */
@@ -119,6 +120,7 @@ struct page_state {unsigned long pgfault;/* faults (major+minor) */ unsigned long pgmajfault;/* faults (major only) */ +/* both modified from proc. ctx. only */ unsigned long pgrefill_high;/* inspected in refill_inactive_zone */ unsigned long pgrefill_normal;
mm/filemap.c +2 -2
@@ -1263,7 +1263,7 @@ retry_find:*/ if (!did_readaround) { majmin =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +__inc_page_state (pgmajfault); } did_readaround =1 ; ra_pages =max_sane_readahead (file->f_ra.ra_pages);
@@ -1334,7 +1334,7 @@ no_cached_page: page_not_uptodate:if (!did_readaround) { majmin =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +__inc_page_state (pgmajfault); }lock_page (page);
mm/memory.c +4 -4
@@ -116,7 +116,7 @@ static void free_pte_range(struct mmu_gapmd_clear (pmd);pte_lock_deinit (page);pte_free_tlb (tlb, page); -dec_page_state (nr_page_table_pages); +__dec_page_state (nr_page_table_pages); tlb->mm->nr_ptes--; }
@@ -302,7 +302,7 @@ int __pte_alloc(struct mm_struct *mm, pmpte_free (new); }else { mm->nr_ptes++; -inc_page_state (nr_page_table_pages); +__inc_page_state (nr_page_table_pages);pmd_populate (mm, pmd, new); }spin_unlock (&mm->page_table_lock);
@@ -1889,7 +1889,7 @@ again:/* Had to read the page from swap area: Major fault */ ret =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +__inc_page_state (pgmajfault);grab_swap_token (); }
@@ -2255,7 +2255,7 @@ int __handle_mm_fault(struct mm_struct *__set_current_state (TASK_RUNNING ); -inc_page_state (pgfault); +__inc_page_state (pgfault);if (unlikely (is_vm_hugetlb_page (vma)))return hugetlb_fault (mm, vma, address, write_access);
mm/page-writeback.c +1 -1
@@ -633,7 +633,7 @@ int __set_page_dirty_nobuffers(struct paif (mapping2) {/* Race with truncate? */ BUG_ON (mapping2 != mapping);if (mapping_cap_account_dirty (mapping)) -inc_page_state (nr_dirty); +__inc_page_state (nr_dirty);radix_tree_tag_set (&mapping->page_tree,page_index (page),PAGECACHE_TAG_DIRTY ); }
mm/shmem.c +1 -1
@@ -996,7 +996,7 @@ repeat:spin_unlock (&info->lock);/* here we actually do the io */ if (type && *type ==VM_FAULT_MINOR ) { -inc_page_state (pgmajfault); +__inc_page_state (pgmajfault); *type =VM_FAULT_MAJOR ; } swappage =shmem_swapin (info, swap, idx);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Err, parts of this are unsafe.
Quoted 5 lines · Marcelo Tosatti
Extend usage of Nick's lightweight mm counter operations to:
-
nr_dirty: in__set_page_dirty_nobuffersand__set_page_dirty_buffers, where interrupts are disabled due to acquision ofmapping->tree_lock.
These are good.
Quoted 3 lines
-
nr_page_table_pages: which is never accessed from interrupt context.- pgfault/pgmajfault: which are never accessed from interrupt context.
These are buggy due to preemption. Shall a three underscore variant be created to disable/enable preemption, or what?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>