Re: [RFC PATCH 0/2] O_DIRECT locking rework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2006-10-24 at 16:50 -0400, Chris Mason wrote:
> On Tue, Oct 24, 2006 at 01:28:31PM -0700, Badari Pulavarty wrote:
> > On Tue, 2006-10-24 at 15:34 -0400, Chris Mason wrote:
> > > Hello,
> > > 
> > > Here is a new cut of my O_DIRECT locking rework.  It has a much lower
> > > cpu cost than the last set, and simple benchmarks no longer show a
> > > regression here in system time.  But, the complexity for inserting
> > > placeholder pages has gone up.
> > > 
> > > I've also changed the way I test for a place holder page (from
> > > mm/filemap.c):
> > > 
> > > static struct address_space placeholder_address_space;
> > > #define PagePlaceHolder(page) ((page)->mapping == &placeholder_address_space)
> > > 
> > > This is more stable than the last one but I'm just starting to run race
> > > and load testing on it.
> > > 
> > > -chris
> > 
> > Gave it a spin with simple fsx tests and ran into ..
> 
> Thanks, I missed an i_mutex change.  Let me audit mutexes coming in and
> out again and resend.
> 
> I think the new rules should be:
> 
> reads: don't need i_mutex at all
> writes: don't need i_mutex for io inside i_size.
> 
> Oh, and don't mess with i_mutex under DIO_OWN_LOCKING.

No problem.

I ran into one more nasty looking bug ..

------------[ cut here ]------------
kernel BUG at mm/filemap.c:818!
invalid opcode: 0000 [1] SMP
last sysfs file: /block/sda/sda1/size
CPU 0
Modules linked in: autofs4 hidp rfcomm l2cap bluetooth sunrpc af_packet
xt_state ip_conntrack nfnetlink xt_tcpudp ip6table_filter ip6_tables
x_tables ipv6 freq_table processor binfmt_misc parport_pc lp parport
ide_cd cdrom generic tsdev floppy piix e752x_edac edac_mc ehci_hcd
shpchp uhci_hcd i2c_i801 pci_hotplug i2c_core serio_raw usbcore
dm_snapshot dm_zero dm_mirror dm_mod ide_disk ide_core
Pid: 2669, comm: fsx-linux Not tainted 2.6.19-rc2-mm1-smp #3
RIP: 0010:[<ffffffff802667cf>]  [<ffffffff802667cf>]
remove_placeholder_pages+0x6e/0x129
RSP: 0018:ffff8101090cba28  EFLAGS: 00010093
RAX: 0000000000000002 RBX: 0000000000000004 RCX: 0000000000000006
RDX: 0000000000000040 RSI: 0000000000000002 RDI: 0000000000000040
RBP: ffff8101090cba88 R08: ffff810109163fa0 R09: 0000000000001000
R10: 0000000000000002 R11: ffff810109163d88 R12: 0000000000000000
R13: 000000000000003f R14: 0000000000000000 R15: ffff810120739718
FS:  00002ab9e503b860(0000) GS:ffffffff806b6000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000608000 CR3: 00000001096af000 CR4: 00000000000006e0
Process fsx-linux (pid: 2669, threadinfo ffff8101090ca000, task
ffff8101091d3080)
Stack:  0000000000000002 0000000000000040 0000000000000043
ffff8101186506f8
 ffff810118650750 0000000000000002 0000000200000000 ffff810118650608
 0000000000000000 0000000000000000 0000000000000000 00000000fffffff1
Call Trace:
 [<ffffffff802b4d1f>] dio_complete+0x9f/0xd7
 [<ffffffff802b57ee>] __blockdev_direct_IO+0xa97/0xb37
 [<ffffffff80301813>] ext3_direct_IO+0xf4/0x192
 [<ffffffff8026794a>] generic_file_direct_IO+0xa2/0xeb
 [<ffffffff802679f7>] generic_file_direct_write+0x64/0x104
 [<ffffffff8026838e>] __generic_file_aio_write_nolock+0x2e4/0x417
 [<ffffffff80268525>] generic_file_aio_write+0x64/0xc0
 [<ffffffff802fce06>] ext3_file_write+0x1e/0x9b
 [<ffffffff8028f463>] do_sync_write+0xe2/0x126
 [<ffffffff8028fcc7>] vfs_write+0xcf/0x175
 [<ffffffff802902af>] sys_write+0x47/0x70
 [<ffffffff80209cee>] system_call+0x7e/0x83
DWARF2 unwinder stuck at system_call+0x7e/0x83
Leftover inexact backtrace:


Code: 0f 0b eb fe 49 8b 1e 48 81 7b 18 40 2d c1 80 75 18 48 3b 5d
RIP  [<ffffffff802667cf>] remove_placeholder_pages+0x6e/0x129
 RSP <ffff8101090cba28>
 <3>BUG: sleeping function called from invalid context at
kernel/rwsem.c:20
in_atomic():0, irqs_disabled():1

Call Trace:
 [<ffffffff8020b0d7>] dump_trace+0xaa/0x3ed
 [<ffffffff8020b456>] show_trace+0x3c/0x52
 [<ffffffff8020b481>] dump_stack+0x15/0x17
 [<ffffffff8022a2ad>] __might_sleep+0xb2/0xb4
 [<ffffffff80248d8e>] down_read+0x1d/0x4a
 [<ffffffff8023f867>] blocking_notifier_call_chain+0x1b/0x40
 [<ffffffff80234195>] profile_task_exit+0x15/0x17
 [<ffffffff80235c1a>] do_exit+0x25/0x8a5
 [<ffffffff8020b75c>] kernel_math_error+0x0/0x96
 [<ffffffff804a323c>] do_trap+0xdf/0xee
 [<ffffffff8020bd87>] do_invalid_op+0xac/0xb8
 [<ffffffff804a2b1d>] error_exit+0x0/0x96
DWARF2 unwinder stuck at error_exit+0x0/0x96
Leftover inexact backtrace:
 [<ffffffff802667cf>] remove_placeholder_pages+0x6e/0x129
 [<ffffffff802667b8>] remove_placeholder_pages+0x57/0x129
 [<ffffffff802b4d1f>] dio_complete+0x9f/0xd7
 [<ffffffff802b57ee>] __blockdev_direct_IO+0xa97/0xb37
 [<ffffffff80301813>] ext3_direct_IO+0xf4/0x192
 [<ffffffff802ffc10>] ext3_get_block+0x0/0xec
 [<ffffffff8026794a>] generic_file_direct_IO+0xa2/0xeb
 [<ffffffff802679f7>] generic_file_direct_write+0x64/0x104
 [<ffffffff8026838e>] __generic_file_aio_write_nolock+0x2e4/0x417
 [<ffffffff804a0c6d>] mutex_lock+0x2a/0x2e
 [<ffffffff80268525>] generic_file_aio_write+0x64/0xc0
 [<ffffffff802fce06>] ext3_file_write+0x1e/0x9b
 [<ffffffff8028f463>] do_sync_write+0xe2/0x126
 [<ffffffff80246220>] autoremove_wake_function+0x0/0x38
 [<ffffffff8028fcc7>] vfs_write+0xcf/0x175
 [<ffffffff802902af>] sys_write+0x47/0x70
 [<ffffffff80209cee>] system_call+0x7e/0x83

NMI Watchdog detected LOCKUP on CPU 0
CPU 0
Modules linked in: autofs4 hidp rfcomm l2cap bluetooth sunrpc af_packet
xt_state ip_conntrack nfnetlink xt_tcpudp ip6table_filter ip6_tables
x_tables ipv6 freq_table processor binfmt_misc parport_pc lp parport
ide_cd cdrom generic tsdev floppy piix e752x_edac edac_mc ehci_hcd
shpchp uhci_hcd i2c_i801 pci_hotplug i2c_core serio_raw usbcore
dm_snapshot dm_zero dm_mirror dm_mod ide_disk ide_core
Pid: 106, comm: pdflush Not tainted 2.6.19-rc2-mm1-smp #3
RIP: 0010:[<ffffffff8036d445>]  [<ffffffff8036d445>] __read_lock_failed
+0x5/0x14RSP: 0018:ffff8101210d9b38  EFLAGS: 00000097
RAX: ffff810120c480c0 RBX: ffff810120739730 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff810120739730
RBP: ffff8101210d9b50 R08: 0000000000000002 R09: 0000000000000001
R10: ffffffff80266222 R11: ffff810120c480c0 R12: 0000000000000000
R13: 000000000000000e R14: ffff8101210d9c30 R15: ffff810120739730
FS:  0000000000000000(0000) GS:ffffffff806b6000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00002b8ea4469b20 CR3: 000000011576d000 CR4: 00000000000006e0
Process pdflush (pid: 106, threadinfo ffff8101210d8000, task
ffff810120c480c0)
Stack:  ffffffff8036e17d ffff810120c47988 ffff810120739730
ffff8101210d9b70
 ffffffff804a25f2 ffff8101210d9c30 ffff810120739720 ffff8101210d9bb0
 ffffffff80266222 ffff8101210d9ca8 ffff8101210d9c20 ffff8101210d9e20
Call Trace:
Inexact backtrace:
 [<ffffffff8036e17d>] _raw_read_lock+0x2f/0x33
 [<ffffffff804a25f2>] _read_lock_irq+0x36/0x3b
 [<ffffffff80266222>] find_get_pages_tag+0x31/0xce
 [<ffffffff8026ed64>] pagevec_lookup_tag+0x22/0x2b
 [<ffffffff8026c920>] generic_writepages+0x309/0x36d
 [<ffffffff8030131d>] ext3_ordered_writepage+0x0/0x199
 [<ffffffff8026c9b6>] do_writepages+0x32/0x3a
 [<ffffffff802ab6e1>] __writeback_single_inode+0x1ab/0x37d
 [<ffffffff802abcbf>] generic_sync_sb_inodes+0x1e8/0x2e2
 [<ffffffff802abdd6>] sync_sb_inodes+0x1d/0x1f
 [<ffffffff802ac181>] writeback_inodes+0x8f/0xde
 [<ffffffff8026d2c9>] pdflush+0x0/0x1f5
 [<ffffffff8026cec6>] wb_kupdate+0x9f/0x113
 [<ffffffff8026d413>] pdflush+0x14a/0x1f5
 [<ffffffff8026ce27>] wb_kupdate+0x0/0x113
 [<ffffffff802460ee>] kthread+0xea/0x120
 [<ffffffff8020ab25>] child_rip+0xa/0x15
 [<ffffffff804a2622>] _spin_unlock_irq+0x2b/0x31
 [<ffffffff8020a29c>] restore_args+0x0/0x30
 [<ffffffff80242659>] run_workqueue+0x19/0xf5
 [<ffffffff80246004>] kthread+0x0/0x120
 [<ffffffff8020ab1b>] child_rip+0x0/0x15


Code: 83 3f 01 78 f9 f0 ff 0f 0f 88 ed ff ff ff c3 55 31 c9 48 89


-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux