Repository navigation
Closed
Description
Running Transmission on a 512MB Pi, and with just two concurrent downloads, it's commonplace to see swapper page allocation failures:
Nov 7 00:15:59 raspberrypi kernel: [264587.158502] warn_alloc_failed: 5676 callbacks suppressed
Nov 7 00:15:59 raspberrypi kernel: [264587.158522] swapper: page allocation failure: order:3, mode:0x20
Nov 7 00:15:59 raspberrypi kernel: [264587.158568] [<c0013e1c>] (unwind_backtrace+0x0/0xf0) from [<c008e01c>] (warn_alloc_failed+0xc4/0x11c)
Nov 7 00:15:59 raspberrypi kernel: [264587.158596] [<c008e01c>] (warn_alloc_failed+0xc4/0x11c) from [<c00901f8>] (__alloc_pages_nodemask+0x410/0x630)
Nov 7 00:15:59 raspberrypi kernel: [264587.158630] [<c00901f8>] (__alloc_pages_nodemask+0x410/0x630) from [<c0378804>] (cache_alloc_refill+0x2b4/0x560)
Nov 7 00:15:59 raspberrypi kernel: [264587.158654] [<c0378804>] (cache_alloc_refill+0x2b4/0x560) from [<c00b5994>] (__kmalloc+0xcc/0xdc)
Nov 7 00:15:59 raspberrypi kernel: [264587.158674] [<c00b5994>] (__kmalloc+0xcc/0xdc) from [<c02ca770>] (__alloc_skb+0x48/0xe8)
Nov 7 00:15:59 raspberrypi kernel: [264587.158698] [<c02ca770>] (__alloc_skb+0x48/0xe8) from [<c0251c8c>] (rx_submit+0x24/0x1fc)
Nov 7 00:15:59 raspberrypi kernel: [264587.158725] [<c0251c8c>] (rx_submit+0x24/0x1fc) from [<c0259938>] (usb_hcd_giveback_urb+0x60/0xf4)
Nov 7 00:15:59 raspberrypi kernel: [264587.158752] [<c0259938>] (usb_hcd_giveback_urb+0x60/0xf4) from [<c027f194>] (_complete+0xb8/0x1dc)
Nov 7 00:15:59 raspberrypi kernel: [264587.158775] [<c027f194>] (_complete+0xb8/0x1dc) from [<c0281130>] (handle_hc_xfercomp_intr+0x2fc/0x41c)
Nov 7 00:15:59 raspberrypi kernel: [264587.158797] [<c0281130>] (handle_hc_xfercomp_intr+0x2fc/0x41c) from [<c0281b10>] (dwc_otg_hcd_handle_hc_n_intr+0x3a4/0x5c0)
Nov 7 00:15:59 raspberrypi kernel: [264587.158820] [<c0281b10>] (dwc_otg_hcd_handle_hc_n_intr+0x3a4/0x5c0) from [<c0281d98>] (dwc_otg_hcd_handle_hc_intr+0x6c/0x80)
Nov 7 00:15:59 raspberrypi kernel: [264587.158842] [<c0281d98>] (dwc_otg_hcd_handle_hc_intr+0x6c/0x80) from [<c0281f48>] (dwc_otg_hcd_handle_intr+0x19c/0x1e0)
Nov 7 00:15:59 raspberrypi kernel: [264587.158863] [<c0281f48>] (dwc_otg_hcd_handle_intr+0x19c/0x1e0) from [<c027f8e8>] (dwc_otg_hcd_irq+0xc/0x18)
Nov 7 00:15:59 raspberrypi kernel: [264587.158884] [<c027f8e8>] (dwc_otg_hcd_irq+0xc/0x18) from [<c0258f38>] (usb_hcd_irq+0x30/0x90)
Nov 7 00:15:59 raspberrypi kernel: [264587.158909] [<c0258f38>] (usb_hcd_irq+0x30/0x90) from [<c0074c90>] (handle_irq_event_percpu+0x50/0x194)
Nov 7 00:15:59 raspberrypi kernel: [264587.158930] [<c0074c90>] (handle_irq_event_percpu+0x50/0x194) from [<c0074e28>] (handle_irq_event+0x54/0x84)
Nov 7 00:15:59 raspberrypi kernel: [264587.158952] [<c0074e28>] (handle_irq_event+0x54/0x84) from [<c007704c>] (handle_level_irq+0x98/0xf8)
Nov 7 00:15:59 raspberrypi kernel: [264587.158974] [<c007704c>] (handle_level_irq+0x98/0xf8) from [<c0074588>] (generic_handle_irq+0x28/0x40)
Nov 7 00:15:59 raspberrypi kernel: [264587.159002] [<c0074588>] (generic_handle_irq+0x28/0x40) from [<c000e87c>] (handle_IRQ+0x30/0x84)
Nov 7 00:15:59 raspberrypi kernel: [264587.159027] [<c000e87c>] (handle_IRQ+0x30/0x84) from [<c037c974>] (__irq_svc+0x34/0xc8)
Nov 7 00:15:59 raspberrypi kernel: [264587.159048] [<c037c974>] (__irq_svc+0x34/0xc8) from [<c000e990>] (default_idle+0x24/0x28)
Nov 7 00:15:59 raspberrypi kernel: [264587.159069] [<c000e990>] (default_idle+0x24/0x28) from [<c000eb78>] (cpu_idle+0x9c/0xc4)
Nov 7 00:15:59 raspberrypi kernel: [264587.159097] [<c000eb78>] (cpu_idle+0x9c/0xc4) from [<c04c1718>] (start_kernel+0x280/0x2c8)
Nov 7 00:15:59 raspberrypi kernel: [264587.159108] Mem-info:
Nov 7 00:15:59 raspberrypi kernel: [264587.159114] Normal per-cpu:
Nov 7 00:15:59 raspberrypi kernel: [264587.159123] CPU 0: hi: 186, btch: 31 usd: 186
Nov 7 00:15:59 raspberrypi kernel: [264587.159141] active_anon:10144 inactive_anon:23787 isolated_anon:0
Nov 7 00:15:59 raspberrypi kernel: [264587.159147] active_file:25069 inactive_file:25089 isolated_file:0
Nov 7 00:15:59 raspberrypi kernel: [264587.159152] unevictable:0 dirty:5801 writeback:3822 unstable:0
Nov 7 00:15:59 raspberrypi kernel: [264587.159158] free:10736 slab_reclaimable:1540 slab_unreclaimable:27013
Nov 7 00:15:59 raspberrypi kernel: [264587.159163] mapped:1524 shmem:1 pagetables:279 bounce:0
Nov 7 00:15:59 raspberrypi kernel: [264587.159194] Normal free:42944kB min:16384kB low:20480kB high:24576kB active_anon:40576kB inactive_anon:95148kB active_file:100276kB inactive_file:100356kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:503936kB mlocked:0kB dirty:23204kB writeback:15288kB mapped:6096kB shmem:4kB slab_reclaimable:6160kB slab_unreclaimable:108052kB kernel_stack:680kB pagetables:1116kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Nov 7 00:15:59 raspberrypi kernel: [264587.159226] lowmem_reserve[]: 0 0
Nov 7 00:15:59 raspberrypi kernel: [264587.159234] Normal: 1662*4kB 1845*8kB 1296*16kB 1*32kB 0*64kB 0*128kB 1*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 42944kB
Nov 7 00:15:59 raspberrypi kernel: [264587.159266] 62215 total pagecache pages
Nov 7 00:15:59 raspberrypi kernel: [264587.159273] 12056 pages in swap cache
Nov 7 00:15:59 raspberrypi kernel: [264587.159281] Swap cache stats: add 41064, delete 29008, find 29816/31783
Nov 7 00:15:59 raspberrypi kernel: [264587.159289] Free swap = 38996kB
Nov 7 00:15:59 raspberrypi kernel: [264587.159295] Total swap = 102396kB
Nov 7 00:15:59 raspberrypi kernel: [264587.175484] 126976 pages of RAM
Nov 7 00:15:59 raspberrypi kernel: [264587.175491] 11100 free pages
Nov 7 00:15:59 raspberrypi kernel: 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 00:15:59 raspberrypi kernel: [264591.095934] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 00:15:59 raspberrypi kernel: [264591.095948] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 00:15:59 raspberrypi kernel: [264591.095962] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 00:15:59 raspberrypi kernel: [264591.095977] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 00:15:59 raspberrypi kernel: [264591.095992] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 00:15:59 raspberrypi kernel: [264591.096007] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
also:
Nov 7 01:06:18 raspberrypi kernel: [267609.763694] kswapd0: page allocation failure: order:3, mode:0x20
Nov 7 01:06:18 raspberrypi kernel: [267609.763749] [<c0013e1c>] (unwind_backtrace+0x0/0xf0) from [<c008e01c>] (warn_alloc_failed+0xc4/0x11c)
Nov 7 01:06:18 raspberrypi kernel: [267609.763776] [<c008e01c>] (warn_alloc_failed+0xc4/0x11c) from [<c00901f8>] (__alloc_pages_nodemask+0x410/0x630)
Nov 7 01:06:18 raspberrypi kernel: [267609.763811] [<c00901f8>] (__alloc_pages_nodemask+0x410/0x630) from [<c0378804>] (cache_alloc_refill+0x2b4/0x560)
Nov 7 01:06:18 raspberrypi kernel: [267609.763834] [<c0378804>] (cache_alloc_refill+0x2b4/0x560) from [<c00b5994>] (__kmalloc+0xcc/0xdc)
Nov 7 01:06:18 raspberrypi kernel: [267609.763855] [<c00b5994>] (__kmalloc+0xcc/0xdc) from [<c02ca770>] (__alloc_skb+0x48/0xe8)
Nov 7 01:06:18 raspberrypi kernel: [267609.763879] [<c02ca770>] (__alloc_skb+0x48/0xe8) from [<c0251c8c>] (rx_submit+0x24/0x1fc)
Nov 7 01:06:18 raspberrypi kernel: [267609.763906] [<c0251c8c>] (rx_submit+0x24/0x1fc) from [<c0259938>] (usb_hcd_giveback_urb+0x60/0xf4)
Nov 7 01:06:18 raspberrypi kernel: [267609.763933] [<c0259938>] (usb_hcd_giveback_urb+0x60/0xf4) from [<c027f194>] (_complete+0xb8/0x1dc)
Nov 7 01:06:18 raspberrypi kernel: [267609.763956] [<c027f194>] (_complete+0xb8/0x1dc) from [<c0281130>] (handle_hc_xfercomp_intr+0x2fc/0x41c)
Nov 7 01:06:18 raspberrypi kernel: [267609.763978] [<c0281130>] (handle_hc_xfercomp_intr+0x2fc/0x41c) from [<c0281b10>] (dwc_otg_hcd_handle_hc_n_intr+0x3a4/0x5c0)
Nov 7 01:06:18 raspberrypi kernel: [267609.764001] [<c0281b10>] (dwc_otg_hcd_handle_hc_n_intr+0x3a4/0x5c0) from [<c0281d98>] (dwc_otg_hcd_handle_hc_intr+0x6c/0x80)
Nov 7 01:06:18 raspberrypi kernel: [267609.764023] [<c0281d98>] (dwc_otg_hcd_handle_hc_intr+0x6c/0x80) from [<c0281f48>] (dwc_otg_hcd_handle_intr+0x19c/0x1e0)
Nov 7 01:06:18 raspberrypi kernel: [267609.764044] [<c0281f48>] (dwc_otg_hcd_handle_intr+0x19c/0x1e0) from [<c027f8e8>] (dwc_otg_hcd_irq+0xc/0x18)
Nov 7 01:06:18 raspberrypi kernel: [267609.764066] [<c027f8e8>] (dwc_otg_hcd_irq+0xc/0x18) from [<c0258f38>] (usb_hcd_irq+0x30/0x90)
Nov 7 01:06:18 raspberrypi kernel: [267609.764090] [<c0258f38>] (usb_hcd_irq+0x30/0x90) from [<c0074c90>] (handle_irq_event_percpu+0x50/0x194)
Nov 7 01:06:18 raspberrypi kernel: [267609.764112] [<c0074c90>] (handle_irq_event_percpu+0x50/0x194) from [<c0074e28>] (handle_irq_event+0x54/0x84)
Nov 7 01:06:18 raspberrypi kernel: [267609.764134] [<c0074e28>] (handle_irq_event+0x54/0x84) from [<c007704c>] (handle_level_irq+0x98/0xf8)
Nov 7 01:06:18 raspberrypi kernel: [267609.764156] [<c007704c>] (handle_level_irq+0x98/0xf8) from [<c0074588>] (generic_handle_irq+0x28/0x40)
Nov 7 01:06:18 raspberrypi kernel: [267609.764183] [<c0074588>] (generic_handle_irq+0x28/0x40) from [<c000e87c>] (handle_IRQ+0x30/0x84)
Nov 7 01:06:18 raspberrypi kernel: [267609.764208] [<c000e87c>] (handle_IRQ+0x30/0x84) from [<c037c974>] (__irq_svc+0x34/0xc8)
Nov 7 01:06:18 raspberrypi kernel: [267609.764229] [<c037c974>] (__irq_svc+0x34/0xc8) from [<c0095b8c>] (__remove_mapping+0xe4/0x188)
Nov 7 01:06:18 raspberrypi kernel: [267609.764250] [<c0095b8c>] (__remove_mapping+0xe4/0x188) from [<c0097314>] (shrink_page_list+0x2ec/0x998)
Nov 7 01:06:18 raspberrypi kernel: 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 01:06:18 raspberrypi kernel: [267610.093783] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Nov 7 01:06:18 raspberrypi kernel: [267610.093798] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
I've tried various settings for vm.min_free_kbytes, but I still see these swapper allocation failures even with 16384 and 32768.
When these errors occur, I typically have over 350MB free memory, according to free:
total used free shared buffers cached
Mem: 497764 308904 188860 0 392 178568
-/+ buffers/cache: 129944 367820
Swap: 102396 76996 25400
Once the page allocation error occurs, syslog and kern.log are spammed with 10's of thousands of kevent 2 messages being logged in a short space of time (almost 180K messages in 20 minutes, once to syslog and again to kern.log - see issue #154) - these message need to be rate limited.
Metadata
Metadata
Assignees
Labels
No labels
Activity
MilhouseVH commentedon Nov 7, 2012
These Pandaboard/Beagleboard bug reports may be relevant:
Strange out of memory on pandaboard
Page allocation failure on Pandaboard and Beagle XM
The culprit seems to be the usbnet driver, specifically turbo mode.
Unfortunately the proposed solutions are to cut USB/eth performance by disabling turbo mode, or bump up the minimum free memory (I've already tried 32MB, no luck).
Does the network-over-USB really need this much memory to function properly?
MilhouseVH commentedon Nov 7, 2012
I now see this has already been discussed previously, issue #9
Is the patch from Ming Lei applicable to the Pi?
popcornmix commentedon Nov 7, 2012
The Ming Lei patch looks plausible. Have you tried it?
I just tried applying it, and it applies and builds. Can you test it?
https://dl.dropbox.com/u/3669512/temp/kernel.img
asb commentedon Nov 7, 2012
Last time I tried the Ming Lei patch it didn't solve the issue for me, but that was a very long time ago and it's very possible there were other factors involved. I'm also very interested in whether Dom's updated kernel.img is better for you.
MilhouseVH commentedon Nov 7, 2012
Just downloaded it, will give it a go and report back. Many thanks.
MilhouseVH commentedon Nov 7, 2012
Argh... I haven't even got around to testing the torrent download yet and I've already got a mass of "kevent 2" messages being spammed to syslog/kern.log - it's not looking good.
Between 18:21:17 and 18:25:20 this patched kernel spammed 606,002
kevent 2messages to both syslog and kern.log (see separate issue 154 about that!)I need to stop this test before it kills my SD card... sorry, reverting to release kernel.img.
popcornmix commentedon Nov 7, 2012
Can you try:
smsc95xx.turbo_mode=N
I'm not concinved there is any difference in performance, and it will probably fix this problem. See:
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=14394&p=192727#p182663
MilhouseVH commentedon Nov 7, 2012
Do you want me to try that with the patched kernel, or stock kernel?
popcornmix commentedon Nov 7, 2012
The stock kernel. The patched kernel doesn't work...
MilhouseVH commentedon Nov 7, 2012
I'd say iperf is a bit slower:
smsc95xx.turbo_mode=Y
smsc95xx.turbo_mode=N
Testing Transmission will take a little while... fingers crossed...
MilhouseVH commentedon Nov 7, 2012
So far so good with smsc95xx.turbo_mode=N.
I have 5 (FIVE!) concurrent torrents maxing out my 20Mbit/s connection, and after 15 minutes I have no allocation failures (or kevent 2 spam). Will allow the torrents to complete, check there are no errors and post an update.
However, I was under the impression that disabling turbo_mode was bad for performance, but apparently not (or at least, not significantly). Maybe disabling it should be the default until such time as turbo_mode can be made reliable?
popcornmix commentedon Nov 7, 2012
Yes, I asked the question if turbo_mode=N caused a problem for anyone in the linked thread, and there didn't seem to be any problems. It seems to have a fairly minor performance hit (I thought my iperf drop was less than MillhouseVH's.)
I think it's worth considering as a default.
MilhouseVH commentedon Nov 7, 2012
I'm afraid I missed that thread, but I'll post to it once I've completed this test.
asb commentedon Nov 7, 2012
Yes, I had been under the impression that issues with turbo_mode no longer came up in normal usage. However, if issues like this are trivially reproducible with a torrent client it probably makes a lot of sense to disable turbo_mode by default. If anyone has use cases where they suffer a significant degradation with turbo_mode disabled do let us know.
popcornmix commentedon Nov 7, 2012
@MillHouseVH
I'd be interested if you spot any problem with XBMC and 1080p files with turbo_mode=N.
Although xbmc distributions can always choose a different default to raspbian.
41 remaining items
ghalfacree commentedon Apr 9, 2013
@Ferroin: Ext4 does not support the features I require - the discussion of which is outside the scope of this issue. Btrfs may be unstable - although I think its developers would prefer you use the term "experimental" - but the fact is it's not btrfs that's failing here: it's the Raspbian kernel. I have used btrfs 0.19 on similar hardware in the past with no issues whatsoever.
P33M commentedon Apr 10, 2013
@gordonhollingworth
#153 (comment)
The source of the allocation failure (top of the call stack) is still constant after the tasklet patch. The reason you're seeing the tasklet appear is because it is now the calling function for usb_hcd_giveback_urb rather than the interrupt handler directly. The tasklet is interrupt-safe in data transfer between the IRQ and tasklet - I have seen instances where it gets pre-empted as much as 10 times in a single run during boot.
I did try to find the source of page allocation errors in the process of finding the cause of #189 but the frustratingly infrequent occurrences and disappearance when I turned on SLUB object owner tracking made me give up. If btrfs gives a more repeatable result then I could probably start digging again.
On the latest kernel during a bit of stress testing I did try a maxed out torrent at the speed of my line. 2MB/s to USB HDD, no issues during the 30minute transfer.
ghalfacree commentedon Apr 12, 2013
Since turning swap off entirely, I have not had any page allocation failures - unsurprisingly.
@P33M: It certainly seems that running a pair of external harddrives set up in a RAID1 array through btrfs and shoving a bunch of data at them is enough to reliably trigger the bug within a single day. To match my setup, mount the btrfs drives with LZO compression and free space caching enabled, and transfer the data via SSH.
You'll certainly need to spend more than half an hour running the test, though: the earliest I've been able to get it to trigger is after seven hours.
szarpaj commentedon Apr 14, 2013
Similar errors with 3.2.x series kernel are intereseting? (yeah, I know, I should upgrade, but my pi has 54 days uptime and I just don't want to brake it :P )
ghalfacree commentedon Apr 29, 2013
Any progress on this? The errors occur even when swap is deactivated, as per the below log:
cpufreq: remove sysfs files for CPUs which failed to come back after …
P33M commentedon May 5, 2014
Memory fragmentation is the root cause of this issue. CONFIG_COMPACTION and CONFIG_SLUB make this orders of magnitude less likely to happen.
drm/i915: don't read pp_ctrl_reg if we're suspended
mfd: 88pm860x-core: Repair formatting issues
Flux3PO commentedon Feb 23, 2015
I'm new to Linux/Raspbian.
I just got a Raspberry Pi 2 (1GB Ram) and installed Raspbian + Transmission and had a crash after a few H seeding, sometimes even after a few minutes Leeching.
smsc95xx.turbo_mode=N, vm.min_free_kbytes=2048 seems to be a good modification. Running it for 12h without an issue so far.
Any reason why this is not of the standard build ?
ARM: 8393/1: smp: Fix suspicious RCU usage with ipi tracepoints
ARM: 8393/1: smp: Fix suspicious RCU usage with ipi tracepoints
netfilter: nfnetlink: fix splat due to incorrect socket memory accoun…
staging: vme_user: Fix checkpatch warnings in vme_tsi148.c