diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/filemap.c | 8 | ||||
-rw-r--r-- | mm/highmem.c | 5 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 | ||||
-rw-r--r-- | mm/swapfile.c | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 688682aad..43f1de720 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -294,7 +294,13 @@ int shrink_mmap(int priority, int gfp_mask) * of zone - it's old. */ if (page->buffers) { - int wait = ((gfp_mask & __GFP_IO) && (nr_dirty-- < 0)); + int wait; + /* + * 0 - free it if can do so without IO + * 1 - start write-out of dirty buffers + * 2 - wait for locked buffers + */ + wait = (gfp_mask & __GFP_IO) ? (nr_dirty-- < 0) ? 2 : 1 : 0; if (!try_to_free_buffers(page, wait)) goto unlock_continue; /* page was locked, inode can't go away under us */ diff --git a/mm/highmem.c b/mm/highmem.c index 91b45ae5a..834968569 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -86,9 +86,8 @@ struct page * replace_with_highmem(struct page * page) copy_page((void *)vaddr, (void *)page_address(page)); kunmap(highpage); - /* Preserve the caching of the swap_entry. */ - highpage->index = page->index; - highpage->mapping = page->mapping; + if (page->mapping) + BUG(); /* * We can just forget the old page since diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7843d553b..1e19a9109 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -385,7 +385,7 @@ unsigned int nr_free_buffer_pages (void) zone_t *zone; int i; - sum = nr_lru_pages; + sum = nr_lru_pages / 3; for (i = 0; i < NUMNODES; i++) for (zone = NODE_DATA(i)->node_zones; zone <= NODE_DATA(i)->node_zones+ZONE_NORMAL; zone++) sum += zone->free_pages; diff --git a/mm/swapfile.c b/mm/swapfile.c index 5d3a7f23e..a84e73f2f 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -315,10 +315,12 @@ static void unuse_process(struct mm_struct * mm, */ if (!mm) return; + vmlist_access_lock(mm); for (vma = mm->mmap; vma; vma = vma->vm_next) { pgd_t * pgd = pgd_offset(mm, vma->vm_start); unuse_vma(vma, pgd, entry, page); } + vmlist_access_unlock(mm); return; } |