Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZFS appears to ignore zfs.zfs_arc_max in the kernel commandline #698

Closed
ryao opened this issue Apr 24, 2012 · 6 comments
Closed

ZFS appears to ignore zfs.zfs_arc_max in the kernel commandline #698

ryao opened this issue Apr 24, 2012 · 6 comments
Labels
Type: Documentation Indicates a requested change to the documentation
Milestone

Comments

@ryao
Copy link
Contributor

ryao commented Apr 24, 2012

It does not appear to be possible to set zfs_arc_max via the kernel commandline. I tried setting both zfs_arc_max and zfs.zfs_arc_max, but neither appeared to have any effect on c_max in /proc/spl/kstat/zfs/arcstats.

This was observed when booting Linux 3.3.2 with an initramfs.

@behlendorf
Copy link
Contributor

I'm not sure this is really a bug. Why would you expect this to work in the first place? The kernel only has a very specific set of supported command line options, these differ from module options.

@ryao
Copy link
Contributor Author

ryao commented Apr 27, 2012

Various Gentoo developers in #gentoo-dev on freenode were quite confident that the kernel would provide default parameters to modules when added to the kernel commandline in this way. One example that they cited was "i915.i915_enable_rc6=1". I do not see anything in the ZFS code that would permit this, but Intel's ability to do this with i915 suggests that it might be possible to do this for ZFS as well.

@behlendorf
Copy link
Contributor

Interesting, well we can certainly leave the bug open until someone has time to look in to it. Right now zfs only uses the standard module option infrastructure, perhaps there's some additional handling we need to add to do this.

@dajhorn
Copy link
Contributor

dajhorn commented Apr 28, 2012

I think that the module_param() call is only hooked onto the kernel command line if the module is built-in.

The behavior seems to depend on #ifdef MODULE starting in this file:

@ierdnah
Copy link

ierdnah commented May 25, 2012

Yes, this is correct, the command line module parameters are only applied for modules that are built-in.

@ryao
Copy link
Contributor Author

ryao commented Jul 21, 2012

This issue has been fixed in genkernel 3.4.39. The commit that fixed it was the following:

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=2bf6b9045db63e8163ac6a83137077eb8b9ecade

Other distributions should be able to do something similar in their initramfs generation software to enable this to work.

ProxBot pushed a commit to proxmox/proxmox-backup that referenced this issue Jun 15, 2023
Currently the values set for zfs_arc_min and zfs_arc_max are ignored
by the kernel:
```
Unknown kernel command line parameters... will be passed to user space
```
module parameters provided on the commandline usually need to be
prefixed with the modulename (e.g. zfs.zfs_arc_min, see [0] for a bit
on related information (the issue itself is not related)).

Paradoxically currently ZFS will print spurious warnings about
settings being ignored when they are actually set - see [1].

Booting the debug image and connecting the shell on the serial console
confirmed that the values did not seem to be set:
`grep '^c_' /proc/spl/kstat/zfs/arcstats` showed half of the memory
for c_max.

[0] openzfs/zfs#698
[1] openzfs/zfs#12504

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
pcd1193182 pushed a commit to pcd1193182/zfs that referenced this issue Sep 26, 2023
The interface was changed to take a NonZeroUsize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Indicates a requested change to the documentation
Projects
None yet
Development

No branches or pull requests

4 participants