mmap: allow unlimited overcommit
Change-Id: Iba07b5c504b4a202cd163ce682f3fc72a31284a0
This commit is contained in:
3
NEWS.md
3
NEWS.md
@@ -535,3 +535,6 @@ Restrictions on McKernel
|
|||||||
|
|
||||||
25. The behaviors of madvise and mbind are changed to do nothing and
|
25. The behaviors of madvise and mbind are changed to do nothing and
|
||||||
report success as a workaround for Fugaku.
|
report success as a workaround for Fugaku.
|
||||||
|
|
||||||
|
26. mmap() allows unlimited overcommit. Note that it corresponds to
|
||||||
|
setting sysctl ``vm.overcommit_memory`` to 1.
|
||||||
|
|||||||
@@ -72,4 +72,11 @@
|
|||||||
#define MS_INVALIDATE 0x02
|
#define MS_INVALIDATE 0x02
|
||||||
#define MS_SYNC 0x04
|
#define MS_SYNC 0x04
|
||||||
|
|
||||||
|
/* include/uapi/linux/mman.h */
|
||||||
|
#define OVERCOMMIT_GUESS 0
|
||||||
|
#define OVERCOMMIT_ALWAYS 1
|
||||||
|
#define OVERCOMMIT_NEVER 2
|
||||||
|
|
||||||
|
extern int sysctl_overcommit_memory;
|
||||||
|
|
||||||
#endif /* HEADER_MMAN_H */
|
#endif /* HEADER_MMAN_H */
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <ihk/ihk_monitor.h>
|
#include <ihk/ihk_monitor.h>
|
||||||
#include <ihk/debug.h>
|
#include <ihk/debug.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
#include <mman.h>
|
||||||
|
|
||||||
#ifdef ENABLE_RUSAGE
|
#ifdef ENABLE_RUSAGE
|
||||||
|
|
||||||
@@ -311,6 +312,9 @@ rusage_check_overmap(size_t len, int pgshift)
|
|||||||
{
|
{
|
||||||
int npages = 0, remain_pages = 0;
|
int npages = 0, remain_pages = 0;
|
||||||
|
|
||||||
|
if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS)
|
||||||
|
return 0;
|
||||||
|
|
||||||
npages = (len + (1UL << pgshift) - 1) >> pgshift;
|
npages = (len + (1UL << pgshift) - 1) >> pgshift;
|
||||||
remain_pages = (rusage.total_memory - rusage.total_memory_usage)
|
remain_pages = (rusage.total_memory - rusage.total_memory_usage)
|
||||||
>> pgshift;
|
>> pgshift;
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ extern int interrupt_from_user(void *);
|
|||||||
struct tlb_flush_entry tlb_flush_vector[IHK_TLB_FLUSH_IRQ_VECTOR_SIZE];
|
struct tlb_flush_entry tlb_flush_vector[IHK_TLB_FLUSH_IRQ_VECTOR_SIZE];
|
||||||
|
|
||||||
int anon_on_demand = 0;
|
int anon_on_demand = 0;
|
||||||
|
int sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
|
||||||
|
|
||||||
static struct ihk_mc_pa_ops *pa_ops;
|
static struct ihk_mc_pa_ops *pa_ops;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user