Re: [PATCH] block2mtd: throttle writes by calling balance_dirty_pages_ratelimited.

2012-12-13 Thread Artem Bityutskiy
On Wed, 2012-12-12 at 19:32 +1100, NeilBrown wrote:
> 
> If you create a block2mtd device that is larger than main memory,
> and write to all of it, then lots of pages will be dirtied but
> they will never be flushed out as nothing calls any variant of
> balance_dirty_pages.
> 
> It would be nice to call set_page_dirty_balance(), but that isn't exported,
> so just call balance_dirty_pages_ratelimited() directly.
> 
> Signed-off-by: NeilBrown 

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] block2mtd: throttle writes by calling balance_dirty_pages_ratelimited.

2012-12-13 Thread Artem Bityutskiy
On Wed, 2012-12-12 at 19:32 +1100, NeilBrown wrote:
 
 If you create a block2mtd device that is larger than main memory,
 and write to all of it, then lots of pages will be dirtied but
 they will never be flushed out as nothing calls any variant of
 balance_dirty_pages.
 
 It would be nice to call set_page_dirty_balance(), but that isn't exported,
 so just call balance_dirty_pages_ratelimited() directly.
 
 Signed-off-by: NeilBrown ne...@suse.de

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy


signature.asc
Description: This is a digitally signed message part


[PATCH] block2mtd: throttle writes by calling balance_dirty_pages_ratelimited.

2012-12-12 Thread NeilBrown


If you create a block2mtd device that is larger than main memory,
and write to all of it, then lots of pages will be dirtied but
they will never be flushed out as nothing calls any variant of
balance_dirty_pages.

It would be nice to call set_page_dirty_balance(), but that isn't exported,
so just call balance_dirty_pages_ratelimited() directly.

Signed-off-by: NeilBrown 

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 681e2ee..2c3e8e7 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -62,6 +62,7 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t 
to, size_t len)
memset(page_address(page), 0xff, PAGE_SIZE);
set_page_dirty(page);
unlock_page(page);
+   balance_dirty_pages_ratelimited(mapping);
break;
}
 
@@ -152,6 +153,7 @@ static int _block2mtd_write(struct block2mtd_dev *dev, 
const u_char *buf,
memcpy(page_address(page) + offset, buf, cpylen);
set_page_dirty(page);
unlock_page(page);
+   balance_dirty_pages_ratelimited(mapping);
}
page_cache_release(page);
 


signature.asc
Description: PGP signature


[PATCH] block2mtd: throttle writes by calling balance_dirty_pages_ratelimited.

2012-12-12 Thread NeilBrown


If you create a block2mtd device that is larger than main memory,
and write to all of it, then lots of pages will be dirtied but
they will never be flushed out as nothing calls any variant of
balance_dirty_pages.

It would be nice to call set_page_dirty_balance(), but that isn't exported,
so just call balance_dirty_pages_ratelimited() directly.

Signed-off-by: NeilBrown ne...@suse.de

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 681e2ee..2c3e8e7 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -62,6 +62,7 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t 
to, size_t len)
memset(page_address(page), 0xff, PAGE_SIZE);
set_page_dirty(page);
unlock_page(page);
+   balance_dirty_pages_ratelimited(mapping);
break;
}
 
@@ -152,6 +153,7 @@ static int _block2mtd_write(struct block2mtd_dev *dev, 
const u_char *buf,
memcpy(page_address(page) + offset, buf, cpylen);
set_page_dirty(page);
unlock_page(page);
+   balance_dirty_pages_ratelimited(mapping);
}
page_cache_release(page);
 


signature.asc
Description: PGP signature