From 655b8bfd4c60672ba9bef99e05189418a47d562e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Apr 2012 13:59:00 -0400 Subject: [PATCH] --- yaml --- r: 298900 b: refs/heads/master c: 3cb42092ff02edec34bf936b7400b1f1efc8ca43 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/um/kernel/Makefile | 7 +-- trunk/arch/x86/Makefile.um | 3 ++ .../i2c/busses/i2c-designware-pcidrv.c | 1 + .../drivers/staging/android/lowmemorykiller.c | 48 ++++++++++++++++--- trunk/scripts/mod/modpost.c | 7 +-- trunk/scripts/mod/modpost.h | 1 - 7 files changed, 52 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 38ca3a5bdd65..9ab31fe761ee 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3a48d1c08fe0db79b8647b7042e6a077588b374a +refs/heads/master: 3cb42092ff02edec34bf936b7400b1f1efc8ca43 diff --git a/trunk/arch/um/kernel/Makefile b/trunk/arch/um/kernel/Makefile index 492bc4c1b62b..65a1c3d690ea 100644 --- a/trunk/arch/um/kernel/Makefile +++ b/trunk/arch/um/kernel/Makefile @@ -3,9 +3,10 @@ # Licensed under the GPL # -CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \ - -DELF_ARCH=$(LDS_ELF_ARCH) \ - -DELF_FORMAT=$(LDS_ELF_FORMAT) +CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \ + -DELF_ARCH=$(LDS_ELF_ARCH) \ + -DELF_FORMAT=$(LDS_ELF_FORMAT) \ + $(LDS_EXTRA) extra-y := vmlinux.lds clean-files := diff --git a/trunk/arch/x86/Makefile.um b/trunk/arch/x86/Makefile.um index 4be406abeefd..36b62bc52638 100644 --- a/trunk/arch/x86/Makefile.um +++ b/trunk/arch/x86/Makefile.um @@ -14,6 +14,9 @@ LINK-y += $(call cc-option,-m32) export LDFLAGS +LDS_EXTRA := -Ui386 +export LDS_EXTRA + # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. include $(srctree)/arch/x86/Makefile_32.cpu diff --git a/trunk/drivers/i2c/busses/i2c-designware-pcidrv.c b/trunk/drivers/i2c/busses/i2c-designware-pcidrv.c index 00e8f213f56e..37f42113af31 100644 --- a/trunk/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/trunk/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -182,6 +182,7 @@ static int i2c_dw_pci_resume(struct device *dev) pci_restore_state(pdev); i2c_dw_init(i2c); + i2c_dw_enable(i2c); return 0; } diff --git a/trunk/drivers/staging/android/lowmemorykiller.c b/trunk/drivers/staging/android/lowmemorykiller.c index b91e4bc332a7..052b43e4e505 100644 --- a/trunk/drivers/staging/android/lowmemorykiller.c +++ b/trunk/drivers/staging/android/lowmemorykiller.c @@ -55,6 +55,7 @@ static int lowmem_minfree[6] = { }; static int lowmem_minfree_size = 4; +static struct task_struct *lowmem_deathpending; static unsigned long lowmem_deathpending_timeout; #define lowmem_print(level, x...) \ @@ -63,6 +64,24 @@ static unsigned long lowmem_deathpending_timeout; printk(x); \ } while (0) +static int +task_notify_func(struct notifier_block *self, unsigned long val, void *data); + +static struct notifier_block task_nb = { + .notifier_call = task_notify_func, +}; + +static int +task_notify_func(struct notifier_block *self, unsigned long val, void *data) +{ + struct task_struct *task = data; + + if (task == lowmem_deathpending) + lowmem_deathpending = NULL; + + return NOTIFY_OK; +} + static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) { struct task_struct *tsk; @@ -78,6 +97,19 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) int other_file = global_page_state(NR_FILE_PAGES) - global_page_state(NR_SHMEM); + /* + * If we already have a death outstanding, then + * bail out right away; indicating to vmscan + * that we have nothing further to offer on + * this pass. + * + * Note: Currently you need CONFIG_PROFILING + * for this to work correctly. + */ + if (lowmem_deathpending && + time_before_eq(jiffies, lowmem_deathpending_timeout)) + return 0; + if (lowmem_adj_size < array_size) array_size = lowmem_adj_size; if (lowmem_minfree_size < array_size) @@ -116,12 +148,6 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) if (!p) continue; - if (test_tsk_thread_flag(p, TIF_MEMDIE) && - time_before_eq(jiffies, lowmem_deathpending_timeout)) { - task_unlock(p); - rcu_read_unlock(); - return 0; - } oom_score_adj = p->signal->oom_score_adj; if (oom_score_adj < min_score_adj) { task_unlock(p); @@ -148,9 +174,15 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n", selected->pid, selected->comm, selected_oom_score_adj, selected_tasksize); + /* + * If CONFIG_PROFILING is off, then we don't want to stall + * the killer by setting lowmem_deathpending. + */ +#ifdef CONFIG_PROFILING + lowmem_deathpending = selected; lowmem_deathpending_timeout = jiffies + HZ; +#endif send_sig(SIGKILL, selected, 0); - set_tsk_thread_flag(selected, TIF_MEMDIE); rem -= selected_tasksize; } lowmem_print(4, "lowmem_shrink %lu, %x, return %d\n", @@ -166,6 +198,7 @@ static struct shrinker lowmem_shrinker = { static int __init lowmem_init(void) { + task_handoff_register(&task_nb); register_shrinker(&lowmem_shrinker); return 0; } @@ -173,6 +206,7 @@ static int __init lowmem_init(void) static void __exit lowmem_exit(void) { unregister_shrinker(&lowmem_shrinker); + task_handoff_unregister(&task_nb); } module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); diff --git a/trunk/scripts/mod/modpost.c b/trunk/scripts/mod/modpost.c index c4e7d1510f9d..3f01fd908730 100644 --- a/trunk/scripts/mod/modpost.c +++ b/trunk/scripts/mod/modpost.c @@ -132,10 +132,8 @@ static struct module *new_module(char *modname) /* strip trailing .o */ s = strrchr(p, '.'); if (s != NULL) - if (strcmp(s, ".o") == 0) { + if (strcmp(s, ".o") == 0) *s = '\0'; - mod->is_dot_o = 1; - } /* add to list */ mod->name = p; @@ -589,8 +587,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, unsigned int crc; enum export export; - if ((!is_vmlinux(mod->name) || mod->is_dot_o) && - strncmp(symname, "__ksymtab", 9) == 0) + if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0) export = export_from_secname(info, get_secindex(info, sym)); else export = export_from_sec(info, get_secindex(info, sym)); diff --git a/trunk/scripts/mod/modpost.h b/trunk/scripts/mod/modpost.h index 51207e4d5f8b..2031119080dc 100644 --- a/trunk/scripts/mod/modpost.h +++ b/trunk/scripts/mod/modpost.h @@ -113,7 +113,6 @@ struct module { int has_cleanup; struct buffer dev_table_buf; char srcversion[25]; - int is_dot_o; }; struct elf_info {