linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Derek Basehore <dbasehore@chromium.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/2] bdi: Fix hung task on sync
Date: Thu, 27 Feb 2014 17:13:07 +0100	[thread overview]
Message-ID: <20140227161307.GA5845@quack.suse.cz> (raw)
In-Reply-To: <20140225224330.GB8568@mtj.dyndns.org>

On Tue 25-02-14 17:43:30, Tejun Heo wrote:
> On Tue, Feb 25, 2014 at 11:29:13PM +0100, Jan Kara wrote:
> > From: Derek Basehore <dbasehore@chromium.org>
> > 
> > bdi_wakeup_thread_delayed() used the mod_delayed_work() function to
> > schedule work to writeback dirty inodes. The problem with this is that
> > it can delay work that is scheduled for immediate execution, such as the
> > work from sync_inodes_sb().  This can happen since mod_delayed_work()
> > can now steal work from a work_queue.  This fixes the problem by using
> > queue_delayed_work() instead. This is a regression caused by
> > 839a8e8660b6 "writeback: replace custom worker pool implementation with
> > unbound workqueue".
> > 
> > The reason that this causes a problem is that laptop-mode will change
> > the delay, dirty_writeback_centisecs, to 60000 (10 minutes) by default.
> > In the case that bdi_wakeup_thread_delayed() races with
> > sync_inodes_sb(), sync will be stopped for 10 minutes and trigger a hung
> > task. Even if dirty_writeback_centisecs is not long enough to cause a
> > hung task, we still don't want to delay sync for that long.
> > 
> > We fix the problem by using queue_delayed_work() when we want to
> > schedule writeback sometime in future. This function doesn't change the
> > timer if it is already armed.
> > 
> > For the same reason, we also change bdi_writeback_workfn() to
> > immediately queue the work again in the case that the work_list is not
> > empty. The same problem can happen if the sync work is run on the rescue
> > worker.
> > 
> > Fixes: 839a8e8660b6777e7fe4e80af1a048aebe2b5977
> > CC: stable@vger.kernel.org
> > Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> Reviewed-by: Tejun Heo <tj@kernel.org>
  Thanks for review. Did you have time to look into the patch 2/2?

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-02-27 16:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 22:29 [PATCH 0/2] bdi fixes Jan Kara
2014-02-25 22:29 ` [PATCH 1/2] bdi: Fix hung task on sync Jan Kara
2014-02-25 22:43   ` Tejun Heo
2014-02-27 16:13     ` Jan Kara [this message]
2014-02-25 22:29 ` [PATCH 2/2] bdi: Avoid oops on device removal Jan Kara
2014-02-27 20:07   ` Tejun Heo
2014-02-27 21:32     ` Jan Kara
2014-02-27 21:43 [PATCH 0/2 v2] bdi: Fix hung tasks and oops in writeback Jan Kara
2014-02-27 21:43 ` [PATCH 1/2] bdi: Fix hung task on sync Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140227161307.GA5845@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=dbasehore@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).