From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755249AbZETHvp (ORCPT ); Wed, 20 May 2009 03:51:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753285AbZETHvf (ORCPT ); Wed, 20 May 2009 03:51:35 -0400 Received: from mga06.intel.com ([134.134.136.21]:6886 "EHLO orsmga101.jf.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752861AbZETHve (ORCPT ); Wed, 20 May 2009 03:51:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.41,220,1241420400"; d="scan'208";a="517219854" Subject: Re: [PATCH 0/11] Per-bdi writeback flusher threads #4 From: "Zhang, Yanmin" To: Jens Axboe Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, chris.mason@oracle.com, david@fromorbit.com, hch@infradead.org, akpm@linux-foundation.org, jack@suse.cz In-Reply-To: <20090519062049.GP4140@kernel.dk> References: <1242649192-16263-1-git-send-email-jens.axboe@oracle.com> <1242713463.2560.5.camel@ymzhang> <20090519062049.GP4140@kernel.dk> Content-Type: text/plain; charset=UTF-8 Date: Wed, 20 May 2009 15:51:51 +0800 Message-Id: <1242805911.2560.28.camel@ymzhang> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2009-05-19 at 08:20 +0200, Jens Axboe wrote: > On Tue, May 19 2009, Zhang, Yanmin wrote: > > On Mon, 2009-05-18 at 14:19 +0200, Jens Axboe wrote: > > > Hi, > > > > > > This is the fourth version of this patchset. Chances since v3: > > > > > > - Dropped a prep patch, it has been included in mainline since. > > > > > > - Add a work-to-do list to the bdi. This is struct bdi_work. Each > > > wb thread will notice and execute work on bdi->work_list. The arguments > > > are which sb (or NULL for all) to flush and how many pages to flush. > > > > > > - Fix a bug where not all bdi's would end up on the bdi_list, so potentially > > > some data would not be flushed. > > > > > > - Make wb_kupdated() pass on wbc->older_than_this so we maintain the same > > > behaviour for kupdated flushes. > > > > > > - Have the wb thread flush first before sleeping, to avoid losing the > > > first flush on lazy register. > > > > > > - Rebase to newer kernels. > I'm attaching two patches - apply #1 to -rc6, and then #2 is a roll-up > of the patch series that you can apply next. Jens, I run into 2 issues with kernel 2.6.30-rc6+BDI_Flusher_V4. Below is one. Tue May 19 00:00:00 CST 2009 BUG: unable to handle kernel NULL pointer dereference at 00000000000001d8 IP: [] generic_make_request+0x10a/0x384 PGD 0 Oops: 0000 [#1] SMP last sysfs file: /sys/block/sdb/stat CPU 0 Modules linked in: igb Pid: 1445, comm: bdi-8:16 Not tainted 2.6.30-rc6-bdiflusherv4 #1 X8DTN RIP: 0010:[] [] generic_make_request+0x10a/0x384 RSP: 0018:ffff8800bd04da60 EFLAGS: 00010206 RAX: 0000000000000000 RBX: ffff8801be45d500 RCX: 00000000038a0df8 RDX: 0000000000000008 RSI: 0000000000000576 RDI: ffff8801bf408680 RBP: ffff8801be45d500 R08: ffffe20001ee8140 R09: ffff8800bd04da98 R10: 0000000000000000 R11: ffff8800bd72eb40 R12: ffff8801be45d500 R13: ffff88005f51f310 R14: 0000000000000008 R15: ffff8800b15a5458 FS: 0000000000000000(0000) GS:ffffc20000000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b CR2: 00000000000001d8 CR3: 0000000000201000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process bdi-8:16 (pid: 1445, threadinfo ffff8800bd04c000, task ffff8800bd1b75f0) Stack: 0000000000000008 ffffffff8027a613 00000000848dc000 ffffffffffffffff ffff8800a8190f50 ffffffff00000012 ffff8800a81938e0 ffffc2000000001b 0000000000000000 0000000000000000 ffffe200026f9c30 0000000000000000 Call Trace: [] ? mempool_alloc+0x59/0x10f [] ? submit_bio+0xaa/0xb1 [] ? submit_bh+0xe3/0x103 [] ? __block_write_full_page+0x1fb/0x2f2 [] ? end_buffer_async_write+0x0/0xfb [] ? __writepage+0xa/0x25 [] ? write_cache_pages+0x21c/0x338 [] ? __writepage+0x0/0x25 [] ? do_writepages+0x27/0x2d [] ? __writeback_single_inode+0x159/0x2b3 [] ? thread_return+0x3e/0xaa [] ? determine_dirtyable_memory+0xd/0x1d [] ? get_dirty_limits+0x1d/0x255 [] ? generic_sync_wb_inodes+0x1b4/0x220 [] ? wb_do_writeback+0x16c/0x215 [] ? bdi_writeback_task+0x65/0x10d [] ? autoremove_wake_function+0x0/0x2e [] ? bit_waitqueue+0x10/0xa0 [] ? bdi_start_fn+0x0/0xba [] ? bdi_start_fn+0x6f/0xba [] ? kthread+0x54/0x80 [] ? child_rip+0xa/0x20 [] ? kthread+0x0/0x80 [] ? child_rip+0x0/0x20 The panic happened at the beginging of a mmap randrw after a mmap randwrite. It's triggered in __generic_make_request => bdev_get_queue(bio->bi_bdev), because bio->bi_bdev->bd_disk is equal to NULL. The callchain is: bdi_writeback_task => wb_do_writeback => generic_sync_wb_inodes => __writeback_single_inode => ... __block_write_full_page => submit_bh => submit_bio=> generic_make_request yanmin