Red Hat Bugzilla – 1278992 – ceph-osd aborts during 'XFS: possible memory allocation deadlock in kmem_alloc (mode:0x8250)' when directory block size of 64k used
Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
ceph-osd daemons begin to suicide during XFS memory allocation deadlocks. The following messages are printed to /var/log/messages:
XFS: possible memory allocation deadlock in kmem_alloc (mode:0x8250)
This appears to occur when a directory block size of 64k used:
-n size=65536
Version-Release number of selected component (if applicable):
3.10.0-123.20.1.el7.x86_64
How reproducible:
Not sure how the issue can be reproduced, however the issue appears to occur when Ceph OSD's are under heavy load in a Ceph (Firefly) cluster.
Actual results:
XFS deadlocks and ceph-osd's suicide.
Expected results:
No XFS deadlock or ceph-osd suicide's.
Just as a quick first step experiment, I formatted an '-n size=64k' fs and ran a quick file creation/deletion loop with a debug printk() in xlog_cil_insert_format_items() to dump the size of any >PAGE_SIZE allocation requests. I very quickly see allocs up to around 64k, some even larger:
...
xlog_cil_insert_format_items(243): buf_size 64984 (nbytes 64880 niovecs 3)
xlog_cil_insert_format_items(243): buf_size 65112 (nbytes 65008 niovecs 3)
xlog_cil_insert_format_items(243): buf_size 65368 (nbytes 65264 niovecs 3)
xlog_cil_insert_format_items(243): buf_size 65496 (nbytes 65392 niovecs 3)
xlog_cil_insert_format_items(243): buf_size 65728 (nbytes 65640 niovecs 2)
...
From that perspective, it doesn't seem that surprising to see allocation failures from kmem_zalloc() calls here if we assume memory fragmentation is an eventuality. Further, we're in KM_NOFS context which I assume precludes things like writeback, etc., but even if we weren't, those are still order 4 or larger sized requests.
My first question is, without having yet dug into the core context for these allocation sizes, is there any reason for not using something like kmem_zalloc_large() here (assuming we preserve the KM_SLEEP behavior)?
Why are is the filesystem configured to use 64k directory block sizes? Are they putting millions of files in a single directory? If not, then just use the default directory block size and the problem goes away....
-Dave.
This is a known issue w/ 64k dirs, and there is no current solution, though workarounds exist (i.e. don't mkfs w/ that option).
For now moving to 7.4, though AFAIK there has been no upstream activity on this either, so 7.4 is not necessarily likely, either.
Hello HPE,
From comment 14. Should this bug be moved to a medium or low bug?
As it appears this issue will not be fixed. Would HPE like a kbase stating this option do not work?
Thank You
Joe Kachuck
Comment 16Dave Wysochanski
2018-03-29 18:40:57 UTC
As far as I know there's no plans to address this and there's no recent activity in the bug. Feel free to reopen if you have new information.