提交 d95ead26 编写于 作者: S Szabolcs Nagy 提交者: Rich Felker

sys/mman.h: add MADV_COLD and MADV_PAGEOUT from linux v5.4

These were mainly introduced so android can optimize the memory usage
of unused apps.

MADV_COLD hints that the memory range is currently not needed (unlike
with MADV_FREE the content is not garbage, it needs to be swapped):

  linux commit 9c276cc65a58faf98be8e56962745ec99ab87636
  mm: introduce MADV_COLD

MADV_PAGEOUT hints that the memory range is not needed for a long time
so it can be reclaimed immediately independently of memory pressure
(unlike with MADV_DONTNEED the content is not garbage):

  linux commit 1a4e58cce84ee88129d5d49c064bd2852b481357
  mm: introduce MADV_PAGEOUT
上级 fa765ca5
...@@ -92,6 +92,8 @@ extern "C" { ...@@ -92,6 +92,8 @@ extern "C" {
#define MADV_DODUMP 17 #define MADV_DODUMP 17
#define MADV_WIPEONFORK 18 #define MADV_WIPEONFORK 18
#define MADV_KEEPONFORK 19 #define MADV_KEEPONFORK 19
#define MADV_COLD 20
#define MADV_PAGEOUT 21
#define MADV_HWPOISON 100 #define MADV_HWPOISON 100
#define MADV_SOFT_OFFLINE 101 #define MADV_SOFT_OFFLINE 101
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册