Thread (40 messages) 40 messages, 6 authors, 2011-03-29

Re: [PATCH 3/5] mm: Implement IO-less balance_dirty_pages()

From: Vivek Goyal <vgoyal@redhat.com>
Date: 2011-03-16 20:22:52
Also in: linux-fsdevel

On Wed, Mar 16, 2011 at 08:58:44PM +0100, Jan Kara wrote:

[..]
quoted
quoted
quoted
Had a query.

- What makes sure that flusher thread will not stop writing back till all
  the waiters on the bdi have been woken up. IIUC, flusher thread will 
  stop once global background ratio is with-in limit. Is it possible that
  there are still some waiter on some bdi waiting for more pages to finish
  writeback and that might not happen for sometime. 
  Yes, this can possibly happen but once distribute_page_completions()
gets called (after a given time), it will notice that we are below limits
and wake all waiters.
Under normal circumstances, we should have a decent
estimate when distribute_page_completions() needs to be called and that
should be long before flusher thread finishes it's work. But in cases when
a bdi has only a small share of global dirty limit, what you describe can
possibly happen.
So if a bdi share is small then it can happen that global background
threshold is fine but per bdi threshold is not. That means
task_bdi_threshold is also above limit and IIUC, distribute_page_completion()
will not wake up the waiter until bdi_task_limit_exceeded() is in control.
  It will wake them. What you miss is the check right at the beginning of
distribute_page_completions():
      dirty_exceeded = check_dirty_limits(bdi, &st);
      if (dirty_exceeded < DIRTY_MAY_EXCEED_LIMIT) {
               /* Wakeup everybody */
...

  When we are globally below (background+limit)/2, dirty_exceeded is set to
DIRTY_OK or DIRTY_BACKGROUND and thus we just wake all the waiters.
Ok, thanks. Now I see it. 

Thanks
Vivek

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help