Bug 1534620 - Please raise the default /proc/sys/net/core/optmem_max from 10240 to 20480 on ARM kernels
Summary: Please raise the default /proc/sys/net/core/optmem_max from 10240 to 20480 on...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: arm
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-15 15:30 UTC by Tomas Mraz
Modified: 2018-01-16 17:58 UTC (History)
25 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-01-16 17:58:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Temporary patch for systemd (3.08 KB, patch)
2018-01-15 18:35 UTC, Björn Esser (besser82)
no flags Details | Diff
Patch for the kernel maintainers to be upstreamed in mainline kernel (782 bytes, patch)
2018-01-15 19:17 UTC, Björn Esser (besser82)
no flags Details | Diff

Description Tomas Mraz 2018-01-15 15:30:14 UTC
The new libkcapi package test suite requires optmem_max to be 20480 to run successfully. Could you please raise it on ARM kernels to the value 20480 as already set on other architectures?

Is there any particular reason why this default value is different on ARM than on any other architecture in Fedora?

Comment 1 Laura Abbott 2018-01-15 16:40:44 UTC
int sysctl_optmem_max __read_mostly = sizeof(unsigned long)*(2*UIO_MAXIOV+512);

sizeof(unsigned long) is going to be different on ARM32 vs. other 64-bit arches, hence the difference. This has been the setting for a very long time, is there a reason changing it via sysctl is not an option?

Comment 2 Björn Esser (besser82) 2018-01-15 17:20:22 UTC
(In reply to Laura Abbott from comment #1)
> int sysctl_optmem_max __read_mostly = sizeof(unsigned
> long)*(2*UIO_MAXIOV+512);
> 
> sizeof(unsigned long) is going to be different on ARM32 vs. other 64-bit
> arches, hence the difference.

I just checked and found `unsigned long` to be 32 bits on %{arm}, only.  All other arches (even %{ix86}) have it set to 64 bits.

unsigned long long seems to be at least 64-bit on all arches.


> This has been the setting for a very long
> time, is there a reason changing it via sysctl is not an option?

Well, yes…  One cannot change it using sysctl (or using other ways) without being root (and thus isn't an option for Koji builds).

The preset can be changed to be the same on all arches (based on changing that in systemd) by adding `net.core.optmem_max = 20480` to `/usr/lib/sysctl.d/50-default.conf`, tho.

Any ideas towards that?

Comment 3 Björn Esser (besser82) 2018-01-15 17:29:53 UTC
Changing component to `systemd` since the implementation could be done there, without changing any defaults in kernel code.

Comment 4 Zbigniew Jędrzejewski-Szmek 2018-01-15 18:12:11 UTC
Technically, changing it in systemd is easy. But in the long run, it seems like the wrong solution. If the current default is clearly useless, why not change it properly in the kernel and make the kernel behave properly out of the box? Please provide rationale why systemd should override the defaults provided by another package in this case.

Comment 5 Björn Esser (besser82) 2018-01-15 18:24:57 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #4)
> Technically, changing it in systemd is easy. But in the long run, it seems
> like the wrong solution. If the current default is clearly useless, why not
> change it properly in the kernel and make the kernel behave properly out of
> the box? Please provide rationale why systemd should override the defaults
> provided by another package in this case.


My thought was:  We could override the default in systemd as a intermediate solution until there is a proper solution found to set it to a sane and consistent default in the kernel codebase.

The other option would be to carry a downstream patch to the kernel, which seems to be a much bigger effort than carrying a downstream patch on systemd…

Comment 6 Björn Esser (besser82) 2018-01-15 18:35:28 UTC
Created attachment 1381615 [details]
Temporary patch for systemd

This patch adds the needed setting to systemd's sysctl defaults.  It applies on recent master of dist-git.

If this is acceptable as a temporary solution (until the default is fixed in kernel), please backport this to fc26 and fc27.

Comment 7 Zbigniew Jędrzejewski-Szmek 2018-01-15 18:40:31 UTC
Thanks. But I really would prefer for this to be temporary. Do the kernel folks commit to trying to change this upstream in the kernel?

Comment 8 Björn Esser (besser82) 2018-01-15 19:17:42 UTC
Created attachment 1381676 [details]
Patch for the kernel maintainers to be upstreamed in mainline kernel

This patches makes sure optmem_max limit is at least 20480 on any recent architecture; it might be bigger on future architectures.

Comment 9 Björn Esser (besser82) 2018-01-15 19:19:57 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #7)
> Thanks. But I really would prefer for this to be temporary. Do the kernel
> folks commit to trying to change this upstream in the kernel?

If you do not disagree, I'll push my patch to systemd (and backport it to fc26+), trigger a build and push the updates.

Comment 10 Zbigniew Jędrzejewski-Szmek 2018-01-15 19:21:50 UTC
I do disagree. I'm still waiting for an answer to the question in comment #c7.

Comment 11 Björn Esser (besser82) 2018-01-16 17:58:11 UTC
To temporarily work around this problem, I've filed a ticket with fedora-infra [1] and added a reasonable sysctl preset for `net.core.optmem_max` in the libkcapi package.

To fix this in the long run, I've submitted a patch [2] for review to the Linux Kernel.


[1]  https://pagure.io/fedora-infrastructure/issue/6636
[2]  https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1587867.html


Note You need to log in before you can comment on or make changes to this bug.