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]
Message-ID: <20090924161357.GL23126@kernel.dk>
Date:	Thu, 24 Sep 2009 18:13:57 +0200
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, fengguang.wu@...el.com,
	shaohua.li@...el.com, chris.mason@...cle.com, jack@...e.cz
Subject: Re: [PATCH 03/10] writeback: stop background writeback when below
	background threshold

On Thu, Sep 24 2009, Peter Zijlstra wrote:
> On Thu, 2009-09-24 at 17:03 +0200, Peter Zijlstra wrote:
> > On Thu, 2009-09-24 at 16:40 +0200, Jens Axboe wrote:
> > > From: Wu Fengguang <fengguang.wu@...el.com>
> > > 
> > > Treat bdi_start_writeback(0) as a special request to do background write,
> > > and stop such work when we are below the background dirty threshold.
> > > 
> > > Also simplify the (nr_pages <= 0) checks. Since we already pass in
> > > nr_pages=LONG_MAX for WB_SYNC_ALL and background writes, we don't
> > > need to worry about it being decreased to zero.
> > > 
> > > Reported-by: Richard Kennedy <richard@....demon.co.uk>
> > > CC: Jan Kara <jack@...e.cz>
> > > CC: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > > Signed-off-by: Wu Fengguang <fengguang.wu@...el.com>
> > > Signed-off-by: Jens Axboe <jens.axboe@...cle.com>
> > > ---
> > 
> > > @@ -720,20 +730,16 @@ static long wb_writeback(struct bdi_writeback *wb,
> > >  
> > >  	for (;;) {
> > >  		/*
> > > +		 * Stop writeback when nr_pages has been consumed
> > >  		 */
> > > +		if (args->nr_pages <= 0)
> > >  			break;
> > >  
> > >  		/*
> > > +		 * For background writeout, stop when we are below the
> > > +		 * background dirty threshold
> > >  		 */
> > > +		if (args->for_background && !over_bground_thresh())
> > >  			break;
> > 
> > 
> > What I'm not getting is why this is conditional on for_background(),
> > shouldn't we always stop writeback when below the background threshold?
> 
> Ah, that would be for things like sync, which need to write out
> everything, right?

Yes, wb_writeback() handles any kind of writeback. The definition of our
background writeout is to stop when we are no longer over the background
writeout threshold.

-- 
Jens Axboe

--
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