Since the 3.3-series kernel I am utilizing a zram-based ramdisk for /var/tmp/portage. Which worked fine so far on 3.3, 3.4 and 3.5 series. I am creating the zramdisk via: echo 3221225472 > /sys/block/zram0/disksize mkfs.ext4 -O ^has_journal -m 0 /dev/zram0 mount -o nobarrier,noatime /dev/zram0 /var/tmp/portage chmod a+w /var/tmp/portage Now, on kernel 3.6.0 and 3.6.1 (gentoo-sources) I get various file-system errors when emerging ebuilds. This happens every time. e.g. after "emerge -1 thunar" I get: EXT4-fs (zram0): re-mounted. Opts: nobarrier,commit=0 zram: Error allocating memory for compressed page: 36434, size=4114 Buffer I/O error on device zram0, logical block 36434 Buffer I/O error on device zram0, logical block 36435 Buffer I/O error on device zram0, logical block 36436 Buffer I/O error on device zram0, logical block 36437 Buffer I/O error on device zram0, logical block 36438 Buffer I/O error on device zram0, logical block 36439 Buffer I/O error on device zram0, logical block 36440 Buffer I/O error on device zram0, logical block 36441 Buffer I/O error on device zram0, logical block 36442 Buffer I/O error on device zram0, logical block 36443 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 148 (offset 0 size 40960 starting block 36434) zram: Error allocating memory for compressed page: 36464, size=4106 Buffer I/O error on device zram0, logical block 36455 Buffer I/O error on device zram0, logical block 36456 Buffer I/O error on device zram0, logical block 36457 Buffer I/O error on device zram0, logical block 36458 Buffer I/O error on device zram0, logical block 36459 Buffer I/O error on device zram0, logical block 36460 Buffer I/O error on device zram0, logical block 36461 Buffer I/O error on device zram0, logical block 36462 Buffer I/O error on device zram0, logical block 36463 Buffer I/O error on device zram0, logical block 36464 Buffer I/O error on device zram0, logical block 36465 Buffer I/O error on device zram0, logical block 36466 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 154 (offset 0 size 49152 starting block 36455) zram: Error allocating memory for compressed page: 36501, size=4114 Buffer I/O error on device zram0, logical block 36501 Buffer I/O error on device zram0, logical block 36502 Buffer I/O error on device zram0, logical block 36503 Buffer I/O error on device zram0, logical block 36504 Buffer I/O error on device zram0, logical block 36505 Buffer I/O error on device zram0, logical block 36506 Buffer I/O error on device zram0, logical block 36507 Buffer I/O error on device zram0, logical block 36508 Buffer I/O error on device zram0, logical block 36509 Buffer I/O error on device zram0, logical block 36510 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 176 (offset 0 size 40960 starting block 36501) zram: Error allocating memory for compressed page: 36523, size=4106 Buffer I/O error on device zram0, logical block 36514 Buffer I/O error on device zram0, logical block 36515 Buffer I/O error on device zram0, logical block 36516 Buffer I/O error on device zram0, logical block 36517 Buffer I/O error on device zram0, logical block 36518 Buffer I/O error on device zram0, logical block 36519 Buffer I/O error on device zram0, logical block 36520 Buffer I/O error on device zram0, logical block 36521 Buffer I/O error on device zram0, logical block 36522 Buffer I/O error on device zram0, logical block 36523 Buffer I/O error on device zram0, logical block 36524 Buffer I/O error on device zram0, logical block 36525 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 178 (offset 0 size 49152 starting block 36514) zram: Error allocating memory for compressed page: 36536, size=4116 Buffer I/O error on device zram0, logical block 36535 Buffer I/O error on device zram0, logical block 36536 Buffer I/O error on device zram0, logical block 36537 Buffer I/O error on device zram0, logical block 36538 Buffer I/O error on device zram0, logical block 36539 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 183 (offset 0 size 20480 starting block 36535) zram: Error allocating memory for compressed page: 39384, size=4117 Buffer I/O error on device zram0, logical block 39384 Buffer I/O error on device zram0, logical block 39385 Buffer I/O error on device zram0, logical block 39386 Buffer I/O error on device zram0, logical block 39387 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 518 (offset 0 size 16384 starting block 39384) zram: Error allocating memory for compressed page: 39063, size=4117 Buffer I/O error on device zram0, logical block 39063 Buffer I/O error on device zram0, logical block 39064 Buffer I/O error on device zram0, logical block 39065 Buffer I/O error on device zram0, logical block 39066 Buffer I/O error on device zram0, logical block 39067 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 527 (offset 0 size 20480 starting block 39063) zram: Error allocating memory for compressed page: 39382, size=4119 Buffer I/O error on device zram0, logical block 39382 Buffer I/O error on device zram0, logical block 39383 EXT4-fs warning (device zram0): ext4_end_bio:250: I/O error writing to inode 531 (offset 0 size 8192 starting block 39382) zram: Error allocating memory for compressed page: 39068, size=4116 Buffer I/O error on device zram0, logical block 39068 Buffer I/O error on device zram0, logical block 39069 The ebuilds install, but I don't know if I should trust the emerge if I get all these sorts of errors... Reproducible: Always Steps to Reproduce: 1. use >=gentoo-sources-3.6.0 2. create zram-based /var/tmp/portage 3. emerge blabla Portage 2.1.11.9 (default/linux/amd64/10.0/desktop/gnome, gcc-4.6.3, glibc-2.15-r2, 3.5.6-gentoo x86_64) ================================================================= System uname: Linux-3.5.6-gentoo-x86_64-AMD_FX-tm-6100_Six-Core_Processor-with-gentoo-2.1 Timestamp of tree: Sun, 07 Oct 2012 20:30:01 +0000 distcc 3.1 x86_64-pc-linux-gnu [disabled] app-shells/bash: 4.2_p37 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.3-r2, 3.2.3 dev-util/cmake: 2.8.9 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.10.5 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.11.6 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.6.3 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r3 sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers) sys-libs/glibc: 2.15-r2 Repositories: gentoo seden x-portage ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-pipe -Os -mtune=native -march=native -fstack-protector -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fivopts -floop-interchange -floop-strip-mine -floop-block -ftree-loop-im" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-pipe -Os -mtune=native -march=native -fstack-protector -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fivopts -floop-interchange -floop-strip-mine -floop-block -ftree-loop-im -fvisibility-inlines-hidden" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="ftp://mirror.switch.ch/mirror/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ " LANG="de_DE.utf8" LDFLAGS="-Wl,-O1 -Wl,-z,now -Wl,-z,relro -Wl,--sort-common -Wl,--as-needed" LINGUAS="de en" MAKEOPTS="-j7" PKGDIR="/usr/portage/packages" PORTAGE_COMPRESS="xz" PORTAGE_COMPRESS_FLAGS="-6" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/seden /usr/local/portage" SYNC="rsync://yea/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 avx bash-completion berkdb bluetooth bluray bzip2 cairo cdda cdr cli colord consolekit cracklib crypt cups custom-cflags custom-optimization cxx dbus dirac djvu dri dts dvd dvdr eds emboss enca encode evo exif firefox flac fortran gdbm gif gnome gnome-keyring gnutls gstreamer gtk iconv icu ipv6 ithreads java5 java6 jbig jpeg jpeg2k lcms libnotify libsamplerate live lzma mad matroska mmap mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls no-old-linux nptl nptlonly ogg ogm opengl openmp pam pango pcre pcsc-lite pdf png policykit ppds pppd pulseaudio readline rle schroedinger sdl session smp socialweb spell sse sse2 sse3 sse4 sse4_1 sse4a ssl ssse3 startup-notification svg system-sqlite tcpd theora threads tiff truetype udev udisks unicode upower usb vorbis vpx webp wmf x264 xcb xml xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="modesetting radeon r600 virtualbox" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 326028 [details] .config of my gentoo-sources-3.6.1 kernel
So, a couple of things you can try here. 1. Do a git bisect between the last working kernel and 3.6.0 and identify the offending commit. [1] 2. There is a thread talking about regression that may outline what you are seeing. You could try the patch referenced in the thread and see if it helps. [2] If you do number 1, and the offending patch is the same as the offending one referenced in [2], that would more clearly show you are hitting the same issue. [1] http://wiki.gentoo.org/wiki/Kernel_git-bisect [2] https://lkml.org/lkml/2012/10/8/480
[2] Hmm, interesting! [1] Thanks for the hint! But ATM not enough time to try this. I hope I will be able to until next weekend.
Reporting back... commit 130f315a174d127cbb90d4d1a4a7088dbcf930b5 Author: Minchan Kim <minchan@kernel.org> Date: Fri Jun 8 15:39:27 2012 +0900 staging: zram: remove special handle of uncompressed page xvmalloc can't handle PAGE_SIZE page so that zram have to handle it specially but zsmalloc can do it so let's remove unnecessary special handling code. Quote from Nitin "I think page vs handle distinction was added since xvmalloc could not handle full page allocation. Now that zsmalloc allows full page allocation, we can just use it for both cases. This would also allow removing the ZRAM_UNCOMPRESSED flag. The only downside will be slightly slower code path for full page allocation but this event is anyways supposed to be rare, so should be fine." 1. This patch reduces code very much. drivers/staging/zram/zram_drv.c | 104 +++++-------------------------------- drivers/staging/zram/zram_drv.h | 17 +----- drivers/staging/zram/zram_sysfs.c | 6 +-- 3 files changed, 15 insertions(+), 112 deletions(-) 2. change pages_expand with bad_compress so it can count bad compression(above 75%) ratio. 3. remove zobj_header which is for back-reference for defragmentation because firstly, it's not used at the moment and zsmalloc can't handle bigger size than PAGE_SIZE so zram can't do it any more without redesign.
Created attachment 327628 [details] bisect.log, gentoo sources 3.5.7 - 3.6.1
On LKML there's a fix present (https://lkml.org/lkml/2012/10/10/692) for a problem that also mentions this commit but I don't see at first sight whether this would solve your problem or not (I can't find a commitdiff for the commit in question, and don't want to pull the whole tree for just this), it might be interesting to test the patch to see whether it resolves your problem.
(In reply to comment #6) > On LKML there's a fix present (https://lkml.org/lkml/2012/10/10/692) for a > problem that also mentions this commit but I don't see at first sight > whether this would solve your problem or not (I can't find a commitdiff for > the commit in question, and don't want to pull the whole tree for just > this), it might be interesting to test the patch to see whether it resolves > your problem. I did not test this patch specifically, but it's included in kernel 3.6.5. So I gave 3.6.5 a try and now the error is gone and everything works as before with my zram-based /var/tmp/portage. Guess the patch worked out!