From: Chen Gang <gang.chen.5i5j@gmail.com>
To: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
minchan@kernel.org, "rth@twiddle.net" <rth@twiddle.net>,
"ink@jurassic.park.msu.ru" <ink@jurassic.park.msu.ru>,
"mattst88@gmail.com" <mattst88@gmail.com>,
Ralf Baechle <ralf@linux-mips.org>,
"jejb@parisc-linux.org" <jejb@parisc-linux.org>,
"deller@gmx.de" <deller@gmx.de>,
"chris@zankel.net" <chris@zankel.net>,
"jcmvbkbc@gmail.com" <jcmvbkbc@gmail.com>
Cc: "linux-alpha@vger.kernel.org" <linux-alpha@vger.kernel.org>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"linux-parisc@vger.kernel.org" <linux-parisc@vger.kernel.org>,
"linux-xtensa@linux-xtensa.org" <linux-xtensa@linux-xtensa.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] arch: uapi: asm: mman.h: Support MADV_FREE for madvise()
Date: Tue, 02 Dec 2014 04:43:19 +0800 [thread overview]
Message-ID: <547CD2E7.7030100@gmail.com> (raw)
At present, kernel supports madvise(MADV_FREE), so can benefit to all
related architectures (can grep MADV_WILLNEED or MADV_REMOVE in "arch/"
to know about all related architectures).
The related git commit: "4fb10ba mm: support madvise(MADV_FREE)".
The related error (with allmodconfig under parisc):
CC mm/madvise.o
mm/madvise.c: In function 'madvise_need_mmap_write':
mm/madvise.c:42:7: error: 'MADV_FREE' undeclared (first use in this function)
case MADV_FREE:
^
mm/madvise.c:42:7: note: each undeclared identifier is reported only once for each function it appears in
mm/madvise.c: In function 'madvise_vma':
mm/madvise.c:534:7: error: 'MADV_FREE' undeclared (first use in this function)
case MADV_FREE:
^
mm/madvise.c: In function 'madvise_behavior_valid':
mm/madvise.c:561:7: error: 'MADV_FREE' undeclared (first use in this function)
case MADV_FREE:
^
make[1]: *** [mm/madvise.o] Error 1
make: *** [mm] Error 2
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
arch/alpha/include/uapi/asm/mman.h | 1 +
arch/mips/include/uapi/asm/mman.h | 1 +
arch/parisc/include/uapi/asm/mman.h | 1 +
arch/xtensa/include/uapi/asm/mman.h | 1 +
4 files changed, 4 insertions(+)
diff --git a/arch/alpha/include/uapi/asm/mman.h b/arch/alpha/include/uapi/asm/mman.h
index 0086b47..836fbd4 100644
--- a/arch/alpha/include/uapi/asm/mman.h
+++ b/arch/alpha/include/uapi/asm/mman.h
@@ -44,6 +44,7 @@
#define MADV_WILLNEED 3 /* will need these pages */
#define MADV_SPACEAVAIL 5 /* ensure resources are available */
#define MADV_DONTNEED 6 /* don't need these pages */
+#define MADV_FREE 7 /* free pages only if memory pressure */
/* common/generic parameters */
#define MADV_REMOVE 9 /* remove these pages & resources */
diff --git a/arch/mips/include/uapi/asm/mman.h b/arch/mips/include/uapi/asm/mman.h
index cfcb876..106e741 100644
--- a/arch/mips/include/uapi/asm/mman.h
+++ b/arch/mips/include/uapi/asm/mman.h
@@ -67,6 +67,7 @@
#define MADV_SEQUENTIAL 2 /* expect sequential page references */
#define MADV_WILLNEED 3 /* will need these pages */
#define MADV_DONTNEED 4 /* don't need these pages */
+#define MADV_FREE 5 /* free pages only if memory pressure */
/* common parameters: try to keep these consistent across architectures */
#define MADV_REMOVE 9 /* remove these pages & resources */
diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h
index 294d251..6cb8db7 100644
--- a/arch/parisc/include/uapi/asm/mman.h
+++ b/arch/parisc/include/uapi/asm/mman.h
@@ -40,6 +40,7 @@
#define MADV_SPACEAVAIL 5 /* insure that resources are reserved */
#define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */
#define MADV_VPS_INHERIT 7 /* Inherit parents page size */
+#define MADV_FREE 8 /* free pages only if memory pressure */
/* common/generic parameters */
#define MADV_REMOVE 9 /* remove these pages & resources */
diff --git a/arch/xtensa/include/uapi/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h
index 201aec0..1b19f25 100644
--- a/arch/xtensa/include/uapi/asm/mman.h
+++ b/arch/xtensa/include/uapi/asm/mman.h
@@ -80,6 +80,7 @@
#define MADV_SEQUENTIAL 2 /* expect sequential page references */
#define MADV_WILLNEED 3 /* will need these pages */
#define MADV_DONTNEED 4 /* don't need these pages */
+#define MADV_FREE 5 /* free pages only if memory pressure */
/* common parameters: try to keep these consistent across architectures */
#define MADV_REMOVE 9 /* remove these pages & resources */
--
1.9.3
next reply other threads:[~2014-12-01 20:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-01 20:43 Chen Gang [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-12-01 20:43 [PATCH] arch: uapi: asm: mman.h: Support MADV_FREE for madvise() Chen Gang
2014-12-01 20:52 ` Max Filippov
2014-12-01 21:35 ` Geert Uytterhoeven
2014-12-01 22:01 ` Carlos O'Donell
2014-12-02 1:55 ` James Bottomley
2014-12-02 2:07 ` Chen Gang
2014-12-02 1:56 ` Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547CD2E7.7030100@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chris@zankel.net \
--cc=deller@gmx.de \
--cc=ink@jurassic.park.msu.ru \
--cc=jcmvbkbc@gmail.com \
--cc=jejb@parisc-linux.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=mattst88@gmail.com \
--cc=minchan@kernel.org \
--cc=ralf@linux-mips.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).