Magellan Linux

Contents of /trunk/kernel26-magellan/patches-2.6.16-r12/0027-2.6.16-mm-aggresive_swap_prefetch.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72 - (show annotations) (download)
Mon Jun 5 09:25:38 2006 UTC (17 years, 10 months ago) by niro
File size: 3333 byte(s)
ver bump to 2.6.16-r12:
- updated to linux-2.6.16.19
- updated to ck11

1 ---
2 Documentation/sysctl/vm.txt | 14 ++++++++++----
3 include/linux/swap-prefetch.h | 5 +++++
4 mm/swap_prefetch.c | 11 +++++++++++
5 3 files changed, 26 insertions(+), 4 deletions(-)
6
7 Index: linux-2.6.16-ck1/include/linux/swap-prefetch.h
8 ===================================================================
9 --- linux-2.6.16-ck1.orig/include/linux/swap-prefetch.h 2006-03-20 20:46:55.000000000 +1100
10 +++ linux-2.6.16-ck1/include/linux/swap-prefetch.h 2006-03-20 20:47:01.000000000 +1100
11 @@ -33,6 +33,7 @@ extern void add_to_swapped_list(struct p
12 extern void remove_from_swapped_list(const unsigned long index);
13 extern void delay_swap_prefetch(void);
14 extern void prepare_swap_prefetch(void);
15 +extern void aggressive_swap_prefetch(void);
16
17 #else /* CONFIG_SWAP_PREFETCH */
18 static inline void add_to_swapped_list(struct page *__unused)
19 @@ -50,6 +51,10 @@ static inline void remove_from_swapped_l
20 static inline void delay_swap_prefetch(void)
21 {
22 }
23 +
24 +static inline void aggressive_swap_prefetch(void)
25 +{
26 +}
27 #endif /* CONFIG_SWAP_PREFETCH */
28
29 #endif /* SWAP_PREFETCH_H_INCLUDED */
30 Index: linux-2.6.16-ck1/mm/swap_prefetch.c
31 ===================================================================
32 --- linux-2.6.16-ck1.orig/mm/swap_prefetch.c 2006-03-20 20:47:00.000000000 +1100
33 +++ linux-2.6.16-ck1/mm/swap_prefetch.c 2006-03-20 20:47:01.000000000 +1100
34 @@ -29,6 +29,7 @@
35
36 #define PREFETCH_NORMAL (1 << 0)
37 #define PREFETCH_AGGRESSIVE (1 << 1)
38 +
39 /*
40 * sysctl - enable/disable swap prefetching bits
41 * This is composed of the bitflags PREFETCH_NORMAL and PREFETCH_AGGRESSIVE.
42 @@ -601,6 +602,16 @@ void __init prepare_swap_prefetch(void)
43 }
44 }
45
46 +/*
47 + * This exported function sets the PREFETCH_AGGRESSIVE flag but only if there
48 + * are entries to prefetch.
49 + */
50 +void aggressive_swap_prefetch(void)
51 +{
52 + if (swapped.count)
53 + swap_prefetch |= PREFETCH_AGGRESSIVE;
54 +}
55 +
56 static int __init kprefetchd_init(void)
57 {
58 kprefetchd_task = kthread_run(kprefetchd, NULL, "kprefetchd");
59 Index: linux-2.6.16-ck1/Documentation/sysctl/vm.txt
60 ===================================================================
61 --- linux-2.6.16-ck1.orig/Documentation/sysctl/vm.txt 2006-03-20 20:47:00.000000000 +1100
62 +++ linux-2.6.16-ck1/Documentation/sysctl/vm.txt 2006-03-20 20:47:01.000000000 +1100
63 @@ -192,9 +192,15 @@ This is value ORed together of
64 1 = Normal background swap prefetching when load is light
65 2 = Aggressively swap prefetch as much as possible
66
67 -When 2 is set, after the maximum amount possible has been prefetched, this bit
68 -is unset. ie Setting the value to 3 will prefetch aggressively then drop to 1.
69 -This is useful for doing aggressive prefetching for short periods in scripts
70 -such as after resuming from software suspend.
71 +ie Setting the value to 3 will prefetch aggressively then drop to 1. This
72 +is useful for doing aggressive prefetching for short periods in scripts
73 +such as after resuming from software suspend. Setting the value to 2 will
74 +prefetch aggressively as much as it can and then disable any further swap
75 +prefetching.
76 +
77 +Note that setting this to 0 disables even storing a list of swapped pages (to
78 +minimise overhead) which means that if significant swapping has occurred with
79 +swap_prefetch unset and then it is enabled, there is nothing that can be
80 +prefetched.
81
82 The default value is 1.