diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-06-05 18:55:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-05 18:55:40 -0700 |
| commit | cefe53f8b4be7dae79c9360678346ce1dfdf9f31 (patch) | |
| tree | 6593269672b21abe388c3cd8391794a9ba4045f9 /include | |
| parent | 1b0a5d8e7af339514d8d1d8aeadb0d50ef4a2e77 (diff) | |
[PATCH] /proc/sys/vm/min_free_kbytes
From: Matthew Dobson <colpatch@us.ibm.com>
This resurrects the old /proc/sys/vm/free_pages functionality: the ability to
tell page reclaim how much free memory to maintain.
This may be needed for specialised networking applications, and it provides
an interesting way to stress the kernel: set it very low so atomic
allocations can easily fail.
Also, a 16G ppc64 box currently cruises along at 1M free memory, which is
surely too little to supporthigh-speed networking. We have not changed that
setting here, but it is now possible to do so.
The patch also reduces the amount of free memory which the VM will maintain
in ZONE_HIGHMEM, as it is almost always wasted memory.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/mmzone.h | 19 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d60c10f0d9e2..21e95664fdf8 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -249,6 +249,25 @@ static inline struct zone *next_zone(struct zone *zone) #define for_each_zone(zone) \ for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone)) +/** + * is_highmem - helper function to quickly check if a struct zone is a + * highmem zone or not. This is an attempt to keep references + * to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum. + * @zone - pointer to struct zone variable + */ +static inline int is_highmem(struct zone *zone) +{ + return (zone - zone->zone_pgdat->node_zones == ZONE_HIGHMEM); +} + +/* These two functions are used to setup the per zone pages min values */ +struct ctl_table; +struct file; +int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, + void *, size_t *); +extern void setup_per_zone_pages_min(void); + + #ifdef CONFIG_NUMA #define MAX_NR_MEMBLKS BITS_PER_LONG /* Max number of Memory Blocks */ #else /* !CONFIG_NUMA */ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index bbd0b376d757..e037c4de0522 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -156,6 +156,7 @@ enum VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */ VM_SWAPPINESS=19, /* Tendency to steal mapped memory */ VM_LOWER_ZONE_PROTECTION=20,/* Amount of protection of lower zones */ + VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */ }; |
