Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35566
b: refs/heads/master
c: edc79b2
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed Sep 26, 2006
1 parent 4f376da commit 5c9479e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d08b3851da41d0ee60851f2c75b118e1f7a5fc89
refs/heads/master: edc79b2a46ed854595e40edcf3f8b37f9f14aa3f
1 change: 1 addition & 0 deletions trunk/include/linux/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ int sync_page_range(struct inode *inode, struct address_space *mapping,
loff_t pos, loff_t count);
int sync_page_range_nolock(struct inode *inode, struct address_space *mapping,
loff_t pos, loff_t count);
void set_page_dirty_balance(struct page *page);

/* pdflush.c */
extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
Expand Down
5 changes: 3 additions & 2 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <linux/module.h>
#include <linux/delayacct.h>
#include <linux/init.h>
#include <linux/writeback.h>

#include <asm/pgalloc.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -1571,7 +1572,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
unlock:
pte_unmap_unlock(page_table, ptl);
if (dirty_page) {
set_page_dirty(dirty_page);
set_page_dirty_balance(dirty_page);
put_page(dirty_page);
}
return ret;
Expand Down Expand Up @@ -2218,7 +2219,7 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
unlock:
pte_unmap_unlock(page_table, ptl);
if (dirty_page) {
set_page_dirty(dirty_page);
set_page_dirty_balance(dirty_page);
put_page(dirty_page);
}
return ret;
Expand Down
10 changes: 10 additions & 0 deletions trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ static void balance_dirty_pages(struct address_space *mapping)
pdflush_operation(background_writeout, 0);
}

void set_page_dirty_balance(struct page *page)
{
if (set_page_dirty(page)) {
struct address_space *mapping = page_mapping(page);

if (mapping)
balance_dirty_pages_ratelimited(mapping);
}
}

/**
* balance_dirty_pages_ratelimited_nr - balance dirty memory state
* @mapping: address_space which was dirtied
Expand Down

0 comments on commit 5c9479e

Please sign in to comment.