Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753965Ab1CUQnt (ORCPT ); Mon, 21 Mar 2011 12:43:49 -0400 Received: from mx5.twosigma.com ([208.77.212.35]:63266 "EHLO mx5.twosigma.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753949Ab1CUQnp (ORCPT ); Mon, 21 Mar 2011 12:43:45 -0400 X-Greylist: delayed 1427 seconds by postgrey-1.27 at vger.kernel.org; Mon, 21 Mar 2011 12:43:45 EDT From: Sean Noonan To: "'linux-kernel@vger.kernel.org'" CC: Trammell Hudson , Martin Bligh , Stephen Degler , Christos Zoulas Date: Mon, 21 Mar 2011 12:19:44 -0400 Subject: XFS memory allocation deadlock in 2.6.38 Thread-Topic: XFS memory allocation deadlock in 2.6.38 Thread-Index: Acvn48onhwj/45wTTJCiJ9OQbQPjgA== Message-ID: <081DDE43F61F3D43929A181B477DCA95639B52FD@MSXAOA6.twosigma.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_002_081DDE43F61F3D43929A181B477DCA95639B52FDMSXAOA6twosigma_" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5923 Lines: 118 --_002_081DDE43F61F3D43929A181B477DCA95639B52FDMSXAOA6twosigma_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This message was originally posted to the XFS mailing list, but received no= responses. Thus, I am sending it to LKML on the advice of Martin. Using the attached program, we are able to reproduce this bug reliably. $ make vmtest $ ./vmtest /xfs/hugefile.dat $(( 16 * 1024 * 1024 * 1024 )) # vmtest /xfs/hugefile.dat: mapped 17179869184 bytes in 33822066943 ticks 749660: avg 13339 max 234667 ticks 371945: avg 26885 max 281616 ticks --- At this point, we see the following on the console: [593492.694806] XFS: possible memory allocation deadlock in kmem_alloc (mod= e:0x250) [593506.724367] XFS: possible memory allocation deadlock in kmem_alloc (mod= e:0x250) [593524.837717] XFS: possible memory allocation deadlock in kmem_alloc (mod= e:0x250) [593556.742386] XFS: possible memory allocation deadlock in kmem_alloc (mod= e:0x250) This is the same message presented in http://oss.sgi.com/bugzilla/show_bug.cgi?id=3D410 We started testing with 2.6.38-rc7 and have seen this bug through to the .0= release. This does not appear to be present in 2.6.33, but we have not do= ne testing in between. We have tested with ext4 and do not encounter this = bug. CONFIG_XFS_FS=3Dy CONFIG_XFS_QUOTA=3Dy CONFIG_XFS_POSIX_ACL=3Dy CONFIG_XFS_RT=3Dy # CONFIG_XFS_DEBUG is not set # CONFIG_VXFS_FS is not set Here is the stack from the process: [] call_rwsem_down_write_failed+0x13/0x20 [] xfs_ilock+0x7e/0x110 [] __xfs_get_blocks+0x8f/0x4e0 [] xfs_get_blocks+0x11/0x20 [] __block_write_begin+0x1ee/0x5b0 [] block_page_mkwrite+0x9d/0xf0 [] xfs_vm_page_mkwrite+0x15/0x20 [] do_wp_page+0x54b/0x820 [] handle_pte_fault+0x3cc/0x820 [] handle_mm_fault+0x175/0x2f0 [] do_page_fault+0x159/0x470 [] page_fault+0x1f/0x30 [] 0xffffffffffffffff # uname -a Linux testhost 2.6.38 #2 SMP PREEMPT Fri Mar 18 15:00:59 GMT 2011 x86_64 GN= U/Linux Please let me know if additional information is required. Thanks! Sean --_002_081DDE43F61F3D43929A181B477DCA95639B52FDMSXAOA6twosigma_ Content-Type: text/plain; name="vmtest.c" Content-Description: vmtest.c Content-Disposition: attachment; filename="vmtest.c"; size=2185; creation-date="Mon, 21 Mar 2011 12:18:51 GMT"; modification-date="Mon, 21 Mar 2011 12:18:51 GMT" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0ZGludC5o PgojaW5jbHVkZSA8c3lzL21tYW4uaD4KI2luY2x1ZGUgPHN5cy90eXBlcy5oPgoja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KGkgPSAwIDsgaSA8IGl0ZXJzIDsgaSsrKQoJewoJICAgIHVpbnQ2NF90IGkgPSBscmFu ZDQ4KCkgJSBtYXhfaW5kZXg7CgkgICAgYnVmW2ldICs9IHN0YXJ0OwoKCSAgICB1aW50NjRfdCBl bmQgPSByZHRzYygpOwoJICAgIGNvbnN0IHVpbnQ2NF90IGRlbHRhID0gZW5kIC0gc3RhcnQ7Cgkg ICAgc3RhcnQgPSBlbmQ7CgoJICAgIHN1bSArPSBkZWx0YTsKCSAgICBpZiAoZGVsdGEgPiBtYXgp CgkJbWF4ID0gZGVsdGE7CgoJICAgIC8vIEZvcmNlIGEgcmVwb3J0IGV2ZXJ5IDEwIGJpbGxpb24g dGlja3Mgfj0gMyBzZWNvbmRzCgkgICAgaWYgKGVuZCAtIGxvb3Bfc3RhcnQgPiAxMGU5KQoJCWJy ZWFrOwoJfQoKCXByaW50ZigiJSJQUkl1NjQiOiBhdmcgJSJQUkl1NjQiIG1heCAlIlBSSXU2NCIg dGlja3NcbiIsCgkgICAgaSwKCSAgICBpID8gc3VtIC8gaSA6IDAsCgkgICAgbWF4CgkpOwogICAg fQoKICAgIHJldHVybiAwOwp9Cg== --_002_081DDE43F61F3D43929A181B477DCA95639B52FDMSXAOA6twosigma_-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/