scripts/memory_test and threaded_memtest fail on arm
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Fix Released
|
Medium
|
Brendan Donegan |
Bug Description
On this arm system, which has access to 4 GB of RAM, running the default memory_test script results in this:
$ sudo /usr/share/
Free Memory: 3801 MB
Swap Memory: 1047 MB
Running Single Process Memory Test
Starting Threaded Memory Test
Running for 3991 MB total memory
Running for more than free memory at 3991 MB for 60 sec.
Command is: /usr/share/
/usr/share/
More Than Free Memory Test failed
This helpfully reports the actual command used to try the run, so I tried that manually:
/usr/share/
$ /usr/share/
Warning: memsize > free_mem. You will probably hit swap.
Detected 4 processors.
RAM: 87.5% free (3531M/4037M)
Testing 3991M RAM for 60 seconds using 8 threads:
thread 1: mapping 498M RAM
thread 0: mapping 498M RAM
thread 2: mapping 498M RAM
thread 3: mapping 498M RAM
thread 4: mapping 498M RAM
thread 5: mapping 498M RAM
thread 6: mapping 498M RAM
thread 7: mapping 498M RAM
mmap: Cannot allocate memory
mmap: Cannot allocate memory
However reducing the memory to allocate works:
$ /usr/share/
Detected 4 processors.
RAM: 87.5% free (3532M/4037M)
Testing 1991M RAM for 5 seconds using 8 threads:
thread 1: mapping 248M RAM
<snip>
thread 7: mapping 248M RAM
thread 1: mapping complete
<snip>
thread 7: mapping complete
thread 4: test start
<snip>
thread 7: test start
thread 0 finished.
<snip>
thread 4 finished.
thread 4 unmapping and exiting
<snip>
thread 2 unmapping and exiting
Runtime was 5.63s
thread 0: 266353 loops
<snip>
thread 7: 293540 loops
Total loops per second: 406997.69
Testing complete.
By experimenting I found that the largest memory size is between 2844 and 2846 (it's variable, sometimes it works and sometimes it fails). I suspect it has to do with the executable being 32-bit and so unable to allocate more than this. Or maybe we need to revise the available memory calculations for arm.
Related branches
- Zygmunt Krynicki (community): Approve
-
Diff: 127 lines (+25/-20)2 files modifiedcheckbox-old/debian/changelog (+2/-0)
checkbox-old/scripts/memory_test (+23/-20)
Changed in checkbox: | |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
importance: | Undecided → Medium |
tags: | added: tay |
Changed in checkbox: | |
status: | In Progress → Fix Committed |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |
Confirmed that process address space is limited to 32-bit on ARM. Interestingly this code exists in the memory_test script:
# Process Memory
self.process_ memory = self.free_memory out("arch" ).decode( ) r"(i[0- 9]86|s390) ", arch) and self.free_memory > 1024:
self. is_process_ limited = True
self. process_ memory = 1024 # MB, due to 32-bit address space
print( "%s arch, Limiting Process Memory: %u" % (arch,
self. process_ memory) )
try:
arch = self._command_
if re.match(
So perhaps this just needs to be made aware of ARM as an architecture. The 'arch' output on Calxeda is 'armv7l', so we could just add that in, but we might want to make the solution more flexible.