mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
Resurrect 'try_to_free_buffers()' VM hackery
It's not pretty, but it appears that ext3 with data=journal will clean pages without ever actually telling the VM that they are clean. This, in turn, will result in the VM (and balance_dirty_pages() in particular) to never realize that the pages got cleaned, and wait forever for an event that already happened. Technically, this seems to be a problem with ext3 itself, but it used to be hidden by 'try_to_free_buffers()' noticing this situation on its own, and just working around the filesystem problem. This commit re-instates that hack, in order to avoid a regression for the 2.6.20 release. This fixes bugzilla 7844: http://bugzilla.kernel.org/show_bug.cgi?id=7844 Peter Zijlstra points out that we should probably retain the debugging code that this removes from cancel_dirty_page(), and I agree, but for the imminent release we might as well just silence the warning too (since it's not a new bug: anything that triggers that warning has been around forever). Acked-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Jens Axboe <jens.axboe@oracle.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5ad0d383dd
commit
ecdfc9787f
2 changed files with 28 additions and 8 deletions
|
@ -51,15 +51,22 @@ static inline void truncate_partial_page(struct page *page, unsigned partial)
|
|||
do_invalidatepage(page, partial);
|
||||
}
|
||||
|
||||
/*
|
||||
* This cancels just the dirty bit on the kernel page itself, it
|
||||
* does NOT actually remove dirty bits on any mmap's that may be
|
||||
* around. It also leaves the page tagged dirty, so any sync
|
||||
* activity will still find it on the dirty lists, and in particular,
|
||||
* clear_page_dirty_for_io() will still look at the dirty bits in
|
||||
* the VM.
|
||||
*
|
||||
* Doing this should *normally* only ever be done when a page
|
||||
* is truncated, and is not actually mapped anywhere at all. However,
|
||||
* fs/buffer.c does this when it notices that somebody has cleaned
|
||||
* out all the buffers on a page without actually doing it through
|
||||
* the VM. Can you say "ext3 is horribly ugly"? Tought you could.
|
||||
*/
|
||||
void cancel_dirty_page(struct page *page, unsigned int account_size)
|
||||
{
|
||||
/* If we're cancelling the page, it had better not be mapped any more */
|
||||
if (page_mapped(page)) {
|
||||
static unsigned int warncount;
|
||||
|
||||
WARN_ON(++warncount < 5);
|
||||
}
|
||||
|
||||
if (TestClearPageDirty(page)) {
|
||||
struct address_space *mapping = page->mapping;
|
||||
if (mapping && mapping_cap_account_dirty(mapping)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue