* [patch] mm-cleanup-1 (2.4.0)
@ 2001-01-07 20:36 Zlatko Calusic
2001-01-07 19:07 ` Marcelo Tosatti
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Zlatko Calusic @ 2001-01-07 20:36 UTC (permalink / raw)
To: linux-mm, linux-kernel
The following patch cleans up some obsolete structures from the mm &
proc code.
Beside that it also fixes what I think is a bug:
if ((rw == WRITE) && atomic_read(&nr_async_pages) >
pager_daemon.swap_cluster * (1 << page_cluster))
In that (swapout logic) it effectively says swap out 512KB at once (at
least on my memory configuration). I think that is a little too much.
I modified it to be a little bit more conservative and send only
(1 << page_cluster) to the swap at a time. Same applies to the
swapin_readahead() function. Comments welcome.
Index: 0.2/mm/oom_kill.c
--- 0.2/mm/oom_kill.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/0_oom_kill.c 1.1 644)
+++ 0.6/mm/oom_kill.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/0_oom_kill.c 1.2 644)
@@ -18,7 +18,6 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/timex.h>
/* #define DEBUG */
Index: 0.2/mm/bootmem.c
--- 0.2/mm/bootmem.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/3_bootmem.c 1.1 644)
+++ 0.6/mm/bootmem.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/3_bootmem.c 1.2 644)
@@ -12,7 +12,6 @@
#include <linux/mm.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/bootmem.h>
Index: 0.2/mm/swap_state.c
--- 0.2/mm/swap_state.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/6_swap_state 1.1 644)
+++ 0.6/mm/swap_state.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/6_swap_state 1.2 644)
@@ -10,7 +10,6 @@
#include <linux/mm.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/init.h>
#include <linux/pagemap.h>
#include <linux/smp_lock.h>
Index: 0.2/mm/swapfile.c
--- 0.2/mm/swapfile.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/8_swapfile.c 1.1 644)
+++ 0.6/mm/swapfile.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/8_swapfile.c 1.2 644)
@@ -9,7 +9,6 @@
#include <linux/smp_lock.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/blkdev.h> /* for blk_size */
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
Index: 0.2/mm/vmscan.c
--- 0.2/mm/vmscan.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/9_vmscan.c 1.1 644)
+++ 0.6/mm/vmscan.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/9_vmscan.c 1.2 644)
@@ -15,7 +15,6 @@
#include <linux/slab.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/smp_lock.h>
#include <linux/pagemap.h>
#include <linux/init.h>
Index: 0.2/mm/page_io.c
--- 0.2/mm/page_io.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/10_page_io.c 1.1 644)
+++ 0.6/mm/page_io.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/10_page_io.c 1.3 644)
@@ -14,7 +14,6 @@
#include <linux/kernel_stat.h>
#include <linux/swap.h>
#include <linux/locks.h>
-#include <linux/swapctl.h>
#include <asm/pgtable.h>
@@ -44,7 +43,7 @@
/* Don't allow too many pending pages in flight.. */
if ((rw == WRITE) && atomic_read(&nr_async_pages) >
- pager_daemon.swap_cluster * (1 << page_cluster))
+ (1 << page_cluster))
wait = 1;
if (rw == READ) {
Index: 0.2/mm/filemap.c
--- 0.2/mm/filemap.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/12_filemap.c 1.1 644)
+++ 0.6/mm/filemap.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/12_filemap.c 1.2 644)
@@ -18,7 +18,6 @@
#include <linux/smp_lock.h>
#include <linux/blkdev.h>
#include <linux/file.h>
-#include <linux/swapctl.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/mm.h>
Index: 0.2/mm/page_alloc.c
--- 0.2/mm/page_alloc.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/14_page_alloc 1.1 644)
+++ 0.6/mm/page_alloc.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/14_page_alloc 1.2 644)
@@ -12,7 +12,6 @@
#include <linux/config.h>
#include <linux/mm.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/interrupt.h>
#include <linux/pagemap.h>
#include <linux/bootmem.h>
Index: 0.2/mm/mmap.c
--- 0.2/mm/mmap.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/16_mmap.c 1.1 644)
+++ 0.6/mm/mmap.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/16_mmap.c 1.2 644)
@@ -8,7 +8,6 @@
#include <linux/mman.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/file.h>
Index: 0.2/mm/swap.c
--- 0.2/mm/swap.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/17_swap.c 1.1 644)
+++ 0.6/mm/swap.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/17_swap.c 1.4 644)
@@ -10,13 +10,11 @@
* linux/Documentation/sysctl/vm.txt.
* Started 18.12.91
* Swap aging added 23.2.95, Stephen Tweedie.
- * Buffermem limits added 12.3.98, Rik van Riel.
*/
#include <linux/mm.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/pagemap.h>
#include <linux/init.h>
@@ -42,6 +40,10 @@
/* How many pages do we try to swap or page in/out together? */
int page_cluster;
+/* We track the number of pages currently being asynchronously swapped
+ out, so that we don't try to swap TOO many pages out at once */
+atomic_t nr_async_pages = ATOMIC_INIT(0);
+
/*
* This variable contains the amount of page steals the system
* is doing, averaged over a minute. We use this to determine how
@@ -52,28 +54,6 @@
* In recalculate_vm_stats the value is decayed (once a second)
*/
int memory_pressure;
-
-/* We track the number of pages currently being asynchronously swapped
- out, so that we don't try to swap TOO many pages out at once */
-atomic_t nr_async_pages = ATOMIC_INIT(0);
-
-buffer_mem_t buffer_mem = {
- 2, /* minimum percent buffer */
- 10, /* borrow percent buffer */
- 60 /* maximum percent buffer */
-};
-
-buffer_mem_t page_cache = {
- 2, /* minimum percent page cache */
- 15, /* borrow percent page cache */
- 75 /* maximum */
-};
-
-pager_daemon_t pager_daemon = {
- 512, /* base number for calculating the number of tries */
- SWAP_CLUSTER_MAX, /* minimum number of tries */
- 8, /* do swap I/O in clusters of this size */
-};
/**
* age_page_{up,down} - page aging helper functions
Index: 0.2/mm/memory.c
--- 0.2/mm/memory.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/18_memory.c 1.1 644)
+++ 0.6/mm/memory.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/18_memory.c 1.3 644)
@@ -40,7 +40,6 @@
#include <linux/mman.h>
#include <linux/swap.h>
#include <linux/smp_lock.h>
-#include <linux/swapctl.h>
#include <linux/iobuf.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
@@ -1000,8 +999,7 @@
num = valid_swaphandles(entry, &offset);
for (i = 0; i < num; offset++, i++) {
/* Don't block on I/O for read-ahead */
- if (atomic_read(&nr_async_pages) >= pager_daemon.swap_cluster
- * (1 << page_cluster)) {
+ if (atomic_read(&nr_async_pages) >= (1 << page_cluster)) {
while (i++ < num)
swap_free(SWP_ENTRY(SWP_TYPE(entry), offset++));
break;
Index: 0.2/kernel/sysctl.c
--- 0.2/kernel/sysctl.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/38_sysctl.c 1.1 644)
+++ 0.6/kernel/sysctl.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/38_sysctl.c 1.1.1.3 644)
@@ -20,8 +20,8 @@
#include <linux/config.h>
#include <linux/malloc.h>
+#include <linux/swap.h>
#include <linux/sysctl.h>
-#include <linux/swapctl.h>
#include <linux/proc_fs.h>
#include <linux/ctype.h>
#include <linux/utsname.h>
@@ -241,18 +241,12 @@
static ctl_table vm_table[] = {
{VM_FREEPG, "freepages",
- &freepages, sizeof(freepages_t), 0444, NULL, &proc_dointvec},
+ &freepages, 3*sizeof(int), 0444, NULL, &proc_dointvec},
{VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0644, NULL,
&proc_dointvec_minmax, &sysctl_intvec, NULL,
&bdflush_min, &bdflush_max},
{VM_OVERCOMMIT_MEMORY, "overcommit_memory", &sysctl_overcommit_memory,
sizeof(sysctl_overcommit_memory), 0644, NULL, &proc_dointvec},
- {VM_BUFFERMEM, "buffermem",
- &buffer_mem, sizeof(buffer_mem_t), 0644, NULL, &proc_dointvec},
- {VM_PAGECACHE, "pagecache",
- &page_cache, sizeof(buffer_mem_t), 0644, NULL, &proc_dointvec},
- {VM_PAGERDAEMON, "kswapd",
- &pager_daemon, sizeof(pager_daemon_t), 0644, NULL, &proc_dointvec},
{VM_PGT_CACHE, "pagetable_cache",
&pgt_cache_water, 2*sizeof(int), 0644, NULL, &proc_dointvec},
{VM_PAGE_CLUSTER, "page-cluster",
Index: 0.2/include/linux/swap.h
--- 0.2/include/linux/swap.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/d/b/26_swap.h 1.1 644)
+++ 0.6/include/linux/swap.h Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/d/b/26_swap.h 1.2 644)
@@ -63,6 +63,15 @@
int next; /* next entry on swap list */
};
+typedef struct freepages_v1
+{
+ unsigned int min;
+ unsigned int low;
+ unsigned int high;
+} freepages_v1;
+typedef freepages_v1 freepages_t;
+extern freepages_t freepages;
+
extern int nr_swap_pages;
FASTCALL(unsigned int nr_free_pages(void));
FASTCALL(unsigned int nr_inactive_clean_pages(void));
@@ -80,7 +89,6 @@
struct task_struct;
struct vm_area_struct;
struct sysinfo;
-
struct zone_t;
/* linux/mm/swap.c */
Index: 0.2/include/linux/sysctl.h
--- 0.2/include/linux/sysctl.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/e/b/38_sysctl.h 1.1 644)
+++ 0.6/include/linux/sysctl.h Sun, 07 Jan 2001 19:16:44 +0100 zcalusic (linux24/e/b/38_sysctl.h 1.1.1.2 644)
@@ -128,9 +128,9 @@
VM_FREEPG=3, /* struct: Set free page thresholds */
VM_BDFLUSH=4, /* struct: Control buffer cache flushing */
VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
- VM_BUFFERMEM=6, /* struct: Set buffer memory thresholds */
- VM_PAGECACHE=7, /* struct: Set cache memory thresholds */
- VM_PAGERDAEMON=8, /* struct: Control kswapd behaviour */
+/* was VM_BUFFERMEM */
+/* was VM_PAGECACHE */
+/* was VM_PAGERDAEMON */
VM_PGT_CACHE=9, /* struct: Set page table cache parameters */
VM_PAGE_CLUSTER=10 /* int: set number of pages to swap together */
};
Index: 0.2/include/linux/mm.h
--- 0.2/include/linux/mm.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/g/b/6_mm.h 1.1 644)
+++ 0.6/include/linux/mm.h Sun, 07 Jan 2001 18:42:20 +0100 zcalusic (linux24/g/b/6_mm.h 1.2 644)
@@ -521,11 +521,6 @@
extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr);
-#define buffer_under_min() (atomic_read(&buffermem_pages) * 100 < \
- buffer_mem.min_percent * num_physpages)
-#define pgcache_under_min() (atomic_read(&page_cache_size) * 100 < \
- page_cache.min_percent * num_physpages)
-
#endif /* __KERNEL__ */
#endif
Index: 0.2/fs/coda/sysctl.c
--- 0.2/fs/coda/sysctl.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/b/38_sysctl.c 1.1 644)
+++ 0.6/fs/coda/sysctl.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/b/38_sysctl.c 1.2 644)
@@ -15,7 +15,6 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/sysctl.h>
-#include <linux/swapctl.h>
#include <linux/proc_fs.h>
#include <linux/malloc.h>
#include <linux/stat.h>
Index: 0.2/fs/buffer.c
--- 0.2/fs/buffer.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/p/b/15_buffer.c 1.1 644)
+++ 0.6/fs/buffer.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/p/b/15_buffer.c 1.2 644)
@@ -35,7 +35,6 @@
#include <linux/locks.h>
#include <linux/errno.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/smp_lock.h>
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
Index: 0.2/arch/mips64/mm/init.c
--- 0.2/arch/mips64/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/o/c/30_init.c 1.1 644)
+++ 0.6/arch/mips64/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/o/c/30_init.c 1.2 644)
@@ -22,7 +22,6 @@
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h>
#endif
Index: 0.2/arch/arm/mm/init.c
--- 0.2/arch/arm/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/v/c/33_init.c 1.1 644)
+++ 0.6/arch/arm/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/v/c/33_init.c 1.2 644)
@@ -18,7 +18,6 @@
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/bootmem.h>
Index: 0.2/arch/sparc64/mm/init.c
--- 0.2/arch/sparc64/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/y/c/18_init.c 1.1 644)
+++ 0.6/arch/sparc64/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/y/c/18_init.c 1.2 644)
@@ -15,7 +15,6 @@
#include <linux/malloc.h>
#include <linux/blk.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#include <asm/head.h>
#include <asm/system.h>
Index: 0.2/arch/mips/mm/init.c
--- 0.2/arch/mips/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/M/c/40_init.c 1.1 644)
+++ 0.6/arch/mips/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/M/c/40_init.c 1.2 644)
@@ -22,7 +22,6 @@
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h>
#endif
Index: 0.2/arch/sparc/mm/init.c
--- 0.2/arch/sparc/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/N/c/32_init.c 1.1 644)
+++ 0.6/arch/sparc/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/N/c/32_init.c 1.2 644)
@@ -18,7 +18,6 @@
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/swap.h>
-#include <linux/swapctl.h>
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h>
#endif
Index: 0.6/include/linux/swapctl.h
--- 0.2/include/linux/swapctl.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/c/b/36_swapctl.h 1.1 644)
+++ 0.6/include/linux/swapctl.h Sun, 07 Jan 2001 21:30:32 +0100 zcalusic ()
@@ -1,35 +0,0 @@
-#ifndef _LINUX_SWAPCTL_H
-#define _LINUX_SWAPCTL_H
-
-#include <asm/page.h>
-#include <linux/fs.h>
-
-typedef struct buffer_mem_v1
-{
- unsigned int min_percent;
- unsigned int borrow_percent;
- unsigned int max_percent;
-} buffer_mem_v1;
-typedef buffer_mem_v1 buffer_mem_t;
-extern buffer_mem_t buffer_mem;
-extern buffer_mem_t page_cache;
-
-typedef struct freepages_v1
-{
- unsigned int min;
- unsigned int low;
- unsigned int high;
-} freepages_v1;
-typedef freepages_v1 freepages_t;
-extern freepages_t freepages;
-
-typedef struct pager_daemon_v1
-{
- unsigned int tries_base;
- unsigned int tries_min;
- unsigned int swap_cluster;
-} pager_daemon_v1;
-typedef pager_daemon_v1 pager_daemon_t;
-extern pager_daemon_t pager_daemon;
-
-#endif /* _LINUX_SWAPCTL_H */
--
Zlatko
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 20:36 [patch] mm-cleanup-1 (2.4.0) Zlatko Calusic @ 2001-01-07 19:07 ` Marcelo Tosatti 2001-01-07 21:11 ` Zlatko Calusic 2001-01-07 21:16 ` Rik van Riel 2001-01-09 0:59 ` [patch] mm-cleanup-2 (2.4.0) Zlatko Calusic 2 siblings, 1 reply; 9+ messages in thread From: Marcelo Tosatti @ 2001-01-07 19:07 UTC (permalink / raw) To: Zlatko Calusic; +Cc: linux-mm, linux-kernel On 7 Jan 2001, Zlatko Calusic wrote: > The following patch cleans up some obsolete structures from the mm & > proc code. > > Beside that it also fixes what I think is a bug: > > if ((rw == WRITE) && atomic_read(&nr_async_pages) > > pager_daemon.swap_cluster * (1 << page_cluster)) > > In that (swapout logic) it effectively says swap out 512KB at once (at > least on my memory configuration). I think that is a little too much. > I modified it to be a little bit more conservative and send only > (1 << page_cluster) to the swap at a time. Same applies to the > swapin_readahead() function. Comments welcome. 512kb is the maximum limit for in-flight swap pages, not the cluster size for IO. swapin_readahead actually sends requests of (1 << page_cluster) to disk at each run. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 19:07 ` Marcelo Tosatti @ 2001-01-07 21:11 ` Zlatko Calusic 2001-01-07 21:18 ` Rik van Riel 2001-01-07 21:21 ` davej 0 siblings, 2 replies; 9+ messages in thread From: Zlatko Calusic @ 2001-01-07 21:11 UTC (permalink / raw) To: Marcelo Tosatti; +Cc: linux-mm, linux-kernel Marcelo Tosatti <marcelo@conectiva.com.br> writes: > On 7 Jan 2001, Zlatko Calusic wrote: > > > The following patch cleans up some obsolete structures from the mm & > > proc code. > > > > Beside that it also fixes what I think is a bug: > > > > if ((rw == WRITE) && atomic_read(&nr_async_pages) > > > pager_daemon.swap_cluster * (1 << page_cluster)) > > > > In that (swapout logic) it effectively says swap out 512KB at once (at > > least on my memory configuration). I think that is a little too much. > > I modified it to be a little bit more conservative and send only > > (1 << page_cluster) to the swap at a time. Same applies to the > > swapin_readahead() function. Comments welcome. > > 512kb is the maximum limit for in-flight swap pages, not the cluster size > for IO. > > swapin_readahead actually sends requests of (1 << page_cluster) to disk > at each run. > OK, maybe I was too fast in concluding with that change. I'm still trying to find out why is MM working bad in some circumstances (see my other email to the list). Anyway, I would than suggest to introduce another /proc entry and call it appropriately: max_async_pages. Because that is what we care about, anyway. I'll send another patch. -- Zlatko -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 21:11 ` Zlatko Calusic @ 2001-01-07 21:18 ` Rik van Riel 2001-01-07 22:23 ` Zlatko Calusic 2001-01-07 21:21 ` davej 1 sibling, 1 reply; 9+ messages in thread From: Rik van Riel @ 2001-01-07 21:18 UTC (permalink / raw) To: Zlatko Calusic; +Cc: Marcelo Tosatti, linux-mm, linux-kernel On 7 Jan 2001, Zlatko Calusic wrote: > OK, maybe I was too fast in concluding with that change. I'm > still trying to find out why is MM working bad in some > circumstances (see my other email to the list). > > Anyway, I would than suggest to introduce another /proc entry > and call it appropriately: max_async_pages. Because that is what > we care about, anyway. I'll send another patch. In fact, that's NOT what we care about. What we really care about is the number of disk seeks the VM subsystem has queued to disk, since it's seek time that causes other requests to suffer bad latency. regards, Rik -- Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose... http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 21:18 ` Rik van Riel @ 2001-01-07 22:23 ` Zlatko Calusic 0 siblings, 0 replies; 9+ messages in thread From: Zlatko Calusic @ 2001-01-07 22:23 UTC (permalink / raw) To: Rik van Riel; +Cc: Marcelo Tosatti, linux-mm, linux-kernel Rik van Riel <riel@conectiva.com.br> writes: > On 7 Jan 2001, Zlatko Calusic wrote: > > > OK, maybe I was too fast in concluding with that change. I'm > > still trying to find out why is MM working bad in some > > circumstances (see my other email to the list). > > > > Anyway, I would than suggest to introduce another /proc entry > > and call it appropriately: max_async_pages. Because that is what > > we care about, anyway. I'll send another patch. > > In fact, that's NOT what we care about. > > What we really care about is the number of disk seeks > the VM subsystem has queued to disk, since it's seek > time that causes other requests to suffer bad latency. > Yes, but that's not what we have in the code now. I'm just trying to make it little easier for the end user to tune his system. Right now things are quite complicated and misleading for the uninitiated. If we are to optimize things better in the future, then be it, but I would like first to clean some historical cruft. I'm a quite pedantical guy, you know. :) -- Zlatko -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 21:11 ` Zlatko Calusic 2001-01-07 21:18 ` Rik van Riel @ 2001-01-07 21:21 ` davej 1 sibling, 0 replies; 9+ messages in thread From: davej @ 2001-01-07 21:21 UTC (permalink / raw) To: Zlatko Calusic; +Cc: Marcelo Tosatti, linux-mm, Linux Kernel Mailing List On 7 Jan 2001, Zlatko Calusic wrote: > Anyway, I would than suggest to introduce another /proc entry and call > it appropriately: max_async_pages. Because that is what we care about, > anyway. I'll send another patch. Anton Blanchard already did a patch for this. Sent to the list on Thu, 7 Dec 2000 16:15:54 +1100 subject: [PATCH]: sysctl to tune async and sync bdflush triggers I don't recall seeing any responses to that patch, but it seems to do exactly what you describe. regards, Davej. -- | Dave Jones. http://www.suse.de/~davej | SuSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 20:36 [patch] mm-cleanup-1 (2.4.0) Zlatko Calusic 2001-01-07 19:07 ` Marcelo Tosatti @ 2001-01-07 21:16 ` Rik van Riel 2001-01-07 22:20 ` Zlatko Calusic 2001-01-09 0:59 ` [patch] mm-cleanup-2 (2.4.0) Zlatko Calusic 2 siblings, 1 reply; 9+ messages in thread From: Rik van Riel @ 2001-01-07 21:16 UTC (permalink / raw) To: Zlatko Calusic; +Cc: linux-mm, linux-kernel On 7 Jan 2001, Zlatko Calusic wrote: > The following patch cleans up some obsolete structures from the > mm & proc code. > > Beside that it also fixes what I think is a bug: > > if ((rw == WRITE) && atomic_read(&nr_async_pages) > > pager_daemon.swap_cluster * (1 << page_cluster)) > > In that (swapout logic) it effectively says swap out 512KB at > once (at least on my memory configuration). I think that is a > little too much. Since we submit a whole cluster of (1 << page_cluster) size at once, your change would mean that the VM can only do one IO at a time... Have you actually measured your changes or is it just a gut feeling that the current default is too much? (I can agree with 1/2 MB being a bit much, but doing just one IO at a time is probably wrong too...) The cleanup part of your patch is nice. I think that one should be submitted as soon as the 2.4 bugfix period is over ... (and yes, I'm not submitting any of my own trivial patches either unless they're REALLY needed, lets make sure Linus has enough time to focus on the real bugfixes) regards, Rik -- Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose... http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] mm-cleanup-1 (2.4.0) 2001-01-07 21:16 ` Rik van Riel @ 2001-01-07 22:20 ` Zlatko Calusic 0 siblings, 0 replies; 9+ messages in thread From: Zlatko Calusic @ 2001-01-07 22:20 UTC (permalink / raw) To: Rik van Riel; +Cc: linux-mm, linux-kernel Rik van Riel <riel@conectiva.com.br> writes: > On 7 Jan 2001, Zlatko Calusic wrote: > > > The following patch cleans up some obsolete structures from the > > mm & proc code. > > > > Beside that it also fixes what I think is a bug: > > > > if ((rw == WRITE) && atomic_read(&nr_async_pages) > > > pager_daemon.swap_cluster * (1 << page_cluster)) > > > > In that (swapout logic) it effectively says swap out 512KB at > > once (at least on my memory configuration). I think that is a > > little too much. > > Since we submit a whole cluster of (1 << page_cluster) > size at once, your change would mean that the VM can > only do one IO at a time... > > Have you actually measured your changes or is it just > a gut feeling that the current default is too much? > Well, to be honest I didn't find any change after the modification. :) But, anyway, Marcelo explained to me what's going on and I have already agreed there is no need to change that. Instead I'll modify my patch to introduce new /proc entry with meaningful name: max_async_pages. > (I can agree with 1/2 MB being a bit much, but doing > just one IO at a time is probably wrong too...) > I can only add that I share your opinion. :) > > The cleanup part of your patch is nice. I think that > one should be submitted as soon as the 2.4 bugfix > period is over ... > Right. > (and yes, I'm not submitting any of my own trivial > patches either unless they're REALLY needed, lets make > sure Linus has enough time to focus on the real bugfixes) > I'll check your new patch as soon as I have investigated few more things and got a little more acquainted with the mm code in the 2.4.0. It's a pity I found some free time this late, but then again I see myself much more involved with the mm code in the future. It's just that I'll need some help in the start thus so much questions on the lists. :) -- Zlatko -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* [patch] mm-cleanup-2 (2.4.0) 2001-01-07 20:36 [patch] mm-cleanup-1 (2.4.0) Zlatko Calusic 2001-01-07 19:07 ` Marcelo Tosatti 2001-01-07 21:16 ` Rik van Riel @ 2001-01-09 0:59 ` Zlatko Calusic 2 siblings, 0 replies; 9+ messages in thread From: Zlatko Calusic @ 2001-01-09 0:59 UTC (permalink / raw) To: linux-mm; +Cc: linux-kernel OK, take two. This patch: o removes obsolete /proc entryes and other mm structures not used anymore. o adds new /proc/sys/vm/max-async-pages o updates documentation As the patch doesn't change any kernel vital functionality it is completely safe. I don't know if it satisfies Linus' patch submitting guidelines. So sent only to the lists to be on the safe side. :) Index: 0.2/mm/oom_kill.c --- 0.2/mm/oom_kill.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/0_oom_kill.c 1.1 644) +++ 0.10/mm/oom_kill.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/0_oom_kill.c 1.2 644) @@ -18,7 +18,6 @@ #include <linux/mm.h> #include <linux/sched.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/timex.h> /* #define DEBUG */ Index: 0.2/mm/bootmem.c --- 0.2/mm/bootmem.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/3_bootmem.c 1.1 644) +++ 0.10/mm/bootmem.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/3_bootmem.c 1.2 644) @@ -12,7 +12,6 @@ #include <linux/mm.h> #include <linux/kernel_stat.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/interrupt.h> #include <linux/init.h> #include <linux/bootmem.h> Index: 0.2/mm/swap_state.c --- 0.2/mm/swap_state.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/6_swap_state 1.1 644) +++ 0.10/mm/swap_state.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/6_swap_state 1.2 644) @@ -10,7 +10,6 @@ #include <linux/mm.h> #include <linux/kernel_stat.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/init.h> #include <linux/pagemap.h> #include <linux/smp_lock.h> Index: 0.2/mm/swapfile.c --- 0.2/mm/swapfile.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/8_swapfile.c 1.1 644) +++ 0.10/mm/swapfile.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/8_swapfile.c 1.2 644) @@ -9,7 +9,6 @@ #include <linux/smp_lock.h> #include <linux/kernel_stat.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/blkdev.h> /* for blk_size */ #include <linux/vmalloc.h> #include <linux/pagemap.h> Index: 0.2/mm/vmscan.c --- 0.2/mm/vmscan.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/9_vmscan.c 1.1 644) +++ 0.10/mm/vmscan.c Tue, 09 Jan 2001 01:39:38 +0100 zcalusic (linux24/j/9_vmscan.c 1.4 644) @@ -15,7 +15,6 @@ #include <linux/slab.h> #include <linux/kernel_stat.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/smp_lock.h> #include <linux/pagemap.h> #include <linux/init.h> Index: 0.2/mm/page_io.c --- 0.2/mm/page_io.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/10_page_io.c 1.1 644) +++ 0.10/mm/page_io.c Tue, 09 Jan 2001 01:31:18 +0100 zcalusic (linux24/j/10_page_io.c 1.4 644) @@ -14,7 +14,6 @@ #include <linux/kernel_stat.h> #include <linux/swap.h> #include <linux/locks.h> -#include <linux/swapctl.h> #include <asm/pgtable.h> @@ -43,8 +42,7 @@ struct inode *swapf = 0; /* Don't allow too many pending pages in flight.. */ - if ((rw == WRITE) && atomic_read(&nr_async_pages) > - pager_daemon.swap_cluster * (1 << page_cluster)) + if ((rw == WRITE) && atomic_read(&nr_async_pages) > max_async_pages) wait = 1; if (rw == READ) { Index: 0.2/mm/filemap.c --- 0.2/mm/filemap.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/12_filemap.c 1.1 644) +++ 0.10/mm/filemap.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/12_filemap.c 1.2 644) @@ -18,7 +18,6 @@ #include <linux/smp_lock.h> #include <linux/blkdev.h> #include <linux/file.h> -#include <linux/swapctl.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/mm.h> Index: 0.2/mm/page_alloc.c --- 0.2/mm/page_alloc.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/14_page_alloc 1.1 644) +++ 0.10/mm/page_alloc.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/14_page_alloc 1.2 644) @@ -12,7 +12,6 @@ #include <linux/config.h> #include <linux/mm.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/interrupt.h> #include <linux/pagemap.h> #include <linux/bootmem.h> Index: 0.2/mm/mmap.c --- 0.2/mm/mmap.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/16_mmap.c 1.1 644) +++ 0.10/mm/mmap.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/16_mmap.c 1.2 644) @@ -8,7 +8,6 @@ #include <linux/mman.h> #include <linux/pagemap.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/smp_lock.h> #include <linux/init.h> #include <linux/file.h> Index: 0.2/mm/swap.c --- 0.2/mm/swap.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/17_swap.c 1.1 644) +++ 0.10/mm/swap.c Tue, 09 Jan 2001 01:31:18 +0100 zcalusic (linux24/j/17_swap.c 1.5 644) @@ -10,13 +10,11 @@ * linux/Documentation/sysctl/vm.txt. * Started 18.12.91 * Swap aging added 23.2.95, Stephen Tweedie. - * Buffermem limits added 12.3.98, Rik van Riel. */ #include <linux/mm.h> #include <linux/kernel_stat.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/pagemap.h> #include <linux/init.h> @@ -42,6 +40,13 @@ /* How many pages do we try to swap or page in/out together? */ int page_cluster; +/* Maximum number of swap pages in flight */ +int max_async_pages; + +/* We track the number of pages currently being asynchronously swapped + out, so that we don't try to swap TOO many pages out at once */ +atomic_t nr_async_pages = ATOMIC_INIT(0); + /* * This variable contains the amount of page steals the system * is doing, averaged over a minute. We use this to determine how @@ -53,28 +58,6 @@ */ int memory_pressure; -/* We track the number of pages currently being asynchronously swapped - out, so that we don't try to swap TOO many pages out at once */ -atomic_t nr_async_pages = ATOMIC_INIT(0); - -buffer_mem_t buffer_mem = { - 2, /* minimum percent buffer */ - 10, /* borrow percent buffer */ - 60 /* maximum percent buffer */ -}; - -buffer_mem_t page_cache = { - 2, /* minimum percent page cache */ - 15, /* borrow percent page cache */ - 75 /* maximum */ -}; - -pager_daemon_t pager_daemon = { - 512, /* base number for calculating the number of tries */ - SWAP_CLUSTER_MAX, /* minimum number of tries */ - 8, /* do swap I/O in clusters of this size */ -}; - /** * age_page_{up,down} - page aging helper functions * @page - the page we want to age @@ -302,4 +285,6 @@ page_cluster = 3; else page_cluster = 4; + + max_async_pages = 1 << (page_cluster + 3); } Index: 0.2/mm/memory.c --- 0.2/mm/memory.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/18_memory.c 1.1 644) +++ 0.10/mm/memory.c Tue, 09 Jan 2001 01:31:18 +0100 zcalusic (linux24/j/18_memory.c 1.4 644) @@ -40,7 +40,6 @@ #include <linux/mman.h> #include <linux/swap.h> #include <linux/smp_lock.h> -#include <linux/swapctl.h> #include <linux/iobuf.h> #include <asm/uaccess.h> #include <asm/pgalloc.h> @@ -1000,8 +999,7 @@ num = valid_swaphandles(entry, &offset); for (i = 0; i < num; offset++, i++) { /* Don't block on I/O for read-ahead */ - if (atomic_read(&nr_async_pages) >= pager_daemon.swap_cluster - * (1 << page_cluster)) { + if (atomic_read(&nr_async_pages) >= max_async_pages) { while (i++ < num) swap_free(SWP_ENTRY(SWP_TYPE(entry), offset++)); break; Index: 0.2/kernel/sysctl.c --- 0.2/kernel/sysctl.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/38_sysctl.c 1.1 644) +++ 0.10/kernel/sysctl.c Tue, 09 Jan 2001 01:31:18 +0100 zcalusic (linux24/j/38_sysctl.c 1.1.1.4 644) @@ -20,8 +20,8 @@ #include <linux/config.h> #include <linux/malloc.h> +#include <linux/swap.h> #include <linux/sysctl.h> -#include <linux/swapctl.h> #include <linux/proc_fs.h> #include <linux/ctype.h> #include <linux/utsname.h> @@ -241,22 +241,18 @@ static ctl_table vm_table[] = { {VM_FREEPG, "freepages", - &freepages, sizeof(freepages_t), 0444, NULL, &proc_dointvec}, + &freepages, 3*sizeof(int), 0444, NULL, &proc_dointvec}, {VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &bdflush_min, &bdflush_max}, {VM_OVERCOMMIT_MEMORY, "overcommit_memory", &sysctl_overcommit_memory, sizeof(sysctl_overcommit_memory), 0644, NULL, &proc_dointvec}, - {VM_BUFFERMEM, "buffermem", - &buffer_mem, sizeof(buffer_mem_t), 0644, NULL, &proc_dointvec}, - {VM_PAGECACHE, "pagecache", - &page_cache, sizeof(buffer_mem_t), 0644, NULL, &proc_dointvec}, - {VM_PAGERDAEMON, "kswapd", - &pager_daemon, sizeof(pager_daemon_t), 0644, NULL, &proc_dointvec}, {VM_PGT_CACHE, "pagetable_cache", &pgt_cache_water, 2*sizeof(int), 0644, NULL, &proc_dointvec}, {VM_PAGE_CLUSTER, "page-cluster", &page_cluster, sizeof(int), 0644, NULL, &proc_dointvec}, + {VM_MAX_ASYNC_PAGES, "max-async-pages", + &max_async_pages, sizeof(int), 0644, NULL, &proc_dointvec}, {0} }; Index: 0.2/include/linux/swap.h --- 0.2/include/linux/swap.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/d/b/26_swap.h 1.1 644) +++ 0.10/include/linux/swap.h Tue, 09 Jan 2001 01:33:49 +0100 zcalusic (linux24/d/b/26_swap.h 1.4 644) @@ -41,8 +41,6 @@ #define SWP_USED 1 #define SWP_WRITEOK 3 -#define SWAP_CLUSTER_MAX 32 - #define SWAP_MAP_MAX 0x7fff #define SWAP_MAP_BAD 0x8000 @@ -63,6 +61,15 @@ int next; /* next entry on swap list */ }; +typedef struct freepages_v1 +{ + unsigned int min; + unsigned int low; + unsigned int high; +} freepages_v1; +typedef freepages_v1 freepages_t; +extern freepages_t freepages; + extern int nr_swap_pages; FASTCALL(unsigned int nr_free_pages(void)); FASTCALL(unsigned int nr_inactive_clean_pages(void)); @@ -70,6 +77,7 @@ extern int nr_active_pages; extern int nr_inactive_dirty_pages; extern atomic_t nr_async_pages; +extern int max_async_pages; extern struct address_space swapper_space; extern atomic_t page_cache_size; extern atomic_t buffermem_pages; @@ -80,7 +88,6 @@ struct task_struct; struct vm_area_struct; struct sysinfo; - struct zone_t; /* linux/mm/swap.c */ Index: 0.2/include/linux/sysctl.h --- 0.2/include/linux/sysctl.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/e/b/38_sysctl.h 1.1 644) +++ 0.10/include/linux/sysctl.h Tue, 09 Jan 2001 01:31:18 +0100 zcalusic (linux24/e/b/38_sysctl.h 1.1.1.3 644) @@ -128,11 +128,12 @@ VM_FREEPG=3, /* struct: Set free page thresholds */ VM_BDFLUSH=4, /* struct: Control buffer cache flushing */ VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */ - VM_BUFFERMEM=6, /* struct: Set buffer memory thresholds */ - VM_PAGECACHE=7, /* struct: Set cache memory thresholds */ - VM_PAGERDAEMON=8, /* struct: Control kswapd behaviour */ +/* was VM_BUFFERMEM */ +/* was VM_PAGECACHE */ +/* was VM_PAGERDAEMON */ VM_PGT_CACHE=9, /* struct: Set page table cache parameters */ - VM_PAGE_CLUSTER=10 /* int: set number of pages to swap together */ + VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */ + VM_MAX_ASYNC_PAGES=11 /* int: max number of swap pages in flight */ }; Index: 0.2/include/linux/mm.h --- 0.2/include/linux/mm.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/g/b/6_mm.h 1.1 644) +++ 0.10/include/linux/mm.h Sun, 07 Jan 2001 18:42:20 +0100 zcalusic (linux24/g/b/6_mm.h 1.2 644) @@ -521,11 +521,6 @@ extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); -#define buffer_under_min() (atomic_read(&buffermem_pages) * 100 < \ - buffer_mem.min_percent * num_physpages) -#define pgcache_under_min() (atomic_read(&page_cache_size) * 100 < \ - page_cache.min_percent * num_physpages) - #endif /* __KERNEL__ */ #endif Index: 0.2/fs/coda/sysctl.c --- 0.2/fs/coda/sysctl.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/j/b/38_sysctl.c 1.1 644) +++ 0.10/fs/coda/sysctl.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/j/b/38_sysctl.c 1.2 644) @@ -15,7 +15,6 @@ #include <linux/sched.h> #include <linux/mm.h> #include <linux/sysctl.h> -#include <linux/swapctl.h> #include <linux/proc_fs.h> #include <linux/malloc.h> #include <linux/stat.h> Index: 0.2/fs/buffer.c --- 0.2/fs/buffer.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/p/b/15_buffer.c 1.1 644) +++ 0.10/fs/buffer.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/p/b/15_buffer.c 1.2 644) @@ -35,7 +35,6 @@ #include <linux/locks.h> #include <linux/errno.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/smp_lock.h> #include <linux/vmalloc.h> #include <linux/blkdev.h> Index: 0.2/arch/mips64/mm/init.c --- 0.2/arch/mips64/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/o/c/30_init.c 1.1 644) +++ 0.10/arch/mips64/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/o/c/30_init.c 1.2 644) @@ -22,7 +22,6 @@ #include <linux/bootmem.h> #include <linux/highmem.h> #include <linux/swap.h> -#include <linux/swapctl.h> #ifdef CONFIG_BLK_DEV_INITRD #include <linux/blk.h> #endif Index: 0.2/arch/arm/mm/init.c --- 0.2/arch/arm/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/v/c/33_init.c 1.1 644) +++ 0.10/arch/arm/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/v/c/33_init.c 1.2 644) @@ -18,7 +18,6 @@ #include <linux/mman.h> #include <linux/mm.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <linux/smp.h> #include <linux/init.h> #include <linux/bootmem.h> Index: 0.2/arch/sparc64/mm/init.c --- 0.2/arch/sparc64/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/y/c/18_init.c 1.1 644) +++ 0.10/arch/sparc64/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/y/c/18_init.c 1.2 644) @@ -15,7 +15,6 @@ #include <linux/malloc.h> #include <linux/blk.h> #include <linux/swap.h> -#include <linux/swapctl.h> #include <asm/head.h> #include <asm/system.h> Index: 0.2/arch/mips/mm/init.c --- 0.2/arch/mips/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/M/c/40_init.c 1.1 644) +++ 0.10/arch/mips/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/M/c/40_init.c 1.2 644) @@ -22,7 +22,6 @@ #include <linux/bootmem.h> #include <linux/highmem.h> #include <linux/swap.h> -#include <linux/swapctl.h> #ifdef CONFIG_BLK_DEV_INITRD #include <linux/blk.h> #endif Index: 0.2/arch/sparc/mm/init.c --- 0.2/arch/sparc/mm/init.c Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/N/c/32_init.c 1.1 644) +++ 0.10/arch/sparc/mm/init.c Sun, 07 Jan 2001 20:17:13 +0100 zcalusic (linux24/N/c/32_init.c 1.2 644) @@ -18,7 +18,6 @@ #include <linux/mman.h> #include <linux/mm.h> #include <linux/swap.h> -#include <linux/swapctl.h> #ifdef CONFIG_BLK_DEV_INITRD #include <linux/blk.h> #endif Index: 0.2/Documentation/sysctl/vm.txt --- 0.2/Documentation/sysctl/vm.txt Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/X/c/33_vm.txt 1.1 644) +++ 0.10/Documentation/sysctl/vm.txt Tue, 09 Jan 2001 01:46:36 +0100 zcalusic (linux24/X/c/33_vm.txt 1.2 644) @@ -6,7 +6,7 @@ ============================================================== This file contains the documentation for the sysctl files in -/proc/sys/vm and is valid for Linux kernel version 2.2. +/proc/sys/vm and is valid for Linux kernel version 2.4. The files in this directory can be used to tune the operation of the virtual memory (VM) subsystem of the Linux kernel, and @@ -18,12 +18,10 @@ Currently, these files are in /proc/sys/vm: - bdflush -- buffermem - freepages -- kswapd +- max-async-pages - overcommit_memory - page-cluster -- pagecache - pagetable_cache ============================================================== @@ -93,20 +91,7 @@ age_super is for filesystem metadata. ============================================================== -buffermem: -The three values in this file correspond to the values in -the struct buffer_mem. It controls how much memory should -be used for buffer memory. The percentage is calculated -as a percentage of total system memory. - -The values are: -min_percent -- this is the minimum percentage of memory - that should be spent on buffer memory -borrow_percent -- UNUSED -max_percent -- UNUSED - -============================================================== freepages: This file contains the values in the struct freepages. That @@ -126,36 +111,12 @@ ============================================================== -kswapd: +max-async-pages: -Kswapd is the kernel swapout daemon. That is, kswapd is that -piece of the kernel that frees memory when it gets fragmented -or full. Since every system is different, you'll probably want -some control over this piece of the system. - -The numbers in this page correspond to the numbers in the -struct pager_daemon {tries_base, tries_min, swap_cluster -}; The tries_base and swap_cluster probably have the -largest influence on system performance. - -tries_base The maximum number of pages kswapd tries to - free in one round is calculated from this - number. Usually this number will be divided - by 4 or 8 (see mm/vmscan.c), so it isn't as - big as it looks. - When you need to increase the bandwidth to/from - swap, you'll want to increase this number. -tries_min This is the minimum number of times kswapd - tries to free a page each time it is called. - Basically it's just there to make sure that - kswapd frees some pages even when it's being - called with minimum priority. -swap_cluster This is the number of pages kswapd writes in - one turn. You want this large so that kswapd - does it's I/O in large chunks and the disk - doesn't have to seek often, but you don't want - it to be too large since that would flood the - request queue. +This is the number of pages kswapd writes in one turn. You want +this large so that kswapd does it's I/O in large chunks and the +disk doesn't have to seek often, but you don't want it to be too +large since that would flood the request queue. ============================================================== Index: 0.10/include/linux/swapctl.h --- 0.2/include/linux/swapctl.h Sat, 06 Jan 2001 01:48:21 +0100 zcalusic (linux24/c/b/36_swapctl.h 1.1 644) +++ 0.10/include/linux/swapctl.h Tue, 09 Jan 2001 01:46:49 +0100 zcalusic () @@ -1,35 +0,0 @@ -#ifndef _LINUX_SWAPCTL_H -#define _LINUX_SWAPCTL_H - -#include <asm/page.h> -#include <linux/fs.h> - -typedef struct buffer_mem_v1 -{ - unsigned int min_percent; - unsigned int borrow_percent; - unsigned int max_percent; -} buffer_mem_v1; -typedef buffer_mem_v1 buffer_mem_t; -extern buffer_mem_t buffer_mem; -extern buffer_mem_t page_cache; - -typedef struct freepages_v1 -{ - unsigned int min; - unsigned int low; - unsigned int high; -} freepages_v1; -typedef freepages_v1 freepages_t; -extern freepages_t freepages; - -typedef struct pager_daemon_v1 -{ - unsigned int tries_base; - unsigned int tries_min; - unsigned int swap_cluster; -} pager_daemon_v1; -typedef pager_daemon_v1 pager_daemon_t; -extern pager_daemon_t pager_daemon; - -#endif /* _LINUX_SWAPCTL_H */ -- Zlatko -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-01-09 0:59 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2001-01-07 20:36 [patch] mm-cleanup-1 (2.4.0) Zlatko Calusic 2001-01-07 19:07 ` Marcelo Tosatti 2001-01-07 21:11 ` Zlatko Calusic 2001-01-07 21:18 ` Rik van Riel 2001-01-07 22:23 ` Zlatko Calusic 2001-01-07 21:21 ` davej 2001-01-07 21:16 ` Rik van Riel 2001-01-07 22:20 ` Zlatko Calusic 2001-01-09 0:59 ` [patch] mm-cleanup-2 (2.4.0) Zlatko Calusic
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox