lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 Oct 2009 23:18:38 +0200
From:	Jan Kara <jack@...e.cz>
To:	Wu Fengguang <fengguang.wu@...el.com>
Cc:	Jan Kara <jack@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>,
	Theodore Tso <tytso@....edu>,
	Christoph Hellwig <hch@...radead.org>,
	Dave Chinner <david@...morbit.com>,
	Chris Mason <chris.mason@...cle.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"Li, Shaohua" <shaohua.li@...el.com>,
	Myklebust Trond <Trond.Myklebust@...app.com>,
	"jens.axboe@...cle.com" <jens.axboe@...cle.com>,
	Nick Piggin <npiggin@...e.de>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	Richard Kennedy <richard@....demon.co.uk>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 01/45] writeback: reduce calls to global_page_state in
	balance_dirty_pages()

On Sun 11-10-09 05:33:39, Wu Fengguang wrote:
> On Fri, Oct 09, 2009 at 11:12:31PM +0800, Jan Kara wrote:
> > > +			/* don't wait if we've done enough */
> > > +			if (pages_written >= write_chunk)
> > > +				break;
> > >  		}
> > > -
> > > -		if (bdi_nr_reclaimable + bdi_nr_writeback <= bdi_thresh)
> > > -			break;
> > > -		if (pages_written >= write_chunk)
> > > -			break;		/* We've done our duty */
> > > -
> >   Here, we had an opportunity to break from the loop even if we didn't
> > manage to write everything (for example because per-bdi thread managed to
> > write enough or because enough IO has completed while we were trying to
> > write). After the patch, we will sleep. IMHO that's not good...
> 
> Note that the pages_written check is moved several lines up in the patch :)
> 
> >   I'd think that if we did all that work in writeback_inodes_wbc we could
> > spend the effort on regetting and rechecking the stats...
> 
> Yes maybe. I didn't care it because the later throttle queue patch totally
> removed the loop and hence to need to reget the stats :)
  Yes, since the loop gets removed in the end, this does not matter. You
are right.

> > >  		schedule_timeout_interruptible(pause);
> > >
> > >  		/*
> > > @@ -577,8 +547,7 @@ static void balance_dirty_pages(struct a
> > >  			pause = HZ / 10;
> > >  	}
> > >
> > > -	if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh &&
> > > -			bdi->dirty_exceeded)
> > > +	if (!dirty_exceeded && bdi->dirty_exceeded)
> > >  		bdi->dirty_exceeded = 0;
> >   Here we fail to clear dirty_exceeded if we are over global dirty limit
> > but not over per-bdi dirty limit...
> 
> You must be mistaken: dirty_exceeded = (over bdi limit || over global limit),
> so !dirty_exceeded = (!over bdi limit && !over global limit).
  Exactly. Previously, the check was:
if (!over bdi limit)
  bdi->dirty_exceeded = 0;

  Now it is
if (!over bdi limit && !over global limit)
  bdi->dirty_exceeded = 0;

  That's clearly not equivalent which is what I was trying to point out.
But looking at where dirty_exceeded is used, your new way is probably more
useful. It's just a bit counterintuitive that bdi->dirty_exceeded is set
even if the per-bdi limit is not exceeded...

									Honza

--
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ