提交 a4b526b3 编写于 作者: M Martin Schwidefsky

[S390] Optimize storage key operations for anon pages

For anonymous pages without a swap cache backing the check in
page_remove_rmap for the physical dirty bit in page_remove_rmap is
unnecessary. The instructions that are used to check and reset the dirty
bit are expensive. Removing the check noticably speeds up process exit.
In addition the clearing of the dirty bit in __SetPageUptodate is
pointless as well. With these two changes there is no storage key
operation for an anonymous page anymore if it does not hit the swap
space.

The micro benchmark which repeatedly executes an empty shell script
gets about 5% faster.
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 934b2857
...@@ -239,9 +239,6 @@ static inline void __SetPageUptodate(struct page *page) ...@@ -239,9 +239,6 @@ static inline void __SetPageUptodate(struct page *page)
{ {
smp_wmb(); smp_wmb();
__set_bit(PG_uptodate, &(page)->flags); __set_bit(PG_uptodate, &(page)->flags);
#ifdef CONFIG_S390
page_clear_dirty(page);
#endif
} }
static inline void SetPageUptodate(struct page *page) static inline void SetPageUptodate(struct page *page)
......
...@@ -667,7 +667,8 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma) ...@@ -667,7 +667,8 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma)
* Leaving it set also helps swapoff to reinstate ptes * Leaving it set also helps swapoff to reinstate ptes
* faster for those pages still in swapcache. * faster for those pages still in swapcache.
*/ */
if (page_test_dirty(page)) { if ((!PageAnon(page) || PageSwapCache(page)) &&
page_test_dirty(page)) {
page_clear_dirty(page); page_clear_dirty(page);
set_page_dirty(page); set_page_dirty(page);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册