diff options
author | Josh Triplett <josh@joshtriplett.org> | 2014-08-17 20:41:09 -0400 |
---|---|---|
committer | Josh Triplett <josh@joshtriplett.org> | 2014-08-17 20:44:24 -0400 |
commit | d3ac21cacc24790eb45d735769f35753f5b56ceb (patch) | |
tree | 7cef2d5f86c0704b50cc163197ca4f6342c45c61 | |
parent | 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff) |
mm: Support compiling out madvise and fadvise
Many embedded systems will not need these syscalls, and omitting them
saves space. Add a new EXPERT config option CONFIG_ADVISE_SYSCALLS
(default y) to support compiling them out.
bloat-o-meter:
add/remove: 0/3 grow/shrink: 0/0 up/down: 0/-2250 (-2250)
function old new delta
sys_fadvise64 57 - -57
sys_fadvise64_64 691 - -691
sys_madvise 1502 - -1502
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
-rw-r--r-- | init/Kconfig | 10 | ||||
-rw-r--r-- | kernel/sys_ni.c | 3 | ||||
-rw-r--r-- | mm/Makefile | 7 |
3 files changed, 18 insertions, 2 deletions
diff --git a/init/Kconfig b/init/Kconfig index e84c6423a2e5..782a65bf76ea 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -1537,6 +1537,16 @@ config AIO | |||
1537 | by some high performance threaded applications. Disabling | 1537 | by some high performance threaded applications. Disabling |
1538 | this option saves about 7k. | 1538 | this option saves about 7k. |
1539 | 1539 | ||
1540 | config ADVISE_SYSCALLS | ||
1541 | bool "Enable madvise/fadvise syscalls" if EXPERT | ||
1542 | default y | ||
1543 | help | ||
1544 | This option enables the madvise and fadvise syscalls, used by | ||
1545 | applications to advise the kernel about their future memory or file | ||
1546 | usage, improving performance. If building an embedded system where no | ||
1547 | applications use these syscalls, you can disable this option to save | ||
1548 | space. | ||
1549 | |||
1540 | config PCI_QUIRKS | 1550 | config PCI_QUIRKS |
1541 | default y | 1551 | default y |
1542 | bool "Enable PCI quirk workarounds" if EXPERT | 1552 | bool "Enable PCI quirk workarounds" if EXPERT |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 391d4ddb6f4b..d4709d481053 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -156,6 +156,9 @@ cond_syscall(sys_process_vm_writev); | |||
156 | cond_syscall(compat_sys_process_vm_readv); | 156 | cond_syscall(compat_sys_process_vm_readv); |
157 | cond_syscall(compat_sys_process_vm_writev); | 157 | cond_syscall(compat_sys_process_vm_writev); |
158 | cond_syscall(sys_uselib); | 158 | cond_syscall(sys_uselib); |
159 | cond_syscall(sys_fadvise64); | ||
160 | cond_syscall(sys_fadvise64_64); | ||
161 | cond_syscall(sys_madvise); | ||
159 | 162 | ||
160 | /* arch-specific weak syscall entries */ | 163 | /* arch-specific weak syscall entries */ |
161 | cond_syscall(sys_pciconfig_read); | 164 | cond_syscall(sys_pciconfig_read); |
diff --git a/mm/Makefile b/mm/Makefile index 632ae77e6070..fe7a053c0f45 100644 --- a/mm/Makefile +++ b/mm/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | mmu-y := nommu.o | 5 | mmu-y := nommu.o |
6 | mmu-$(CONFIG_MMU) := fremap.o gup.o highmem.o madvise.o memory.o mincore.o \ | 6 | mmu-$(CONFIG_MMU) := fremap.o gup.o highmem.o memory.o mincore.o \ |
7 | mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \ | 7 | mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \ |
8 | vmalloc.o pagewalk.o pgtable-generic.o | 8 | vmalloc.o pagewalk.o pgtable-generic.o |
9 | 9 | ||
@@ -11,7 +11,7 @@ ifdef CONFIG_CROSS_MEMORY_ATTACH | |||
11 | mmu-$(CONFIG_MMU) += process_vm_access.o | 11 | mmu-$(CONFIG_MMU) += process_vm_access.o |
12 | endif | 12 | endif |
13 | 13 | ||
14 | obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ | 14 | obj-y := filemap.o mempool.o oom_kill.o \ |
15 | maccess.o page_alloc.o page-writeback.o \ | 15 | maccess.o page_alloc.o page-writeback.o \ |
16 | readahead.o swap.o truncate.o vmscan.o shmem.o \ | 16 | readahead.o swap.o truncate.o vmscan.o shmem.o \ |
17 | util.o mmzone.o vmstat.o backing-dev.o \ | 17 | util.o mmzone.o vmstat.o backing-dev.o \ |
@@ -28,6 +28,9 @@ else | |||
28 | obj-y += bootmem.o | 28 | obj-y += bootmem.o |
29 | endif | 29 | endif |
30 | 30 | ||
31 | ifdef CONFIG_MMU | ||
32 | obj-$(CONFIG_ADVISE_SYSCALLS) += fadvise.o madvise.o | ||
33 | endif | ||
31 | obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o | 34 | obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o |
32 | 35 | ||
33 | obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o | 36 | obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o |