Re: [PATCH] fix task dirty balancing

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Zijlstra <a.p.zijlstra@...>
Cc: YAMAMOTO Takashi <yamamoto@...>, <linux-kernel@...>, Andrew Morton <akpm@...>, linux-fsdevel <linux-fsdevel@...>, Nick Piggin <nickpiggin@...>
Date: Saturday, July 5, 2008 - 2:04 am

On Wed, 02 Jul 2008 22:27:18 +0200
Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

Hmm, a bit complicated for me.

At first, there are 2 __set_page_dirty() in the kernel.
  - mm/page-writeback.c: __set_page_dirty()
              .... set_page_dirty() calls this.
  - fs/buffer.c : __set_page_dirty()
              .... __set_page_dirty_buffers() and mark_buffer_dirty() calls this.

Why per-task dirty acconitng is done in mm/page-writeback.c::set_page_dirty() ?

It seems other accounting is done in the fs/buffer.c: __set_page_dirty()

The purpose of task-dirty accounting is different from others  ?

= fs/buffer.c
 697 static int __set_page_dirty(struct page *page,
 698                 struct address_space *mapping, int warn)
 699 {
 700         if (unlikely(!mapping))
 701                 return !TestSetPageDirty(page);
 702 
 703         if (TestSetPageDirty(page))
 704                 return 0;
 705 
 706         write_lock_irq(&mapping->tree_lock);
 707         if (page->mapping) {    /* Race with truncate? */
 708                 WARN_ON_ONCE(warn && !PageUptodate(page));
 709 
 710                 if (mapping_cap_account_dirty(mapping)) {
 711                         __inc_zone_page_state(page, NR_FILE_DIRTY);
 712                         __inc_bdi_stat(mapping->backing_dev_info,
 713                                         BDI_RECLAIMABLE);
 714                         task_io_account_write(PAGE_CACHE_SIZE);
 715                 }
 716                 radix_tree_tag_set(&mapping->page_tree,
 717                                 page_index(page), PAGECACHE_TAG_DIRTY);
 718         }
 719         write_unlock_irq(&mapping->tree_lock);
 720         __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
 721 
 722         return 1;
==

And task-dirty-limit don't have to take care of following 2 case ?
  - __set_page_dirty_nobuffers(struct page *page) (increment BDI_RECRAIMABLE)
  - test_set_page_writeback() (increment BDI_RECLAIMABLE)

Thanks,
-Kame




--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Wed Jul 2, 4:26 am)
Re: [PATCH] fix task dirty balancing, Peter Zijlstra, (Wed Jul 2, 4:27 pm)
Re: [PATCH] fix task dirty balancing, KAMEZAWA Hiroyuki, (Sat Jul 5, 2:04 am)
Re: [PATCH] fix task dirty balancing, Peter Zijlstra, (Sat Jul 5, 5:30 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Tue Jul 8, 7:38 pm)
Re: [PATCH] fix task dirty balancing, Nick Piggin, (Wed Jul 9, 3:41 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Wed Jul 9, 11:10 pm)
Re: [PATCH] fix task dirty balancing, Nick Piggin, (Thu Jul 10, 3:23 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Wed Jul 23, 8:27 pm)
Re: [PATCH] fix task dirty balancing, Nick Piggin, (Thu Jul 24, 11:08 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Fri Jul 25, 4:04 am)
Re: [PATCH] fix task dirty balancing, Peter Zijlstra, (Fri Jul 25, 5:57 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Mon Jul 28, 1:50 am)
Re: [PATCH] fix task dirty balancing, Peter Zijlstra, (Mon Jul 28, 3:24 am)
Re: [PATCH] fix task dirty balancing, Nick Piggin, (Mon Jul 7, 6:36 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Mon Jul 7, 2:46 am)
Re: [PATCH] fix task dirty balancing, YAMAMOTO Takashi, (Thu Jul 3, 3:33 am)