WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] kernel 3.10, zram issue  (Read 11162 times)

Offline helasz

  • Newbie
  • *
  • Posts: 36
[SOLVED] kernel 3.10, zram issue
« on: September 25, 2013, 06:34:11 AM »
Hi All,

I am using Core 5.0 with custom kernel (last longterm one: 3.10) in VirtualBox (4.2.18). In patching the kernel I had to slightly touch the tmpfs-root.patch. Although the kernel works fine in many aspects, it gives

swapon /dev/zram0: Invalid argument

May this caused by manipulated tmpfs-root.patch?
The fact is that same error came up in mounting the cdrom. In that case I needed to load manually the isofs module to solve the problem. Is there some module to load or whatever I am missing for zram?
« Last Edit: October 03, 2013, 08:59:42 AM by helasz »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: kernel 3.10, zram issue
« Reply #1 on: September 25, 2013, 08:51:08 AM »
Do you have zram enabled in your config?
The only barriers that can stop you are the ones you create yourself.

Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #2 on: September 25, 2013, 09:22:55 AM »
I have not disabled (nozswap). If I disable it, no error message comes up.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: kernel 3.10, zram issue
« Reply #3 on: September 25, 2013, 10:06:33 AM »
In your custom kernel config.
The only barriers that can stop you are the ones you create yourself.

Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #4 on: September 26, 2013, 06:08:51 AM »
I have in kernel config:

CONFIG_ZSMALLOC=y
CONFIG_ZRAM=m
CONFIG_ZCACHE=m

I guess these are the ones needed. Both modules are loaded when I check after booting with lsmod.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: kernel 3.10, zram issue
« Reply #5 on: September 26, 2013, 06:16:12 AM »
I do not know is it matter or not, but in piCore with kernel 3.11.1 these are built into the kernel:

CONFIG_ZSMALLOC=y
CONFIG_ZRAM=y
CONFIG_ZCACHE=y

and not modules. Worth to try.


Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #6 on: September 26, 2013, 07:21:15 AM »
Thank you for the suggestion, Béla! I will give it a try and get back with the result (probably only tomorrow).

Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #7 on: September 27, 2013, 09:06:32 AM »
I did recompile my kernel with

CONFIG_ZSMALLOC=y
CONFIG_ZRAM=y
CONFIG_ZCACHE=y

Unfortunately the error message keeps showing up.
I read in aufs-util README that after kernel 3.9 each filesystem needs to appear among aliases as "fs-fsname" (fs-aufs for instance), maybe some similar new restriction applies? I found a known case when swapon returns "invalid argument", if the filesystem it needs to reside on does not support it (btrfs, see: http://superuser.com/questions/539287/swapon-failed-invalid-argument-on-a-linux-system-with-btrfs-filesystem).
Since no argumernt was given to swapon other than the mandatory device name, maybe busybox' swapon has some issue with the 3.10 kernel? I will try to inject the one from util-linux, let us see.
Any suggestion is welcome anyway. I will keep investigating further and get back with findings.



Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #8 on: September 27, 2013, 09:27:36 AM »
One step further: by injecting swapon (along with needed libmount) some further details showed up. The error message is now:

swapon: /dev/zram0: read swap header failed: Invalid argument

After trying "sudo mkswap /dev/zram0 2000", "swapon /dev/zram0" returns exactly the same error message.

Does /dev/zram0 need to be initialzed somehow?


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: kernel 3.10, zram issue
« Reply #9 on: September 27, 2013, 09:42:59 AM »
Does /dev/zram0 need to be initialzed somehow?

It is done by TC automatically if nozswap boot option is not used. zswap works as expected both with TC 5.0 and piCore 5.0 which means that Kernel 3.8.10 supports zswap correctly with busybox. Use the stock TC kernel config as a basis for your custom kernel.
« Last Edit: September 27, 2013, 09:44:50 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: kernel 3.10, zram issue
« Reply #10 on: September 27, 2013, 10:51:37 AM »
I read in aufs-util README that after kernel 3.9 each filesystem needs to appear among aliases as "fs-fsname" (fs-aufs for instance), maybe some similar new restriction applies?
Could you provide a direct link to that please, I couldn't find such a reference.
Quote
I found a known case when swapon returns "invalid argument", if the filesystem it needs to reside on does not support it (btrfs, see: http://superuser.com/questions/539287/swapon-failed-invalid-argument-on-a-linux-system-with-btrfs-filesystem).
That is totally unrelated to anything else but btrfs.


I'd suggest you test your kernel on bare metal.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #11 on: October 01, 2013, 02:39:34 AM »
I read in aufs-util README that after kernel 3.9 each filesystem needs to appear among aliases as "fs-fsname" (fs-aufs for instance), maybe some similar new restriction applies?
Could you provide a direct link to that please, I couldn't find such a reference.
Quote
I found a known case when swapon returns "invalid argument", if the filesystem it needs to reside on does not support it (btrfs, see: http://superuser.com/questions/539287/swapon-failed-invalid-argument-on-a-linux-system-with-btrfs-filesystem).
That is totally unrelated to anything else but btrfs.


I'd suggest you test your kernel on bare metal.


It is to be found in the documentation of aufs3.10, and namely:

http://sourceforge.net/p/aufs/aufs3-standalone/ci/aufs3.10/tree/Documentation/filesystems/aufs/
The text reads:
Note: Since linux-3.9, every filesystem module requires an alias
  "fs-<fsname>". You should make sure that "fs-aufs" is listed in your
  modules.aliases file if you set CONFIG_AUFS_FS=m.


It is true that the btrfs is unrelated directly to zswap, but at that point of my search it was not clear, whether "Invalid argument" has anything to do with swap "filesystem".

I will give it a try on bare metal and get back with the results. Also Béla's suggestion of using official TCL 3.8 kernel config is reasonable. Thanks for both!



Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #12 on: October 01, 2013, 03:06:32 AM »
Bare metal does not help in anyway.
Let me try the 3.8 config.

Offline helasz

  • Newbie
  • *
  • Posts: 36
Re: kernel 3.10, zram issue
« Reply #13 on: October 03, 2013, 08:17:14 AM »
Using as base the stock TC 3.8 kernel config did give the same result: Invalid argument
I noticed however a new option about BCACHE which is supposed to cache content from slower drives' content. I guess it has nothing to do with my issue, however I did include it (BCACHE=y)

Not having other clue I replaced busybox's mkswap with the util-linux' one. Now the error message claimes that the device size is 0KB although it should be at least 40KB.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: kernel 3.10, zram issue
« Reply #14 on: October 03, 2013, 08:21:20 AM »
Using as base the stock TC 3.8 kernel config did give the same result: Invalid argument
I noticed however a new option about BCACHE which is supposed to cache content from slower drives' content. I guess it has nothing to do with my issue, however I did include it (BCACHE=y)

Not having other clue I replaced busybox's mkswap with the util-linux' one. Now the error message claimes that the device size is 0KB although it should be at least 40KB.

Starting point is, that it works in the stock Core 5.0 (5.0.1) which means proper kernel config and BusyBox. First I would make a kernel with the original config in your development environment to verify everything is OK. When it works, you can start changing config and see result.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."