mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-25 21:25:59 +07:00
readahead-common: fix total memory size detection
sysinfo returns the total memory size in multiples of mem_unit bytes. As long as the size in bytes fits into unsigned long, the kernel uses mem_unit = 1, but this is not true on i386 with more than 4 GB RAM. https://bugzilla.redhat.com/show_bug.cgi?id=712341
This commit is contained in:
parent
dc725264f3
commit
597b99b09a
@ -154,9 +154,8 @@ bool enough_ram(void) {
|
||||
|
||||
assert_se(sysinfo(&si) >= 0);
|
||||
|
||||
return si.totalram > 127 * 1024*1024; /* Enable readahead only
|
||||
* with at least 128MB
|
||||
* memory */
|
||||
/* Enable readahead only with at least 128MB memory */
|
||||
return si.totalram > 127 * 1024*1024 / si.mem_unit;
|
||||
}
|
||||
|
||||
int open_inotify(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user