public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Joerg Platte <jplatte@naasa.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: regression: 100% io-wait with 2.6.24-rcX
Date: Sun, 13 Jan 2008 14:44:34 +0800	[thread overview]
Message-ID: <400206690.16519@ustc.edu.cn> (raw)
Message-ID: <E1JDwaA-00017Q-W6@localhost.localdomain> (raw)
In-Reply-To: <200801130032.32495.jplatte@naasa.net>

[-- Attachment #1: Type: text/plain, Size: 2118 bytes --]

On Sun, Jan 13, 2008 at 12:32:30AM +0100, Joerg Platte wrote:
> Am Freitag, 11. Januar 2008 schrieb Fengguang Wu:
> > On Thu, Jan 10, 2008 at 11:03:05AM +0100, Joerg Platte wrote:
> > > Am Donnerstag, 10. Januar 2008 schrieb Fengguang Wu:
> > > > > problem, because the iowait problem disappeared today after the
> > > > > regular Debian update. I'll try to install the old package versions
> > > > > to make it show up again. Maybe that helps to debug it.
> > > >
> > > > Thank you. I'm running sid, ext2 as rootfs now ;-)
> > >
> > > The error is back and I'm getting thousands of messages like this with
> > > the patched kernel:
> > >
> > > mm/page-writeback.c 668 wb_kupdate: pdflush(146) 21115 global 3936 0 0 wc
> > > _M > tw 1024 sk 0 requeue_io 301: inode 81441 size 0 at 08:07(sda7)
> > > mm/page-writeback.c 668 wb_kupdate: pdflush(147) 17451 global 3936 0 0 wc
> > > _M > tw 1024 sk 2 requeue_io 301: inode 81441 size 0 at 08:07(sda7)
> > > mm/page-writeback.c 668 wb_kupdate: pdflush(147) 17451 global 3936 0 0 wc
> > > _M > tw 1024 sk 2 requeue_io 301: inode 81441 size 0 at 08:07(sda7)
> >
> > Joerg, what's the output of `dumpe2fs /dev/sda7` and `lsof|grep /tmp`?
> 
> After another reboot I tried to get more information about the konqueror 
> process possibly causing the iowait load by using strace -p. Here is the 
> output:
> 
> gettimeofday({1200180588, 878508}, NULL) = 0
> setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
> rt_sigaction(SIGVTALRM, {SIG_DFL}, {0xb5cffed0, [VTALRM], SA_RESTART}, 8) = 0
> gettimeofday({1200180588, 879942}, NULL) = 0
> time(NULL)                              = 1200180588
> gettimeofday({1200180588, 880838}, NULL) = 0
> gettimeofday({1200180588, 881284}, NULL) = 0

No idea yet :-/ I'm afraid I have to trouble you again - the bug just
refused to appear in my system. I prepared a kernel module for you to
gather more information:

make && insmod ext2-writeback-debug.ko && sleep 1s && rmmod ext2-writeback-debug
dmesg > ext2-writeback-debug.dmesg

Please do it when 100% iowait appears, and send the dmesg file.

Thank you,
Fengguang

[-- Attachment #2: Makefile --]
[-- Type: text/plain, Size: 187 bytes --]

obj-m := ext2-writeback-debug.o
KDIR  := /lib/modules/$(shell uname -r)/build
PWD   := $(shell pwd)

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:  
	rm -f *.mod.c *.ko *.o


[-- Attachment #3: ext2-writeback-debug.c --]
[-- Type: text/x-csrc, Size: 3607 bytes --]

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/writeback.h>
#include <linux/kprobes.h>
#include <linux/pagevec.h>

void print_page(struct page *page)
{
	printk(KERN_DEBUG "%lu\t%u\t%u\t%c%c%c%c%c\n",
			page->index,
			page_count(page),
			page_mapcount(page),
			PageUptodate(page)      ? 'U' : '_',
			PageDirty(page)         ? 'D' : '_',
			PageWriteback(page)     ? 'W' : '_',
			PagePrivate(page)       ? 'P' : '_',
			PageLocked(page)        ? 'L' : '_');
}

void print_writeback_control(struct writeback_control *wbc)
{
	printk(KERN_DEBUG
			"global dirty %lu writeback %lu nfs %lu\n"
			"wbc flags %c%c towrite %ld skipped %ld\n",
			global_page_state(NR_FILE_DIRTY),
			global_page_state(NR_WRITEBACK),
			global_page_state(NR_UNSTABLE_NFS),
			wbc->encountered_congestion ? 'C':'_',
			wbc->more_io ? 'M':'_',
			wbc->nr_to_write,
			wbc->pages_skipped);
}

void print_inode_pages(struct inode *inode)
{
	struct address_space *mapping = inode->i_mapping;
	struct pagevec pvec;
	int nr_pages;
	int i;
	pgoff_t index = 0;
	struct dentry *dentry;
	int dcount;
	char *dname;

	nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
			PAGECACHE_TAG_DIRTY,
			(pgoff_t)PAGEVEC_SIZE);

	if (list_empty(&inode->i_dentry)) {
		dname = "";
		dcount = 0;
	} else {
		dentry = list_entry(inode->i_dentry.next,
					struct dentry, d_alias);
		dname = dentry->d_iname;
		dcount = atomic_read(&dentry->d_count);
	}

	printk(KERN_DEBUG "inode %lu(%s/%s) count %d,%d size %llu pages %lu\n",
			inode->i_ino,
			inode->i_sb->s_id,
			dname,
			atomic_read(&inode->i_count),
			dcount,
			i_size_read(inode),
			mapping->nrpages
	      );

	for (i = 0; i < nr_pages; i++)
		print_page(pvec.pages[i]);
}

int handler_pre(struct kprobe *p, struct pt_regs *regs)
{
	static int count = 0;

	if (count++ < 10)
		dump_stack();

	return 0;
}

void handler_post(struct kprobe *p, struct pt_regs *regs, unsigned long flags)
{
}

static struct kprobe my_kprobe = {
	.pre_handler = handler_pre,
	.post_handler = handler_post,
	.symbol_name = "submit_bio"
};


static int jdo_ext2_writepage(struct page *page, struct writeback_control *wbc)
{
	struct inode * const inode = page->mapping->host;

	if (!i_size_read(inode)) {
		printk(KERN_DEBUG "ext2_writepage:\n");
		print_page(page);
		print_writeback_control(wbc);
	}

	jprobe_return();
	return 0;
}
static struct jprobe jprobe_ext2_writepage = {
	.entry = jdo_ext2_writepage,
	.kp.symbol_name = "ext2_writepage"
};


static void jdo_requeue_io(struct inode *inode)
{
	if (!i_size_read(inode)) {
		printk(KERN_DEBUG "requeue_io:\n");
		print_inode_pages(inode);
	}

	jprobe_return();
}
static struct jprobe jprobe_requeue_io = {
	.entry = jdo_requeue_io,
	.kp.symbol_name = "requeue_io"
};

static int setup_kprobe(struct kprobe *kprobe)
{
	int ret = register_kprobe(kprobe);
	printk("register_kprobe(%s) = %d\n", kprobe->symbol_name, ret);
	return ret;
}

static int setup_jprobe(struct jprobe *jprobe)
{
	int ret = register_jprobe(jprobe);
	printk("register_jprobe(%s) = %d\n", jprobe->kp.symbol_name, ret);
	return ret;
}

static int __init jprobe_init(void)
{
	int ret;

	ret = setup_jprobe(&jprobe_ext2_writepage);
	if (ret)
		return -1;

	ret = setup_jprobe(&jprobe_requeue_io);
	if (ret)
		return -1;

	ret = setup_kprobe(&my_kprobe);
	if (ret)
		return -1;

	return 0;
}

static void __exit jprobe_exit(void)
{
	unregister_kprobe(&my_kprobe);
	unregister_jprobe(&jprobe_requeue_io);
	unregister_jprobe(&jprobe_ext2_writepage);
}

module_init(jprobe_init)
module_exit(jprobe_exit)
MODULE_LICENSE("GPL");

  reply	other threads:[~2008-01-13  6:44 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 10:51 regression: 100% io-wait with 2.6.24-rcX Joerg Platte
2008-01-07 11:19 ` Ingo Molnar
2008-01-07 13:24   ` Joerg Platte
2008-01-07 13:32     ` Peter Zijlstra
2008-01-07 13:40       ` Joerg Platte
     [not found]         ` <E1JCRbA-0002bh-3c@localhost.localdomain>
2008-01-09  3:27           ` Fengguang Wu
2008-01-09  6:13             ` Joerg Platte
     [not found]               ` <E1JCZg2-0001DE-RP@localhost.localdomain>
2008-01-09 12:04                 ` Fengguang Wu
2008-01-09 12:22                   ` Joerg Platte
     [not found]                     ` <E1JCaUd-0001Ko-Tt@localhost.localdomain>
2008-01-09 12:57                       ` Fengguang Wu
2008-01-09 13:04                         ` Joerg Platte
     [not found]                           ` <E1JCrMj-0001HR-SZ@localhost.localdomain>
2008-01-10  6:58                             ` Fengguang Wu
     [not found]                           ` <E1JCrsE-0000v4-Dz@localhost.localdomain>
2008-01-10  7:30                             ` Fengguang Wu
     [not found]                           ` <20080110073046.GA3432@mail.ustc.edu.cn>
     [not found]                             ` <E1JCsDr-0002cl-0e@localhost.localdomain>
2008-01-10  7:53                               ` Fengguang Wu
2008-01-10  8:37                                 ` Joerg Platte
     [not found]                                   ` <E1JCt0n-00048n-AD@localhost.localdomain>
2008-01-10  8:43                                     ` Fengguang Wu
2008-01-10 10:03                                       ` Joerg Platte
     [not found]                                         ` <E1JDBk4-0000UF-03@localhost.localdomain>
2008-01-11  4:43                                           ` Fengguang Wu
2008-01-11  5:29                                             ` Joerg Platte
2008-01-11  6:41                                               ` Joerg Platte
2008-01-12 23:32                                             ` Joerg Platte
     [not found]                                               ` <E1JDwaA-00017Q-W6@localhost.localdomain>
2008-01-13  6:44                                                 ` Fengguang Wu [this message]
2008-01-13  8:05                                                   ` Joerg Platte
     [not found]                                                     ` <E1JDy5a-0001al-Tk@localhost.localdomain>
2008-01-13  8:21                                                       ` Fengguang Wu
2008-01-13  9:49                                                         ` Joerg Platte
     [not found]                                                           ` <E1JE1Uz-0002w5-6z@localhost.localdomain>
2008-01-13 11:59                                                             ` Fengguang Wu
     [not found]                                                           ` <20080113115933.GA11045@mail.ustc.edu.cn>
     [not found]                                                             ` <E1JEGPH-0001uw-Df@localhost.localdomain>
2008-01-14  3:54                                                               ` Fengguang Wu
     [not found]                                                             ` <20080114035439.GA7330@mail.ustc.edu.cn>
     [not found]                                                               ` <E1JEM2I-00010S-5U@localhost.localdomain>
2008-01-14  9:55                                                                 ` Fengguang Wu
2008-01-14 11:30                                                                   ` Joerg Platte
2008-01-14 11:41                                                                     ` Peter Zijlstra
     [not found]                                                                       ` <E1JEOmD-0001Ap-U7@localhost.localdomain>
2008-01-14 12:50                                                                         ` Fengguang Wu
2008-01-15 21:13                                                                           ` Mike Snitzer
     [not found]                                                                             ` <E1JF0m1-000101-OK@localhost.localdomain>
2008-01-16  5:25                                                                               ` Fengguang Wu
2008-01-15 21:42                                                                         ` Ingo Molnar
     [not found]                                                                           ` <E1JF0bJ-0000zU-FG@localhost.localdomain>
2008-01-16  5:14                                                                             ` Fengguang Wu
  -- strict thread matches above, loose matches on Subject: below --
2008-01-16  9:26 Martin Knoblauch
     [not found] ` <E1JF6w8-0000vs-HM@localhost.localdomain>
2008-01-16 12:00   ` Fengguang Wu
2008-01-16 14:15 Martin Knoblauch
2008-01-16 16:27 ` Mike Snitzer
2008-01-17 13:52 Martin Knoblauch
2008-01-17 16:11 ` Mike Snitzer
2008-01-17 17:44 Martin Knoblauch
2008-01-17 20:23 ` Mel Gorman
2008-01-17 17:51 Martin Knoblauch
2008-01-17 21:50 Martin Knoblauch
2008-01-17 22:12 ` Mel Gorman
2008-01-18  8:19 Martin Knoblauch
2008-01-18 16:01 ` Mel Gorman
2008-01-18 17:46   ` Linus Torvalds
2008-01-18 19:01     ` Martin Knoblauch
2008-01-18 19:23       ` Linus Torvalds
2008-01-22 14:39       ` Alasdair G Kergon
2008-01-18 20:00     ` Mike Snitzer
2008-01-18 22:47       ` Mike Snitzer
2008-01-19 10:24 Martin Knoblauch
2008-01-22 15:25 Martin Knoblauch
2008-01-22 23:40 ` Alasdair G Kergon
2008-01-22 18:51 Martin Knoblauch
2008-01-23 11:12 Martin Knoblauch

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=400206690.16519@ustc.edu.cn \
    --to=wfg@mail.ustc.edu.cn \
    --cc=jplatte@naasa.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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