]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] Optimize storage key operations for anon pages
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 1 Aug 2008 14:39:12 +0000 (16:39 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 1 Aug 2008 14:39:30 +0000 (16:39 +0200)
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: Martin Schwidefsky <schwidefsky@de.ibm.com>
include/linux/page-flags.h
mm/rmap.c

index 54590a9a103e22a341362623599135f0c3c01cae..25aaccdb2f26ea3f091939764882d86bffa901ad 100644 (file)
@@ -239,9 +239,6 @@ static inline void __SetPageUptodate(struct page *page)
 {
        smp_wmb();
        __set_bit(PG_uptodate, &(page)->flags);
-#ifdef CONFIG_S390
-       page_clear_dirty(page);
-#endif
 }
 
 static inline void SetPageUptodate(struct page *page)
index 99bc3f9cd796f34a58ec1d61798c27c583a0eaf3..94a5246a3f98b9e9b0ef71172bb184f561c0c294 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -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
                 * 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);
                        set_page_dirty(page);
                }