linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Carlos Alberto Lopez Perez <clopez@igalia.com>,
	Dave Chinner <david@fromorbit.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"bugzilla-daemon@bugzilla.kernel.org"
	<bugzilla-daemon@bugzilla.kernel.org>,
	"daaugusto@gmail.com" <daaugusto@gmail.com>,
	"kernel-bugzilla@cygnusx-1.org" <kernel-bugzilla@cygnusx-1.org>,
	"listposter@gmail.com" <listposter@gmail.com>,
	"justincase@yopmail.com" <justincase@yopmail.com>,
	Tao Ma <tm@tao.ma>, Jens Axboe <axboe@kernel.dk>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [Bug 18632] "INFO: task" dpkg "blocked for more than 120 seconds.
Date: Thu, 9 Jun 2011 09:23:57 -0400	[thread overview]
Message-ID: <20110609132357.GA9928@infradead.org> (raw)
In-Reply-To: <20110609124315.GA8789@localhost>

Here is a patch that removes the XFS-internal writing of data in sync
and instead trusts the VFS code to get it right, and also does the
ioend_wait under a lock, to protect against new pending I/Os showing up.

It passed a single xfsqa run so far, so at least it won't blow up
completely.

Can you check if that helps with your livelock test case?  (And yes, I
should go and try it myself.  Will do as soon as I'll get a bit more
time).


Index: xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_super.c	2011-06-09 14:17:06.952532698 +0200
+++ xfs/fs/xfs/linux-2.6/xfs_super.c	2011-06-09 14:17:36.742531190 +0200
@@ -991,7 +991,7 @@ xfs_fs_write_inode(
 		 * ->sync_fs call do that for thus, which reduces the number
 		 * of synchronous log foces dramatically.
 		 */
-		xfs_ioend_wait(ip);
+//		xfs_ioend_wait(ip);
 		xfs_ilock(ip, XFS_ILOCK_SHARED);
 		if (ip->i_update_core) {
 			error = xfs_log_inode(ip);
Index: xfs/fs/xfs/linux-2.6/xfs_sync.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_sync.c	2011-06-09 14:16:59.575866405 +0200
+++ xfs/fs/xfs/linux-2.6/xfs_sync.c	2011-06-09 14:22:31.675849591 +0200
@@ -215,6 +215,19 @@ xfs_inode_ag_iterator(
 }
 
 STATIC int
+xfs_wait_ioend_cb(
+	struct xfs_inode	*ip,
+	struct xfs_perag	*pag,
+	int			flags)
+{
+	xfs_ilock(ip, XFS_IOLOCK_SHARED);
+	xfs_ioend_wait(ip);
+	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
+
+	return 0;
+}
+
+STATIC int
 xfs_sync_inode_data(
 	struct xfs_inode	*ip,
 	struct xfs_perag	*pag,
@@ -359,14 +372,14 @@ xfs_quiesce_data(
 {
 	int			error, error2 = 0;
 
-	/* push non-blocking */
-	xfs_sync_data(mp, 0);
-	xfs_qm_sync(mp, SYNC_TRYLOCK);
-
-	/* push and block till complete */
-	xfs_sync_data(mp, SYNC_WAIT);
 	xfs_qm_sync(mp, SYNC_WAIT);
 
+	error = xfs_inode_ag_iterator(mp, xfs_wait_ioend_cb, 0);
+	if (error)
+		return XFS_ERROR(error);
+
+	xfs_log_force(mp, XFS_LOG_SYNC);
+
 	/* write superblock and hoover up shutdown errors */
 	error = xfs_sync_fsdata(mp);
 

  reply	other threads:[~2011-06-09 13:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-18632-27@https.bugzilla.kernel.org/>
     [not found] ` <201106082138.p58Lchgj002615@demeter2.kernel.org>
     [not found]   ` <20110608150241.8412a63d.akpm@linux-foundation.org>
2011-06-09  3:32     ` [Bug 18632] "INFO: task" dpkg "blocked for more than 120 seconds Wu Fengguang
2011-06-09  3:54       ` Wu Fengguang
2011-06-09  8:27         ` Christoph Hellwig
2011-06-09  9:09           ` Wu Fengguang
2011-06-09 11:02             ` Christoph Hellwig
2011-06-09 12:11               ` Wu Fengguang
2011-06-09 12:17                 ` Wu Fengguang
2011-06-09 12:17                 ` Christoph Hellwig
2011-06-09 12:43                   ` Wu Fengguang
2011-06-09 13:23                     ` Christoph Hellwig [this message]
2011-06-10  3:21                       ` Wu Fengguang
2011-06-19 15:56                         ` Christoph Hellwig
2011-06-19 16:33                           ` Wu Fengguang
2011-06-09 13:56                     ` Tao Ma
2011-06-09 14:12                 ` Tao Ma
2011-06-09 14:21                   ` Christoph Hellwig
2011-06-09 14:32                     ` Vivek Goyal
2011-06-09 14:51                       ` Tao Ma

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=20110609132357.GA9928@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=clopez@igalia.com \
    --cc=daaugusto@gmail.com \
    --cc=david@fromorbit.com \
    --cc=fengguang.wu@intel.com \
    --cc=jack@suse.cz \
    --cc=justincase@yopmail.com \
    --cc=kernel-bugzilla@cygnusx-1.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=listposter@gmail.com \
    --cc=tm@tao.ma \
    --cc=vgoyal@redhat.com \
    /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).