[Bug 672055] New: mmap of area larger than VRAM causes map to fail
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c0
Summary: mmap of area larger than VRAM causes map to fail
Classification: openSUSE
Product: openSUSE 11.4
Version: Factory
Platform: x86-64
OS/Version: Linux
Status: NEW
Severity: Minor
Priority: P5 - None
Component: Kernel
AssignedTo: kernel-maintainers@forge.provo.novell.com
ReportedBy: jengelh@medozas.de
QAContact: qa@suse.de
Found By: Beta-Customer
Blocker: ---
The following program will fail to obtain a vma on a system with less than 2 GB
in VRAM (physram + swap):
---
#include
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c1
Jiri Slaby
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c2
Jan Engelhardt
Does it happen with overcommit_memory == 1?
It also happens with 1 or 2 and overcommit_ratio=100. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c3
--- Comment #3 from Mel Gorman
Does it happen with overcommit_memory == 1? 0 means a heuristic which might refuse to overcommit.
Agreed. mmap() would be expected to fail if /proc/sys/vm/overcommit_memory was 0 (the default). From the documentation "When this flag is 0, the kernel attempts to estimate the amount of free memory left when userspace requests more memory."
I don't think the former is a bug anyway. Why do you think it is?
The map of DVD may a bug though.
Maybe. While this is x86-64, was the test program a 64-bit binary? If it was 32-bit, a mmap() of a large file would still be expected to fail due to a lack of virtual addressing space and have nothing to do with available memory. On a similar vein, was O_LARGEFILE specified to open() and _LARGEFILE64_SOURCE defined? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c
Jiri Slaby
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c4
Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c5
--- Comment #5 from Mel Gorman
All components were already x86_64. As such, O_LARGEFILE shouldn't be needed, should it?
If all components are indeed x86-64 then it shouldn't be needed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c6
--- Comment #6 from Mel Gorman
Does it happen with overcommit_memory == 1?
It also happens with 1 or 2 and overcommit_ratio=100.
What version of openSUSE exactly are you testing? The behavior I see with your test program on a machine with 1G of RAM, no swap, and openSUSE factory downloaded yesterday is as follows; hydra:~ # uname -a Linux hydra 2.6.37-20-desktop #1 SMP PREEMPT 2011-01-22 00:41:44 +0100 x86_64 x86_64 x86_64 GNU/Linux hydra:~ # cat /etc/SuSE-release openSUSE 11.4 RC 1 (x86_64) VERSION = 11.4 CODENAME = Celadon hydra:~ # echo 0 > /proc/sys/vm/overcommit_memory hydra:~ # ./testcase-vma-map-anon 0xffffffffffffffff hydra:~ # echo 1 > /proc/sys/vm/overcommit_memory hydra:~ # ./testcase-vma-map-anon 0x7fa158fa1000 hydra:~ # echo 2 > /proc/sys/vm/overcommit_memory hydra:~ # ./testcase-vma-map-anon 0xffffffffffffffff This is as expected - the value of 1 overcommitted unconditionally and the other options preventing the mapping due to a lack of physical memory. I tried as a normal user but didn't see any problems. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c7
--- Comment #7 from Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c8
Jiri Slaby
jengelh@jng-0:/dev/shm> cat /etc/SuSE-release openSUSE 11.4 Milestone 6 of 6 (x86_64) VERSION = 11.4 CODENAME = Celadon jengelh@jng-0:/dev/shm> uname -a Linux jng-0 2.6.38-rc1+ #25 SMP PREEMPT Wed Feb 16 18:01:16 CET 2011 x86_64 x86_64 x86_64 GNU/Linux
Maybe there was a bug in .38-rc1? Could you retry with the current kotd (rc4)? I cannot reproduce either. (Also RC1 is out as of today. It should have no effect, but who knows if there is any change in glibc. So first, fully upgrade and retry.) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c9
Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c10
--- Comment #10 from Mel Gorman
It seems this is not dependent on the kernel version. I have two hosts (one live machine, and a VM on it) both running the same kernel (based upon commit cb76856db0aa2385d9a9e8ce595467bd3ac30fce from kernel-source git).
So is this failure intermittent or if it fails once on a machine, does it consistently fail? If it's intermittent, it's worth dumping out the contents of /proc/self/maps at the time of failure to rule out virtual address space fragmentation as the source of the mapping failure.
Trying to map a 25GB ro mapping on /dev/zero fails in the host-side 11.3 environment, while it does work with the VM-side 11.4 RC1. I seem to remember that 11.4 M6 that I had this morning in the VM (*without* systemd) also rejected the big mapping.
If it fails on some machines and not on others, can you confirm that the ulimits for all machines and the running user are the same and that /proc/sys/vm/overcommit_memory is 1 in all cases please? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c11
--- Comment #11 from Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c12
--- Comment #12 from Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c13
--- Comment #13 from Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c
Jiri Slaby
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c14
Kay Sievers
ulimit is the keyword.
--- - 2011-02-17 13:37:12.651260449 +0100 +++ VM 2011-02-17 13:37:05.805295838 +0100 -max memory size (kbytes, -m) 21025344 +max memory size (kbytes, -m) unlimited -virtual memory (kbytes, -v) 23142880 +virtual memory (kbytes, -v) unlimited
/etc/sysconfig/ulimit is the same for both hosts. Is it perhaps that systemd does not execute /etc/initscripts anymore?
Right, it doesn't. None of these files are read or executed by systemd. These values can be set only in individual service files. systemd will not use /etc/sysconfig/ or always start a shell script for general service startup. We might need some new global config here. I'll check with upstream ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c15
--- Comment #15 from Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c
Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c19
Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c20
Jan Engelhardt
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c22
Kurt Garloff
https://bugzilla.novell.com/show_bug.cgi?id=672055
https://bugzilla.novell.com/show_bug.cgi?id=672055#c
Jan Engelhardt
participants (1)
-
bugzilla_noreply@novell.com