Been a long time since I looked at the relevant bits of the kernel source, but errors when _writing_ to swap devices should be quite manageble, I would have thought - simply mark the block/page as bad and go looking for another free location. It'll be _read_ errors that cause problems!
Some info here, though no discussion of error handling that I noticed. https://www.kernel.org/doc/gorman/html/understand/understand014.html I've had no crashes since installing the fix that went into -proposed and then was released. Still getting the I/O errors though. On Wed, Oct 02, 2013 at 02:37:33AM -0000, Mel Dee wrote: > IMO, this bug *is* a duplicate of #1215513. The real problem is that the > zram kernel module creates a block device with a bad sector at the end. > When you try to swap on it, anything can happen, from system lockdowns > to program crashes to nothing (e.g., if you have so much RAM you never > get to use the last sector of /dev/zram0). [..] -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1217189 Title: Buffer I/O error on device zram0 Status in “linux” package in Ubuntu: Confirmed Status in “linux-lts-raring” package in Ubuntu: Confirmed Bug description: This is on linux-image-generic-lts-raring (which I recently upgraded to 3.8.0-29; the problem didn't occur before upgrading AFAIR) I see this junk in my dmesg when creating / formatting a zram swap, and then periodically. Then at some point after heavy swapping incidents, the machine locks up. "Correlation does not imply causation, but it does waggle its eyebrows suggestively" and all that. --- zram: module is from the staging directory, the quality is unknown, you have been warned. zram: num_devices not specified. Using default: 1 zram: Creating 1 devices Adding 1031648k swap on /dev/zram0. Priority:100 extents:1 across:1031648k SS ... Buffer I/O error on device zram0, logical block 257912 [repeated 10 times] ... BUG: scheduling while atomic: rsyslogd/1439/0x00000001 Pid: 1439, comm: rsyslogd Tainted: PF WC O 3.8.0-29-generic #42~precise1-Ubuntu [20931.796635] Pid: 1439, comm: rsyslogd Tainted: PF WC O 3.8.0-29-generic #42~precise1-Ubuntu [20931.796638] Call Trace: [20931.796649] [<c1619449>] __schedule_bug+0x52/0x5e [20931.796653] [<c162c265>] __schedule+0x575/0x5f0 [20931.796660] [<f8439e06>] ? zram_make_request+0xe6/0x100 [zram] [20931.796666] [<c111c38d>] ? release_pages+0x18d/0x1c0 [20931.796669] [<c162c573>] schedule+0x23/0x60 [20931.796673] [<c162d0fd>] rwsem_down_failed_common+0x9d/0xf0 [20931.796677] [<c162d162>] rwsem_down_write_failed+0x12/0x20 [20931.796681] [<c12f809a>] call_rwsem_down_write_failed+0x6/0x8 [20931.796685] [<c162ba44>] ? down_write+0x24/0x30 [20931.796689] [<f8439169>] zram_slot_free_notify+0x29/0x50 [zram] [20931.796693] [<f8439140>] ? zram_stat64_inc+0x30/0x30 [zram] [20931.796700] [<c11460bc>] swap_entry_free+0xdc/0x170 [20931.796703] [<c162d100>] ? rwsem_down_failed_common+0xa0/0xf0 [20931.796708] [<c1146458>] swap_free+0x28/0x40 [20931.796712] [<c1134ba0>] do_swap_page+0x390/0x6f0 [20931.796717] [<c10180f8>] ? sched_clock+0x8/0x10 [20931.796721] [<c11365aa>] handle_pte_fault+0x21a/0x2b0 [20931.796726] [<c10451e1>] ? kmap_atomic_prot+0xf1/0x120 [20931.796730] [<c113746a>] handle_mm_fault+0x1fa/0x2d0 [20931.796735] [<c1630ad0>] __do_page_fault+0x190/0x4f0 [20931.796740] [<c12f63bc>] ? sprintf+0x1c/0x20 [20931.796744] [<c104c132>] ? print_time.part.4+0x82/0xc0 [20931.796748] [<c1630e30>] ? __do_page_fault+0x4f0/0x4f0 [20931.796752] [<c1630e3d>] do_page_fault+0xd/0x10 [20931.796756] [<c162dc17>] error_code+0x67/0x6c [20931.796759] [<c12f8716>] ? __copy_to_user_ll+0x46/0x70 [20931.796763] [<c12f8970>] copy_to_user+0x40/0x60 [20931.796767] [<c104e218>] syslog_print+0xc8/0x210 [20931.796770] [<c104eae6>] do_syslog+0x206/0x390 [20931.796775] [<c106d570>] ? add_wait_queue+0x50/0x50 [20931.796780] [<c11c3680>] ? kmsg_poll+0x50/0x50 [20931.796784] [<c11c36d0>] kmsg_read+0x50/0x60 [20931.796788] [<c11b6584>] proc_reg_read+0x64/0xa0 [20931.796793] [<c116469c>] vfs_read+0x8c/0x160 [20931.796797] [<c10a898d>] ? sys_futex+0xed/0x130 [20931.796801] [<c11b6520>] ? proc_reg_write+0xa0/0xa0 [20931.796805] [<c11647b7>] sys_read+0x47/0x80 ... [30855.181542] Write-error on swap-device (251:0:131064) [43457.030155] Write-error on swap-device (251:0:131064) [43705.090381] Buffer I/O error on device zram0, logical block 16383 Anyway, there's a couple of lkml messages related to this "Buffer I/O error on device zram0", please investigate ProblemType: Bug DistroRelease: Ubuntu 12.04 Package: linux-image-3.8.0-29-generic 3.8.0-29.42~precise1 ProcVersionSignature: Ubuntu 3.8.0-29.42~precise1-generic 3.8.13.5 Uname: Linux 3.8.0-29-generic i686 NonfreeKernelModules: nvidia ApportVersion: 2.0.1-0ubuntu17.4 Architecture: i386 Date: Tue Aug 27 07:33:37 2013 EcryptfsInUse: Yes MarkForUpload: True ProcEnviron: TERM=rxvt LC_COLLATE=C PATH=(custom, no user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: linux-lts-raring UpgradeStatus: No upgrade log present (probably fresh install) --- AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.8.0-29-lowlatency. ApportVersion: 2.0.1-0ubuntu17.4 Architecture: i386 AudioDevicesInUse: USER PID ACCESS COMMAND /dev/snd/controlC0: muresan 29305 F.... pulseaudio /dev/snd/pcmC0D0p: muresan 29305 F...m pulseaudio /dev/snd/controlC1: muresan 29305 F.... pulseaudio CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found. Card0.Amixer.info: Card hw:0 'Intel'/'HDA Intel at 0xfebfc000 irq 44' Mixer name : 'SigmaTel STAC9205' Components : 'HDA:838476a0,102801f1,00100204 HDA:14f12c06,14f1000f,00100000' Controls : 26 Simple ctrls : 12 Card1.Amixer.info: Card hw:1 'USB'/'E-MU Systems, Inc. E-MU 0202 | USB at usb-0000:00:1d.0-2, full speed' Mixer name : 'USB Mixer' Components : 'USB041e:3f02' Controls : 4 Simple ctrls : 2 DistroRelease: Ubuntu 12.04 EcryptfsInUse: Yes HibernationDevice: RESUME=UUID=88836c66-16ea-407f-8753-3190c09ca82f IwConfig: lo no wireless extensions. eth0 no wireless extensions. MachineType: Dell Inc. Inspiron 1520 MarkForUpload: True NonfreeKernelModules: nvidia Package: linux-lts-raring ProcEnviron: TERM=rxvt LC_COLLATE=C PATH=(custom, no user) LANG=en_US.UTF-8 SHELL=/bin/bash ProcFB: ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-29-lowlatency root=UUID=a7047dd8-61aa-4cbe-b36d-697a5e7ee64b ro ProcVersionSignature: Ubuntu 3.8.0-29.21-lowlatency 3.8.13.5 RelatedPackageVersions: linux-restricted-modules-3.8.0-29-lowlatency N/A linux-backports-modules-3.8.0-29-lowlatency N/A linux-firmware 1.79.6 RfKill: 0: hci0: Bluetooth Soft blocked: no Hard blocked: no StagingDrivers: zram Tags: precise staging Uname: Linux 3.8.0-29-lowlatency i686 UpgradeStatus: No upgrade log present (probably fresh install) UserGroups: adm admin audio cdrom davfs2 dialout dip floppy fuse lpadmin netdev plugdev powerdev sambashare scanner video dmi.bios.date: 02/03/2008 dmi.bios.vendor: Dell Inc. dmi.bios.version: A07 dmi.board.name: 0UW306 dmi.board.vendor: Dell Inc. dmi.chassis.type: 8 dmi.chassis.vendor: Dell Inc. dmi.modalias: dmi:bvnDellInc.:bvrA07:bd02/03/2008:svnDellInc.:pnInspiron1520:pvr:rvnDellInc.:rn0UW306:rvr:cvnDellInc.:ct8:cvr: dmi.product.name: Inspiron 1520 dmi.sys.vendor: Dell Inc. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1217189/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp