mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
linux: drop unneeded patches
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
7920ac2d28
commit
d895494d07
File diff suppressed because it is too large
Load Diff
@ -1,20 +0,0 @@
|
||||
http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/2.6.37/2.6.37-ck2/patches/
|
||||
|
||||
2.6.37-sched-bfs-363.patch
|
||||
2637-bfs363-nonhotplug_fix.patch
|
||||
sched-add-above-background-load-function.patch
|
||||
mm-zero_swappiness.patch
|
||||
mm-enable_swaptoken_only_when_swap_full.patch
|
||||
mm-drop_swap_cache_aggressively.patch
|
||||
mm-kswapd_inherit_prio-1.patch
|
||||
mm-background_scan.patch
|
||||
mm-idleprio_prio-1.patch
|
||||
mm-lru_cache_add_lru_tail.patch
|
||||
mm-decrease_default_dirty_ratio.patch
|
||||
kconfig-expose_vmsplit_option.patch
|
||||
hz-default_1000.patch
|
||||
hz-no_default_250.patch
|
||||
hz-raise_max.patch
|
||||
preempt-desktop-tune.patch
|
||||
cpufreq-bfs_tweaks.patch
|
||||
ck2-version.patch
|
File diff suppressed because it is too large
Load Diff
@ -1,60 +0,0 @@
|
||||
Fix a failure to build if CPU hotplug is disabled with BFS.
|
||||
|
||||
-ck
|
||||
|
||||
---
|
||||
kernel/sched_bfs.c | 34 +++++++++++++++++-----------------
|
||||
1 file changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/kernel/sched_bfs.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/kernel/sched_bfs.c 2011-02-14 09:50:24.351252002 +1100
|
||||
+++ linux-2.6.37-ck2/kernel/sched_bfs.c 2011-02-14 09:53:53.820252000 +1100
|
||||
@@ -4812,6 +4812,23 @@
|
||||
grq_unlock_irqrestore(&flags);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Ensures that the idle task is using init_mm right before its cpu goes
|
||||
+ * offline.
|
||||
+ */
|
||||
+void idle_task_exit(void)
|
||||
+{
|
||||
+ struct mm_struct *mm = current->active_mm;
|
||||
+
|
||||
+ BUG_ON(cpu_online(smp_processor_id()));
|
||||
+
|
||||
+ if (mm != &init_mm)
|
||||
+ switch_mm(mm, &init_mm, current);
|
||||
+ mmdrop(mm);
|
||||
+}
|
||||
+
|
||||
+#endif /* CONFIG_HOTPLUG_CPU */
|
||||
+
|
||||
void sched_set_stop_task(int cpu, struct task_struct *stop)
|
||||
{
|
||||
struct sched_param stop_param = { .sched_priority = STOP_PRIO };
|
||||
@@ -4841,23 +4858,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Ensures that the idle task is using init_mm right before its cpu goes
|
||||
- * offline.
|
||||
- */
|
||||
-void idle_task_exit(void)
|
||||
-{
|
||||
- struct mm_struct *mm = current->active_mm;
|
||||
-
|
||||
- BUG_ON(cpu_online(smp_processor_id()));
|
||||
-
|
||||
- if (mm != &init_mm)
|
||||
- switch_mm(mm, &init_mm, current);
|
||||
- mmdrop(mm);
|
||||
-}
|
||||
-
|
||||
-#endif /* CONFIG_HOTPLUG_CPU */
|
||||
-
|
||||
#if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_SYSCTL)
|
||||
|
||||
static struct ctl_table sd_ctl_dir[] = {
|
@ -1,19 +0,0 @@
|
||||
---
|
||||
Makefile | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
Index: linux-2.6.37-ck2/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/Makefile 2011-01-06 14:04:07.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/Makefile 2011-02-14 10:11:20.469252000 +1100
|
||||
@@ -10,6 +10,10 @@
|
||||
# Comments in this file are targeted only to the developer, do not
|
||||
# expect to learn how to build the kernel reading this file.
|
||||
|
||||
+CKVERSION = -ck2
|
||||
+CKNAME = BFS Powered
|
||||
+EXTRAVERSION := $(EXTRAVERSION)$(CKVERSION)
|
||||
+
|
||||
# Do not:
|
||||
# o use make's built-in rules and variables
|
||||
# (this increases performance and avoids hard-to-debug behaviour);
|
@ -1,37 +0,0 @@
|
||||
---
|
||||
drivers/cpufreq/cpufreq_ondemand.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/drivers/cpufreq/cpufreq_ondemand.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/drivers/cpufreq/cpufreq_ondemand.c 2011-01-06 14:04:08.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/drivers/cpufreq/cpufreq_ondemand.c 2011-02-14 10:11:11.438252001 +1100
|
||||
@@ -28,12 +28,12 @@
|
||||
* It helps to keep variable names smaller, simpler
|
||||
*/
|
||||
|
||||
-#define DEF_FREQUENCY_DOWN_DIFFERENTIAL (10)
|
||||
-#define DEF_FREQUENCY_UP_THRESHOLD (80)
|
||||
+#define DEF_FREQUENCY_DOWN_DIFFERENTIAL (17)
|
||||
+#define DEF_FREQUENCY_UP_THRESHOLD (63)
|
||||
#define DEF_SAMPLING_DOWN_FACTOR (1)
|
||||
#define MAX_SAMPLING_DOWN_FACTOR (100000)
|
||||
#define MICRO_FREQUENCY_DOWN_DIFFERENTIAL (3)
|
||||
-#define MICRO_FREQUENCY_UP_THRESHOLD (95)
|
||||
+#define MICRO_FREQUENCY_UP_THRESHOLD (80)
|
||||
#define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
|
||||
#define MIN_FREQUENCY_UP_THRESHOLD (11)
|
||||
#define MAX_FREQUENCY_UP_THRESHOLD (100)
|
||||
@@ -513,10 +513,10 @@
|
||||
|
||||
/*
|
||||
* Every sampling_rate, we check, if current idle time is less
|
||||
- * than 20% (default), then we try to increase frequency
|
||||
+ * than 37% (default), then we try to increase frequency
|
||||
* Every sampling_rate, we look for a the lowest
|
||||
* frequency which can sustain the load while keeping idle time over
|
||||
- * 30%. If such a frequency exist, we try to decrease to this frequency.
|
||||
+ * 50%. If such a frequency exist, we try to decrease to this frequency.
|
||||
*
|
||||
* Any frequency increase takes it to the maximum frequency.
|
||||
* Frequency reduction happens at minimum steps of
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
kernel/Kconfig.hz | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/kernel/Kconfig.hz
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/kernel/Kconfig.hz 2009-06-10 13:05:27.000000000 +1000
|
||||
+++ linux-2.6.37-ck2/kernel/Kconfig.hz 2011-02-14 10:11:10.474252000 +1100
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_250
|
||||
+ default HZ_1000
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
@ -1,47 +0,0 @@
|
||||
---
|
||||
kernel/Kconfig.hz | 17 ++++++++++-------
|
||||
1 file changed, 10 insertions(+), 7 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/kernel/Kconfig.hz
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/kernel/Kconfig.hz 2011-02-14 10:11:10.474252000 +1100
|
||||
+++ linux-2.6.37-ck2/kernel/Kconfig.hz 2011-02-14 10:11:10.702252000 +1100
|
||||
@@ -23,13 +23,14 @@
|
||||
with lots of processors that may show reduced performance if
|
||||
too many timer interrupts are occurring.
|
||||
|
||||
- config HZ_250
|
||||
+ config HZ_250_NODEFAULT
|
||||
bool "250 HZ"
|
||||
help
|
||||
- 250 Hz is a good compromise choice allowing server performance
|
||||
- while also showing good interactive responsiveness even
|
||||
- on SMP and NUMA systems. If you are going to be using NTSC video
|
||||
- or multimedia, selected 300Hz instead.
|
||||
+ 250 HZ is a lousy compromise choice allowing server interactivity
|
||||
+ while also showing desktop throughput and no extra power saving on
|
||||
+ laptops. No good for anything.
|
||||
+
|
||||
+ Recommend 100 or 1000 instead.
|
||||
|
||||
config HZ_300
|
||||
bool "300 HZ"
|
||||
@@ -43,14 +44,16 @@
|
||||
bool "1000 HZ"
|
||||
help
|
||||
1000 Hz is the preferred choice for desktop systems and other
|
||||
- systems requiring fast interactive responses to events.
|
||||
+ systems requiring fast interactive responses to events. Laptops
|
||||
+ can also benefit from this choice without sacrificing battery life
|
||||
+ if dynticks is also enabled.
|
||||
|
||||
endchoice
|
||||
|
||||
config HZ
|
||||
int
|
||||
default 100 if HZ_100
|
||||
- default 250 if HZ_250
|
||||
+ default 250 if HZ_250_NODEFAULT
|
||||
default 300 if HZ_300
|
||||
default 1000 if HZ_1000
|
||||
|
@ -1,174 +0,0 @@
|
||||
---
|
||||
arch/x86/kernel/cpu/proc.c | 2 -
|
||||
arch/x86/kernel/smpboot.c | 2 -
|
||||
include/linux/nfsd/stats.h | 4 +-
|
||||
include/net/inet_timewait_sock.h | 10 ++++--
|
||||
init/calibrate.c | 2 -
|
||||
kernel/Kconfig.hz | 64 +++++++++++++++++++++++++++++++++++++++
|
||||
6 files changed, 76 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/arch/x86/kernel/cpu/proc.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/arch/x86/kernel/cpu/proc.c 2009-12-03 21:39:58.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/arch/x86/kernel/cpu/proc.c 2011-02-14 10:11:10.919252001 +1100
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
|
||||
c->loops_per_jiffy/(500000/HZ),
|
||||
- (c->loops_per_jiffy/(5000/HZ)) % 100);
|
||||
+ (c->loops_per_jiffy * 10 /(50000/HZ)) % 100);
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
if (c->x86_tlbsize > 0)
|
||||
Index: linux-2.6.37-ck2/arch/x86/kernel/smpboot.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/arch/x86/kernel/smpboot.c 2011-01-06 14:04:08.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/arch/x86/kernel/smpboot.c 2011-02-14 10:11:10.920252001 +1100
|
||||
@@ -497,7 +497,7 @@
|
||||
"Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
|
||||
num_online_cpus(),
|
||||
bogosum/(500000/HZ),
|
||||
- (bogosum/(5000/HZ))%100);
|
||||
+ (bogosum * 10/(50000/HZ))%100);
|
||||
|
||||
pr_debug("Before bogocount - setting activated=1.\n");
|
||||
}
|
||||
Index: linux-2.6.37-ck2/include/linux/nfsd/stats.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/nfsd/stats.h 2009-06-10 13:05:27.000000000 +1000
|
||||
+++ linux-2.6.37-ck2/include/linux/nfsd/stats.h 2011-02-14 10:11:10.920252001 +1100
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
#include <linux/nfs4.h>
|
||||
|
||||
-/* thread usage wraps very million seconds (approx one fortnight) */
|
||||
-#define NFSD_USAGE_WRAP (HZ*1000000)
|
||||
+/* thread usage wraps every one hundred thousand seconds (approx one day) */
|
||||
+#define NFSD_USAGE_WRAP (HZ*100000)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
Index: linux-2.6.37-ck2/include/net/inet_timewait_sock.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/net/inet_timewait_sock.h 2010-08-02 11:12:25.000000000 +1000
|
||||
+++ linux-2.6.37-ck2/include/net/inet_timewait_sock.h 2011-02-14 10:11:10.920252001 +1100
|
||||
@@ -39,8 +39,8 @@
|
||||
* If time > 4sec, it is "slow" path, no recycling is required,
|
||||
* so that we select tick to get range about 4 seconds.
|
||||
*/
|
||||
-#if HZ <= 16 || HZ > 4096
|
||||
-# error Unsupported: HZ <= 16 or HZ > 4096
|
||||
+#if HZ <= 16 || HZ > 16384
|
||||
+# error Unsupported: HZ <= 16 or HZ > 16384
|
||||
#elif HZ <= 32
|
||||
# define INET_TWDR_RECYCLE_TICK (5 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
|
||||
#elif HZ <= 64
|
||||
@@ -55,8 +55,12 @@
|
||||
# define INET_TWDR_RECYCLE_TICK (10 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
|
||||
#elif HZ <= 2048
|
||||
# define INET_TWDR_RECYCLE_TICK (11 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
|
||||
-#else
|
||||
+#elif HZ <= 4096
|
||||
# define INET_TWDR_RECYCLE_TICK (12 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
|
||||
+#elif HZ <= 8192
|
||||
+# define INET_TWDR_RECYCLE_TICK (13 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
|
||||
+#else
|
||||
+# define INET_TWDR_RECYCLE_TICK (14 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
|
||||
#endif
|
||||
|
||||
/* TIME_WAIT reaping mechanism. */
|
||||
Index: linux-2.6.37-ck2/init/calibrate.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/init/calibrate.c 2010-02-25 21:51:52.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/init/calibrate.c 2011-02-14 10:11:10.921252001 +1100
|
||||
@@ -176,7 +176,7 @@
|
||||
if (!printed)
|
||||
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
|
||||
loops_per_jiffy/(500000/HZ),
|
||||
- (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
|
||||
+ (loops_per_jiffy * 10 /(50000/HZ)) % 100, loops_per_jiffy);
|
||||
|
||||
printed = true;
|
||||
}
|
||||
Index: linux-2.6.37-ck2/kernel/Kconfig.hz
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/kernel/Kconfig.hz 2011-02-14 10:11:10.702252000 +1100
|
||||
+++ linux-2.6.37-ck2/kernel/Kconfig.hz 2011-02-14 10:11:10.921252001 +1100
|
||||
@@ -48,6 +48,63 @@
|
||||
can also benefit from this choice without sacrificing battery life
|
||||
if dynticks is also enabled.
|
||||
|
||||
+ config HZ_1500
|
||||
+ bool "1500 HZ"
|
||||
+ help
|
||||
+ 1500 Hz is an insane value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+ config HZ_2000
|
||||
+ bool "2000 HZ"
|
||||
+ help
|
||||
+ 2000 Hz is an insane value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+ config HZ_3000
|
||||
+ bool "3000 HZ"
|
||||
+ help
|
||||
+ 3000 Hz is an insane value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+ config HZ_4000
|
||||
+ bool "4000 HZ"
|
||||
+ help
|
||||
+ 4000 Hz is an insane value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+ config HZ_5000
|
||||
+ bool "5000 HZ"
|
||||
+ help
|
||||
+ 5000 Hz is an obscene value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+ config HZ_7500
|
||||
+ bool "7500 HZ"
|
||||
+ help
|
||||
+ 7500 Hz is an obscene value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+ config HZ_10000
|
||||
+ bool "10000 HZ"
|
||||
+ help
|
||||
+ 10000 Hz is an obscene value to use to run broken software that is Hz
|
||||
+ limited.
|
||||
+
|
||||
+ Being over 1000, driver breakage is likely.
|
||||
+
|
||||
+
|
||||
endchoice
|
||||
|
||||
config HZ
|
||||
@@ -56,6 +113,13 @@
|
||||
default 250 if HZ_250_NODEFAULT
|
||||
default 300 if HZ_300
|
||||
default 1000 if HZ_1000
|
||||
+ default 1500 if HZ_1500
|
||||
+ default 2000 if HZ_2000
|
||||
+ default 3000 if HZ_3000
|
||||
+ default 4000 if HZ_4000
|
||||
+ default 5000 if HZ_5000
|
||||
+ default 7500 if HZ_7500
|
||||
+ default 10000 if HZ_10000
|
||||
|
||||
config SCHED_HRTICK
|
||||
def_bool HIGH_RES_TIMERS && (!SMP || USE_GENERIC_SMP_HELPERS)
|
@ -1,40 +0,0 @@
|
||||
---
|
||||
arch/x86/Kconfig | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/arch/x86/Kconfig
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/arch/x86/Kconfig 2011-01-06 14:04:08.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/arch/x86/Kconfig 2011-02-14 10:11:10.260252001 +1100
|
||||
@@ -1046,7 +1046,7 @@
|
||||
|
||||
choice
|
||||
depends on EXPERIMENTAL
|
||||
- prompt "Memory split" if EMBEDDED
|
||||
+ prompt "Memory split"
|
||||
default VMSPLIT_3G
|
||||
depends on X86_32
|
||||
---help---
|
||||
@@ -1066,17 +1066,17 @@
|
||||
option alone!
|
||||
|
||||
config VMSPLIT_3G
|
||||
- bool "3G/1G user/kernel split"
|
||||
+ bool "Default 896MB lowmem (3G/1G user/kernel split)"
|
||||
config VMSPLIT_3G_OPT
|
||||
depends on !X86_PAE
|
||||
- bool "3G/1G user/kernel split (for full 1G low memory)"
|
||||
+ bool "1GB lowmem (3G/1G user/kernel split)"
|
||||
config VMSPLIT_2G
|
||||
- bool "2G/2G user/kernel split"
|
||||
+ bool "2GB lowmem (2G/2G user/kernel split)"
|
||||
config VMSPLIT_2G_OPT
|
||||
depends on !X86_PAE
|
||||
- bool "2G/2G user/kernel split (for full 2G low memory)"
|
||||
+ bool "2GB lowmem (2G/2G user/kernel split)"
|
||||
config VMSPLIT_1G
|
||||
- bool "1G/3G user/kernel split"
|
||||
+ bool "3GB lowmem (1G/3G user/kernel split)"
|
||||
endchoice
|
||||
|
||||
config PAGE_OFFSET
|
@ -1,69 +0,0 @@
|
||||
---
|
||||
mm/vmscan.c | 33 ++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 32 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/mm/vmscan.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/vmscan.c 2011-02-14 10:11:00.986252001 +1100
|
||||
+++ linux-2.6.37-ck2/mm/vmscan.c 2011-02-14 10:11:01.254252001 +1100
|
||||
@@ -1855,6 +1855,33 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Helper functions to adjust nice level of kswapd, based on the priority of
|
||||
+ * the task (p) that called it. If it is already higher priority we do not
|
||||
+ * demote its nice level since it is still working on behalf of a higher
|
||||
+ * priority task. With kernel threads we leave it at nice 0.
|
||||
+ *
|
||||
+ * We don't ever run kswapd real time, so if a real time task calls kswapd we
|
||||
+ * set it to highest SCHED_NORMAL priority.
|
||||
+ */
|
||||
+static inline int effective_sc_prio(struct task_struct *p)
|
||||
+{
|
||||
+ if (likely(p->mm)) {
|
||||
+ if (rt_task(p))
|
||||
+ return -20;
|
||||
+ return task_nice(p);
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void set_kswapd_nice(struct task_struct *kswapd, int active)
|
||||
+{
|
||||
+ long nice = effective_sc_prio(current);
|
||||
+
|
||||
+ if (task_nice(kswapd) > nice || !active)
|
||||
+ set_user_nice(kswapd, nice);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* This is the direct reclaim path, for page-allocating processes. We only
|
||||
* try to reclaim pages from zones which will satisfy the caller's allocation
|
||||
* request.
|
||||
@@ -2457,6 +2484,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ set_user_nice(tsk, 0);
|
||||
order = pgdat->kswapd_max_order;
|
||||
}
|
||||
finish_wait(&pgdat->kswapd_wait, &wait);
|
||||
@@ -2483,6 +2511,7 @@
|
||||
void wakeup_kswapd(struct zone *zone, int order)
|
||||
{
|
||||
pg_data_t *pgdat;
|
||||
+ int active;
|
||||
|
||||
if (!populated_zone(zone))
|
||||
return;
|
||||
@@ -2495,7 +2524,9 @@
|
||||
trace_mm_vmscan_wakeup_kswapd(pgdat->node_id, zone_idx(zone), order);
|
||||
if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
|
||||
return;
|
||||
- if (!waitqueue_active(&pgdat->kswapd_wait))
|
||||
+ active = waitqueue_active(&pgdat->kswapd_wait);
|
||||
+ set_kswapd_nice(pgdat->kswapd, active);
|
||||
+ if (!active)
|
||||
return;
|
||||
wake_up_interruptible(&pgdat->kswapd_wait);
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
The default dirty ratio is chosen to be a compromise between throughput and
|
||||
overall system latency. On a desktop, if an application writes to disk a lot,
|
||||
that application should be the one to slow down rather than the desktop as a
|
||||
whole. At higher dirty ratio settings, an application could write a lot to
|
||||
disk and then happily use lots of CPU time after that while the rest of the
|
||||
system is busy waiting on that naughty applications disk writes to complete
|
||||
before anything else happening.
|
||||
|
||||
Lower ratios mean that the application that do a lot of disk writes end up
|
||||
being responsible for their own actions and they're the ones that slow down
|
||||
rather than the system in general.
|
||||
|
||||
This does decrease overall write throughput slightly, but to the benefit of
|
||||
the latency of the system as a whole.
|
||||
|
||||
-ck
|
||||
|
||||
---
|
||||
mm/page-writeback.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/mm/page-writeback.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/page-writeback.c 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/mm/page-writeback.c 2011-02-14 10:11:10.037252000 +1100
|
||||
@@ -78,7 +78,7 @@
|
||||
/*
|
||||
* The generator of dirty data starts writeback at this percentage
|
||||
*/
|
||||
-int vm_dirty_ratio = 20;
|
||||
+int vm_dirty_ratio = 5;
|
||||
|
||||
/*
|
||||
* vm_dirty_bytes starts at 0 (disabled) so that it is a function of
|
@ -1,87 +0,0 @@
|
||||
---
|
||||
include/linux/swap.h | 2 +-
|
||||
mm/memory.c | 2 +-
|
||||
mm/swapfile.c | 9 ++++-----
|
||||
mm/vmscan.c | 2 +-
|
||||
4 files changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/include/linux/swap.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/swap.h 2011-02-14 10:11:00.763252001 +1100
|
||||
+++ linux-2.6.37-ck2/include/linux/swap.h 2011-02-14 10:11:00.982252001 +1100
|
||||
@@ -192,7 +192,7 @@
|
||||
int next; /* swapfile to be used next */
|
||||
};
|
||||
|
||||
-/* Swap 50% full? Release swapcache more aggressively.. */
|
||||
+/* Swap 50% full? */
|
||||
#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
|
||||
|
||||
/* linux/mm/page_alloc.c */
|
||||
Index: linux-2.6.37-ck2/mm/memory.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/memory.c 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/mm/memory.c 2011-02-14 10:11:00.984252001 +1100
|
||||
@@ -2754,7 +2754,7 @@
|
||||
mem_cgroup_commit_charge_swapin(page, ptr);
|
||||
|
||||
swap_free(entry);
|
||||
- if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page))
|
||||
+ if ((vma->vm_flags & VM_LOCKED) || PageMlocked(page))
|
||||
try_to_free_swap(page);
|
||||
unlock_page(page);
|
||||
if (swapcache) {
|
||||
Index: linux-2.6.37-ck2/mm/swapfile.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/swapfile.c 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/mm/swapfile.c 2011-02-14 10:11:00.985252001 +1100
|
||||
@@ -321,7 +321,7 @@
|
||||
scan_base = offset = si->lowest_bit;
|
||||
|
||||
/* reuse swap entry of cache-only swap if not busy. */
|
||||
- if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) {
|
||||
+ if (si->swap_map[offset] == SWAP_HAS_CACHE) {
|
||||
int swap_was_freed;
|
||||
spin_unlock(&swap_lock);
|
||||
swap_was_freed = __try_to_reclaim_swap(si, offset);
|
||||
@@ -410,7 +410,7 @@
|
||||
spin_lock(&swap_lock);
|
||||
goto checks;
|
||||
}
|
||||
- if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) {
|
||||
+ if (si->swap_map[offset] == SWAP_HAS_CACHE) {
|
||||
spin_lock(&swap_lock);
|
||||
goto checks;
|
||||
}
|
||||
@@ -425,7 +425,7 @@
|
||||
spin_lock(&swap_lock);
|
||||
goto checks;
|
||||
}
|
||||
- if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) {
|
||||
+ if (si->swap_map[offset] == SWAP_HAS_CACHE) {
|
||||
spin_lock(&swap_lock);
|
||||
goto checks;
|
||||
}
|
||||
@@ -739,8 +739,7 @@
|
||||
* Not mapped elsewhere, or swap space full? Free it!
|
||||
* Also recheck PageSwapCache now page is locked (above).
|
||||
*/
|
||||
- if (PageSwapCache(page) && !PageWriteback(page) &&
|
||||
- (!page_mapped(page) || vm_swap_full())) {
|
||||
+ if (PageSwapCache(page) && !PageWriteback(page)) {
|
||||
delete_from_swap_cache(page);
|
||||
SetPageDirty(page);
|
||||
}
|
||||
Index: linux-2.6.37-ck2/mm/vmscan.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/vmscan.c 2011-02-14 10:11:00.536252000 +1100
|
||||
+++ linux-2.6.37-ck2/mm/vmscan.c 2011-02-14 10:11:00.986252001 +1100
|
||||
@@ -900,7 +900,7 @@
|
||||
|
||||
activate_locked:
|
||||
/* Not a candidate for swapping, so reclaim swap space. */
|
||||
- if (PageSwapCache(page) && vm_swap_full())
|
||||
+ if (PageSwapCache(page))
|
||||
try_to_free_swap(page);
|
||||
VM_BUG_ON(PageActive(page));
|
||||
SetPageActive(page);
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
include/linux/swap.h | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/include/linux/swap.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/swap.h 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/include/linux/swap.h 2011-02-14 10:11:00.763252001 +1100
|
||||
@@ -348,9 +348,10 @@
|
||||
extern void grab_swap_token(struct mm_struct *);
|
||||
extern void __put_swap_token(struct mm_struct *);
|
||||
|
||||
+/* Only allow swap token to have effect if swap is full */
|
||||
static inline int has_swap_token(struct mm_struct *mm)
|
||||
{
|
||||
- return (mm == swap_token_mm);
|
||||
+ return (mm == swap_token_mm && vm_swap_full());
|
||||
}
|
||||
|
||||
static inline void put_swap_token(struct mm_struct *mm)
|
@ -1,137 +0,0 @@
|
||||
---
|
||||
include/linux/mmzone.h | 6 +++++-
|
||||
mm/vmscan.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 47 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/include/linux/mmzone.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/mmzone.h 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/include/linux/mmzone.h 2011-02-14 10:11:01.470252001 +1100
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <linux/seqlock.h>
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/pageblock-flags.h>
|
||||
+#include <linux/timer.h>
|
||||
#include <generated/bounds.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/page.h>
|
||||
@@ -161,12 +162,14 @@
|
||||
WMARK_MIN,
|
||||
WMARK_LOW,
|
||||
WMARK_HIGH,
|
||||
+ WMARK_LOTS,
|
||||
NR_WMARK
|
||||
};
|
||||
|
||||
#define min_wmark_pages(z) (z->watermark[WMARK_MIN])
|
||||
#define low_wmark_pages(z) (z->watermark[WMARK_LOW])
|
||||
#define high_wmark_pages(z) (z->watermark[WMARK_HIGH])
|
||||
+#define lots_wmark_pages(z) (z->watermark[WMARK_LOTS])
|
||||
|
||||
struct per_cpu_pages {
|
||||
int count; /* number of pages in the list */
|
||||
@@ -343,7 +346,7 @@
|
||||
ZONE_PADDING(_pad1_)
|
||||
|
||||
/* Fields commonly accessed by the page reclaim scanner */
|
||||
- spinlock_t lru_lock;
|
||||
+ spinlock_t lru_lock;
|
||||
struct zone_lru {
|
||||
struct list_head list;
|
||||
} lru[NR_LRU_LISTS];
|
||||
@@ -645,6 +648,7 @@
|
||||
wait_queue_head_t kswapd_wait;
|
||||
struct task_struct *kswapd;
|
||||
int kswapd_max_order;
|
||||
+ struct timer_list watermark_timer;
|
||||
} pg_data_t;
|
||||
|
||||
#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
|
||||
Index: linux-2.6.37-ck2/mm/vmscan.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/vmscan.c 2011-02-14 10:11:01.254252001 +1100
|
||||
+++ linux-2.6.37-ck2/mm/vmscan.c 2011-02-14 10:11:01.471252001 +1100
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <linux/rwsem.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kthread.h>
|
||||
+#include <linux/timer.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/memcontrol.h>
|
||||
#include <linux/delayacct.h>
|
||||
@@ -2398,6 +2399,8 @@
|
||||
return sc.nr_reclaimed;
|
||||
}
|
||||
|
||||
+#define WT_EXPIRY (HZ * 5) /* Time to wakeup watermark_timer */
|
||||
+
|
||||
/*
|
||||
* The background pageout daemon, started as a kernel thread
|
||||
* from the init process.
|
||||
@@ -2448,6 +2451,8 @@
|
||||
unsigned long new_order;
|
||||
int ret;
|
||||
|
||||
+ /* kswapd has been busy so delay watermark_timer */
|
||||
+ mod_timer(&pgdat->watermark_timer, jiffies + WT_EXPIRY);
|
||||
prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
|
||||
new_order = pgdat->kswapd_max_order;
|
||||
pgdat->kswapd_max_order = 0;
|
||||
@@ -2632,20 +2637,57 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * We wake up kswapd every WT_EXPIRY till free ram is above pages_lots
|
||||
+ */
|
||||
+static void watermark_wakeup(unsigned long data)
|
||||
+{
|
||||
+ pg_data_t *pgdat = (pg_data_t *)data;
|
||||
+ struct timer_list *wt = &pgdat->watermark_timer;
|
||||
+ int i;
|
||||
+
|
||||
+ if (!waitqueue_active(&pgdat->kswapd_wait) || above_background_load())
|
||||
+ goto out;
|
||||
+ for (i = pgdat->nr_zones - 1; i >= 0; i--) {
|
||||
+ struct zone *z = pgdat->node_zones + i;
|
||||
+
|
||||
+ if (!populated_zone(z) || is_highmem(z)) {
|
||||
+ /* We are better off leaving highmem full */
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (!zone_watermark_ok(z, 0, lots_wmark_pages(z), 0, 0)) {
|
||||
+ wake_up_interruptible(&pgdat->kswapd_wait);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+out:
|
||||
+ mod_timer(wt, jiffies + WT_EXPIRY);
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* This kswapd start function will be called by init and node-hot-add.
|
||||
* On node-hot-add, kswapd will moved to proper cpus if cpus are hot-added.
|
||||
*/
|
||||
int kswapd_run(int nid)
|
||||
{
|
||||
pg_data_t *pgdat = NODE_DATA(nid);
|
||||
+ struct timer_list *wt;
|
||||
int ret = 0;
|
||||
|
||||
if (pgdat->kswapd)
|
||||
return 0;
|
||||
|
||||
+ wt = &pgdat->watermark_timer;
|
||||
+ init_timer(wt);
|
||||
+ wt->data = (unsigned long)pgdat;
|
||||
+ wt->function = watermark_wakeup;
|
||||
+ wt->expires = jiffies + WT_EXPIRY;
|
||||
+ add_timer(wt);
|
||||
+
|
||||
pgdat->kswapd = kthread_run(kswapd, pgdat, "kswapd%d", nid);
|
||||
if (IS_ERR(pgdat->kswapd)) {
|
||||
/* failure at boot is fatal */
|
||||
+ del_timer(wt);
|
||||
BUG_ON(system_state == SYSTEM_BOOTING);
|
||||
printk("Failed to start kswapd on node %d\n",nid);
|
||||
ret = -1;
|
@ -1,33 +0,0 @@
|
||||
---
|
||||
include/linux/sched.h | 2 +-
|
||||
mm/vmscan.c | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.37-ck1/include/linux/sched.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck1.orig/include/linux/sched.h 2011-01-06 14:07:19.971048973 +1100
|
||||
+++ linux-2.6.37-ck1/include/linux/sched.h 2011-01-06 14:07:58.442334300 +1100
|
||||
@@ -38,9 +38,9 @@
|
||||
#define SCHED_BATCH 3
|
||||
/* SCHED_ISO: Implemented on BFS only */
|
||||
#define SCHED_IDLE 5
|
||||
+#define SCHED_IDLEPRIO SCHED_IDLE
|
||||
#ifdef CONFIG_SCHED_BFS
|
||||
#define SCHED_ISO 4
|
||||
-#define SCHED_IDLEPRIO SCHED_IDLE
|
||||
#define SCHED_MAX (SCHED_IDLEPRIO)
|
||||
#define SCHED_RANGE(policy) ((policy) <= SCHED_MAX)
|
||||
#endif
|
||||
Index: linux-2.6.37-ck1/mm/vmscan.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck1.orig/mm/vmscan.c 2011-01-06 14:07:58.305326159 +1100
|
||||
+++ linux-2.6.37-ck1/mm/vmscan.c 2011-01-06 14:07:58.443334359 +1100
|
||||
@@ -1874,6 +1874,8 @@ static inline int effective_sc_prio(stru
|
||||
if (likely(p->mm)) {
|
||||
if (rt_task(p))
|
||||
return -20;
|
||||
+ if (p->policy == SCHED_IDLEPRIO)
|
||||
+ return 19;
|
||||
return task_nice(p);
|
||||
}
|
||||
return 0;
|
@ -1,250 +0,0 @@
|
||||
---
|
||||
include/linux/mm_inline.h | 14 +++++++++++-
|
||||
include/linux/swap.h | 8 ++++++-
|
||||
mm/filemap.c | 50 +++++++++++++++++++++++++++++++++++++++-------
|
||||
mm/swap.c | 30 ++++++++++++++++++++++-----
|
||||
4 files changed, 86 insertions(+), 16 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/include/linux/mm_inline.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/mm_inline.h 2009-12-03 21:40:09.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/include/linux/mm_inline.h 2011-02-14 10:11:09.770252000 +1100
|
||||
@@ -20,14 +20,24 @@
|
||||
}
|
||||
|
||||
static inline void
|
||||
-add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l)
|
||||
+__add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l, int tail)
|
||||
{
|
||||
- list_add(&page->lru, &zone->lru[l].list);
|
||||
+ /* See if this should be added to the tail of this lru list */
|
||||
+ if (tail)
|
||||
+ list_add_tail(&page->lru, &zone->lru[l].list);
|
||||
+ else
|
||||
+ list_add(&page->lru, &zone->lru[l].list);
|
||||
__inc_zone_state(zone, NR_LRU_BASE + l);
|
||||
mem_cgroup_add_lru_list(page, l);
|
||||
}
|
||||
|
||||
static inline void
|
||||
+add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l)
|
||||
+{
|
||||
+ __add_page_to_lru_list(zone, page, l, 0);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l)
|
||||
{
|
||||
list_del(&page->lru);
|
||||
Index: linux-2.6.37-ck2/include/linux/swap.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/swap.h 2011-02-14 10:11:00.982252001 +1100
|
||||
+++ linux-2.6.37-ck2/include/linux/swap.h 2011-02-14 10:11:09.770252000 +1100
|
||||
@@ -206,6 +206,7 @@
|
||||
|
||||
|
||||
/* linux/mm/swap.c */
|
||||
+extern void ____lru_cache_add(struct page *, enum lru_list lru, int tail);
|
||||
extern void __lru_cache_add(struct page *, enum lru_list lru);
|
||||
extern void lru_cache_add_lru(struct page *, enum lru_list lru);
|
||||
extern void activate_page(struct page *);
|
||||
@@ -226,9 +227,14 @@
|
||||
__lru_cache_add(page, LRU_INACTIVE_ANON);
|
||||
}
|
||||
|
||||
+static inline void lru_cache_add_file_tail(struct page *page, int tail)
|
||||
+{
|
||||
+ ____lru_cache_add(page, LRU_INACTIVE_FILE, tail);
|
||||
+}
|
||||
+
|
||||
static inline void lru_cache_add_file(struct page *page)
|
||||
{
|
||||
- __lru_cache_add(page, LRU_INACTIVE_FILE);
|
||||
+ ____lru_cache_add(page, LRU_INACTIVE_FILE, 0);
|
||||
}
|
||||
|
||||
/* LRU Isolation modes. */
|
||||
Index: linux-2.6.37-ck2/mm/filemap.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/filemap.c 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/mm/filemap.c 2011-02-14 10:11:09.772252000 +1100
|
||||
@@ -439,8 +439,8 @@
|
||||
}
|
||||
EXPORT_SYMBOL(add_to_page_cache_locked);
|
||||
|
||||
-int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
|
||||
- pgoff_t offset, gfp_t gfp_mask)
|
||||
+int __add_to_page_cache_lru(struct page *page, struct address_space *mapping,
|
||||
+ pgoff_t offset, gfp_t gfp_mask, int tail)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -456,12 +456,18 @@
|
||||
ret = add_to_page_cache(page, mapping, offset, gfp_mask);
|
||||
if (ret == 0) {
|
||||
if (page_is_file_cache(page))
|
||||
- lru_cache_add_file(page);
|
||||
+ lru_cache_add_file_tail(page, tail);
|
||||
else
|
||||
lru_cache_add_anon(page);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
|
||||
+ pgoff_t offset, gfp_t gfp_mask)
|
||||
+{
|
||||
+ return __add_to_page_cache_lru(page, mapping, offset, gfp_mask, 0);
|
||||
+}
|
||||
EXPORT_SYMBOL_GPL(add_to_page_cache_lru);
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
@@ -968,6 +974,28 @@
|
||||
ra->ra_pages /= 4;
|
||||
}
|
||||
|
||||
+static inline int nr_mapped(void)
|
||||
+{
|
||||
+ return global_page_state(NR_FILE_MAPPED) +
|
||||
+ global_page_state(NR_ANON_PAGES);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * This examines how large in pages a file size is and returns 1 if it is
|
||||
+ * more than half the unmapped ram. Avoid doing read_page_state which is
|
||||
+ * expensive unless we already know it is likely to be large enough.
|
||||
+ */
|
||||
+static int large_isize(unsigned long nr_pages)
|
||||
+{
|
||||
+ if (nr_pages * 6 > vm_total_pages) {
|
||||
+ unsigned long unmapped_ram = vm_total_pages - nr_mapped();
|
||||
+
|
||||
+ if (nr_pages * 2 > unmapped_ram)
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* do_generic_file_read - generic file read routine
|
||||
* @filp: the file to read
|
||||
@@ -992,7 +1020,7 @@
|
||||
pgoff_t prev_index;
|
||||
unsigned long offset; /* offset into pagecache page */
|
||||
unsigned int prev_offset;
|
||||
- int error;
|
||||
+ int error, tail = 0;
|
||||
|
||||
index = *ppos >> PAGE_CACHE_SHIFT;
|
||||
prev_index = ra->prev_pos >> PAGE_CACHE_SHIFT;
|
||||
@@ -1003,7 +1031,7 @@
|
||||
for (;;) {
|
||||
struct page *page;
|
||||
pgoff_t end_index;
|
||||
- loff_t isize;
|
||||
+ loff_t isize = 0;
|
||||
unsigned long nr, ret;
|
||||
|
||||
cond_resched();
|
||||
@@ -1177,8 +1205,16 @@
|
||||
desc->error = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
- error = add_to_page_cache_lru(page, mapping,
|
||||
- index, GFP_KERNEL);
|
||||
+ /*
|
||||
+ * If we know the file is large we add the pages read to the
|
||||
+ * end of the lru as we're unlikely to be able to cache the
|
||||
+ * whole file in ram so make those pages the first to be
|
||||
+ * dropped if not referenced soon.
|
||||
+ */
|
||||
+ if (large_isize(end_index))
|
||||
+ tail = 1;
|
||||
+ error = __add_to_page_cache_lru(page, mapping,
|
||||
+ index, GFP_KERNEL, tail);
|
||||
if (error) {
|
||||
page_cache_release(page);
|
||||
if (error == -EEXIST)
|
||||
Index: linux-2.6.37-ck2/mm/swap.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/mm/swap.c 2011-01-06 14:04:10.000000000 +1100
|
||||
+++ linux-2.6.37-ck2/mm/swap.c 2011-02-14 10:11:09.772252000 +1100
|
||||
@@ -215,15 +215,23 @@
|
||||
|
||||
EXPORT_SYMBOL(mark_page_accessed);
|
||||
|
||||
-void __lru_cache_add(struct page *page, enum lru_list lru)
|
||||
+void ______pagevec_lru_add(struct pagevec *pvec, enum lru_list lru, int tail);
|
||||
+
|
||||
+void ____lru_cache_add(struct page *page, enum lru_list lru, int tail)
|
||||
{
|
||||
struct pagevec *pvec = &get_cpu_var(lru_add_pvecs)[lru];
|
||||
|
||||
page_cache_get(page);
|
||||
if (!pagevec_add(pvec, page))
|
||||
- ____pagevec_lru_add(pvec, lru);
|
||||
+ ______pagevec_lru_add(pvec, lru, tail);
|
||||
put_cpu_var(lru_add_pvecs);
|
||||
}
|
||||
+EXPORT_SYMBOL(____lru_cache_add);
|
||||
+
|
||||
+void __lru_cache_add(struct page *page, enum lru_list lru)
|
||||
+{
|
||||
+ ____lru_cache_add(page, lru, 0);
|
||||
+}
|
||||
EXPORT_SYMBOL(__lru_cache_add);
|
||||
|
||||
/**
|
||||
@@ -231,7 +239,7 @@
|
||||
* @page: the page to be added to the LRU.
|
||||
* @lru: the LRU list to which the page is added.
|
||||
*/
|
||||
-void lru_cache_add_lru(struct page *page, enum lru_list lru)
|
||||
+void __lru_cache_add_lru(struct page *page, enum lru_list lru, int tail)
|
||||
{
|
||||
if (PageActive(page)) {
|
||||
VM_BUG_ON(PageUnevictable(page));
|
||||
@@ -242,7 +250,12 @@
|
||||
}
|
||||
|
||||
VM_BUG_ON(PageLRU(page) || PageActive(page) || PageUnevictable(page));
|
||||
- __lru_cache_add(page, lru);
|
||||
+ ____lru_cache_add(page, lru, tail);
|
||||
+}
|
||||
+
|
||||
+void lru_cache_add_lru(struct page *page, enum lru_list lru)
|
||||
+{
|
||||
+ __lru_cache_add_lru(page, lru, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,7 +416,7 @@
|
||||
* Add the passed pages to the LRU, then drop the caller's refcount
|
||||
* on them. Reinitialises the caller's pagevec.
|
||||
*/
|
||||
-void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
|
||||
+void ______pagevec_lru_add(struct pagevec *pvec, enum lru_list lru, int tail)
|
||||
{
|
||||
int i;
|
||||
struct zone *zone = NULL;
|
||||
@@ -431,7 +444,7 @@
|
||||
if (active)
|
||||
SetPageActive(page);
|
||||
update_page_reclaim_stat(zone, page, file, active);
|
||||
- add_page_to_lru_list(zone, page, lru);
|
||||
+ __add_page_to_lru_list(zone, page, lru, tail);
|
||||
}
|
||||
if (zone)
|
||||
spin_unlock_irq(&zone->lru_lock);
|
||||
@@ -439,6 +452,11 @@
|
||||
pagevec_reinit(pvec);
|
||||
}
|
||||
|
||||
+void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
|
||||
+{
|
||||
+ ______pagevec_lru_add(pvec, lru, 0);
|
||||
+}
|
||||
+
|
||||
EXPORT_SYMBOL(____pagevec_lru_add);
|
||||
|
||||
/*
|
@ -1,36 +0,0 @@
|
||||
---
|
||||
kernel/Kconfig.preempt | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: linux-2.6.37-ck2/kernel/Kconfig.preempt
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/kernel/Kconfig.preempt 2009-06-10 13:05:27.000000000 +1000
|
||||
+++ linux-2.6.37-ck2/kernel/Kconfig.preempt 2011-02-14 10:11:11.217252001 +1100
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
choice
|
||||
prompt "Preemption Model"
|
||||
- default PREEMPT_NONE
|
||||
+ default PREEMPT
|
||||
|
||||
config PREEMPT_NONE
|
||||
bool "No Forced Preemption (Server)"
|
||||
@@ -17,7 +17,7 @@
|
||||
latencies.
|
||||
|
||||
config PREEMPT_VOLUNTARY
|
||||
- bool "Voluntary Kernel Preemption (Desktop)"
|
||||
+ bool "Voluntary Kernel Preemption (Nothing)"
|
||||
help
|
||||
This option reduces the latency of the kernel by adding more
|
||||
"explicit preemption points" to the kernel code. These new
|
||||
@@ -31,7 +31,8 @@
|
||||
applications to run more 'smoothly' even when the system is
|
||||
under load.
|
||||
|
||||
- Select this if you are building a kernel for a desktop system.
|
||||
+ Select this for no system in particular (choose Preemptible
|
||||
+ instead on a desktop if you know what's good for you).
|
||||
|
||||
config PREEMPT
|
||||
bool "Preemptible Kernel (Low-Latency Desktop)"
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
include/linux/sched.h | 7 +++++++
|
||||
kernel/sched_bfs.c | 20 ++++++++++++++++++++
|
||||
2 files changed, 27 insertions(+)
|
||||
|
||||
Index: linux-2.6.37-ck2/include/linux/sched.h
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/include/linux/sched.h 2011-02-14 09:47:50.988252000 +1100
|
||||
+++ linux-2.6.37-ck2/include/linux/sched.h 2011-02-14 10:11:00.292251999 +1100
|
||||
@@ -1558,6 +1558,7 @@
|
||||
return (p->policy == SCHED_ISO);
|
||||
}
|
||||
extern void remove_cpu(unsigned long cpu);
|
||||
+extern int above_background_load(void);
|
||||
#else /* CFS */
|
||||
extern int runqueue_is_locked(int cpu);
|
||||
#define tsk_seruntime(t) ((t)->se.sum_exec_runtime)
|
||||
@@ -1581,6 +1582,12 @@
|
||||
static inline void remove_cpu(unsigned long cpu)
|
||||
{
|
||||
}
|
||||
+
|
||||
+/* Anyone feel like implementing this? */
|
||||
+static inline int above_background_load(void)
|
||||
+{
|
||||
+ return 1;
|
||||
+}
|
||||
#endif /* CONFIG_SCHED_BFS */
|
||||
|
||||
/* Future-safe accessor for struct task_struct's cpus_allowed. */
|
||||
Index: linux-2.6.37-ck2/kernel/sched_bfs.c
|
||||
===================================================================
|
||||
--- linux-2.6.37-ck2.orig/kernel/sched_bfs.c 2011-02-14 09:53:53.820252000 +1100
|
||||
+++ linux-2.6.37-ck2/kernel/sched_bfs.c 2011-02-14 10:11:00.294252001 +1100
|
||||
@@ -559,6 +559,26 @@
|
||||
grq_unlock();
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Look for any tasks *anywhere* that are running nice 0 or better. We do
|
||||
+ * this lockless for overhead reasons since the occasional wrong result
|
||||
+ * is harmless.
|
||||
+ */
|
||||
+int above_background_load(void)
|
||||
+{
|
||||
+ struct task_struct *cpu_curr;
|
||||
+ unsigned long cpu;
|
||||
+
|
||||
+ for_each_online_cpu(cpu) {
|
||||
+ cpu_curr = cpu_rq(cpu)->curr;
|
||||
+ if (unlikely(!cpu_curr))
|
||||
+ continue;
|
||||
+ if (PRIO_TO_NICE(cpu_curr->static_prio) < 1)
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
#ifndef __ARCH_WANT_UNLOCKED_CTXSW
|
||||
static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next)
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux/i386 2.6.38-rc6-ck2 Kernel Configuration
|
||||
# Linux/i386 2.6.38-rc8 Kernel Configuration
|
||||
#
|
||||
# CONFIG_64BIT is not set
|
||||
CONFIG_X86_32=y
|
||||
@ -402,17 +402,10 @@ CONFIG_EFI=y
|
||||
CONFIG_SECCOMP=y
|
||||
# CONFIG_CC_STACKPROTECTOR is not set
|
||||
# CONFIG_HZ_100 is not set
|
||||
# CONFIG_HZ_250_NODEFAULT is not set
|
||||
# CONFIG_HZ_300 is not set
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_1500 is not set
|
||||
# CONFIG_HZ_2000 is not set
|
||||
# CONFIG_HZ_3000 is not set
|
||||
# CONFIG_HZ_4000 is not set
|
||||
# CONFIG_HZ_5000 is not set
|
||||
# CONFIG_HZ_7500 is not set
|
||||
# CONFIG_HZ_10000 is not set
|
||||
CONFIG_HZ=1000
|
||||
# CONFIG_HZ_250 is not set
|
||||
CONFIG_HZ_300=y
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ=300
|
||||
CONFIG_SCHED_HRTICK=y
|
||||
# CONFIG_KEXEC is not set
|
||||
CONFIG_PHYSICAL_START=0x1000000
|
||||
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux/i386 2.6.38-rc6-ck2 Kernel Configuration
|
||||
# Linux/i386 2.6.38-rc8 Kernel Configuration
|
||||
#
|
||||
# CONFIG_64BIT is not set
|
||||
CONFIG_X86_32=y
|
||||
@ -389,17 +389,10 @@ CONFIG_ARCH_USES_PG_UNCACHED=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_CC_STACKPROTECTOR=y
|
||||
# CONFIG_HZ_100 is not set
|
||||
# CONFIG_HZ_250_NODEFAULT is not set
|
||||
# CONFIG_HZ_300 is not set
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_1500 is not set
|
||||
# CONFIG_HZ_2000 is not set
|
||||
# CONFIG_HZ_3000 is not set
|
||||
# CONFIG_HZ_4000 is not set
|
||||
# CONFIG_HZ_5000 is not set
|
||||
# CONFIG_HZ_7500 is not set
|
||||
# CONFIG_HZ_10000 is not set
|
||||
CONFIG_HZ=1000
|
||||
# CONFIG_HZ_250 is not set
|
||||
CONFIG_HZ_300=y
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ=300
|
||||
CONFIG_SCHED_HRTICK=y
|
||||
# CONFIG_KEXEC is not set
|
||||
# CONFIG_CRASH_DUMP is not set
|
||||
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux/i386 2.6.38-rc6-ck2 Kernel Configuration
|
||||
# Linux/i386 2.6.38-rc8 Kernel Configuration
|
||||
#
|
||||
# CONFIG_64BIT is not set
|
||||
CONFIG_X86_32=y
|
||||
@ -388,17 +388,10 @@ CONFIG_ARCH_USES_PG_UNCACHED=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_CC_STACKPROTECTOR=y
|
||||
# CONFIG_HZ_100 is not set
|
||||
# CONFIG_HZ_250_NODEFAULT is not set
|
||||
# CONFIG_HZ_300 is not set
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_1500 is not set
|
||||
# CONFIG_HZ_2000 is not set
|
||||
# CONFIG_HZ_3000 is not set
|
||||
# CONFIG_HZ_4000 is not set
|
||||
# CONFIG_HZ_5000 is not set
|
||||
# CONFIG_HZ_7500 is not set
|
||||
# CONFIG_HZ_10000 is not set
|
||||
CONFIG_HZ=1000
|
||||
# CONFIG_HZ_250 is not set
|
||||
CONFIG_HZ_300=y
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ=300
|
||||
CONFIG_SCHED_HRTICK=y
|
||||
# CONFIG_KEXEC is not set
|
||||
# CONFIG_CRASH_DUMP is not set
|
||||
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux/x86_64 2.6.38-rc6-ck2 Kernel Configuration
|
||||
# Linux/x86_64 2.6.38-rc8 Kernel Configuration
|
||||
#
|
||||
CONFIG_64BIT=y
|
||||
# CONFIG_X86_32 is not set
|
||||
@ -352,17 +352,10 @@ CONFIG_ARCH_USES_PG_UNCACHED=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_CC_STACKPROTECTOR=y
|
||||
# CONFIG_HZ_100 is not set
|
||||
# CONFIG_HZ_250_NODEFAULT is not set
|
||||
# CONFIG_HZ_300 is not set
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_1500 is not set
|
||||
# CONFIG_HZ_2000 is not set
|
||||
# CONFIG_HZ_3000 is not set
|
||||
# CONFIG_HZ_4000 is not set
|
||||
# CONFIG_HZ_5000 is not set
|
||||
# CONFIG_HZ_7500 is not set
|
||||
# CONFIG_HZ_10000 is not set
|
||||
CONFIG_HZ=1000
|
||||
# CONFIG_HZ_250 is not set
|
||||
CONFIG_HZ_300=y
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ=300
|
||||
CONFIG_SCHED_HRTICK=y
|
||||
# CONFIG_KEXEC is not set
|
||||
# CONFIG_CRASH_DUMP is not set
|
||||
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux/i386 2.6.38-rc6-ck2 Kernel Configuration
|
||||
# Linux/i386 2.6.38-rc8 Kernel Configuration
|
||||
#
|
||||
# CONFIG_64BIT is not set
|
||||
CONFIG_X86_32=y
|
||||
@ -389,17 +389,10 @@ CONFIG_ARCH_USES_PG_UNCACHED=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_CC_STACKPROTECTOR=y
|
||||
# CONFIG_HZ_100 is not set
|
||||
# CONFIG_HZ_250_NODEFAULT is not set
|
||||
# CONFIG_HZ_300 is not set
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_1500 is not set
|
||||
# CONFIG_HZ_2000 is not set
|
||||
# CONFIG_HZ_3000 is not set
|
||||
# CONFIG_HZ_4000 is not set
|
||||
# CONFIG_HZ_5000 is not set
|
||||
# CONFIG_HZ_7500 is not set
|
||||
# CONFIG_HZ_10000 is not set
|
||||
CONFIG_HZ=1000
|
||||
# CONFIG_HZ_250 is not set
|
||||
CONFIG_HZ_300=y
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ=300
|
||||
CONFIG_SCHED_HRTICK=y
|
||||
# CONFIG_KEXEC is not set
|
||||
# CONFIG_CRASH_DUMP is not set
|
||||
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux/x86_64 2.6.38-rc6-ck2 Kernel Configuration
|
||||
# Linux/x86_64 2.6.38-rc8 Kernel Configuration
|
||||
#
|
||||
CONFIG_64BIT=y
|
||||
# CONFIG_X86_32 is not set
|
||||
@ -354,17 +354,10 @@ CONFIG_ARCH_USES_PG_UNCACHED=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_CC_STACKPROTECTOR=y
|
||||
# CONFIG_HZ_100 is not set
|
||||
# CONFIG_HZ_250_NODEFAULT is not set
|
||||
# CONFIG_HZ_300 is not set
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_1500 is not set
|
||||
# CONFIG_HZ_2000 is not set
|
||||
# CONFIG_HZ_3000 is not set
|
||||
# CONFIG_HZ_4000 is not set
|
||||
# CONFIG_HZ_5000 is not set
|
||||
# CONFIG_HZ_7500 is not set
|
||||
# CONFIG_HZ_10000 is not set
|
||||
CONFIG_HZ=1000
|
||||
# CONFIG_HZ_250 is not set
|
||||
CONFIG_HZ_300=y
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ=300
|
||||
CONFIG_SCHED_HRTICK=y
|
||||
# CONFIG_KEXEC is not set
|
||||
# CONFIG_CRASH_DUMP is not set
|
||||
|
Loading…
x
Reference in New Issue
Block a user