summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2009-01-30 12:08:53 -0800
committerRebecca Schultz Zavin <rebecca@android.com>2009-01-30 12:08:53 -0800
commit132305ed227e69bd7498c8a30d40a338a23a4afe (patch)
tree65bd5239eb2dba3024e5c3fd136a832b544c4783
parent05925453ae4df746a23a7282adaeb8b9eef3632b (diff)
parentbdafa006abfc25947e86d687b0c7921b5a48d83d (diff)
downloadcommon-archive/android-goldfish-2.6.27.tar.gz
Merge branch 'android-2.6.27' into android-goldfish-2.6.27archive/android-goldfish-2.6.27
-rw-r--r--drivers/misc/Kconfig1
-rw-r--r--drivers/misc/lowmemorykiller.c43
-rw-r--r--drivers/misc/ram_console.c14
-rw-r--r--fs/proc/task_mmu.c4
-rw-r--r--include/net/bluetooth/hci_core.h3
-rw-r--r--net/bluetooth/hci_event.c5
6 files changed, 47 insertions, 23 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 69f4ae0f3326..c09499d688ca 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -525,6 +525,7 @@ menuconfig ANDROID_RAM_CONSOLE_ERROR_CORRECTION
bool "Enable error correction"
default n
depends on ANDROID_RAM_CONSOLE
+ depends on !ANDROID_RAM_CONSOLE_EARLY_INIT
select REED_SOLOMON
select REED_SOLOMON_ENC8
select REED_SOLOMON_DEC8
diff --git a/drivers/misc/lowmemorykiller.c b/drivers/misc/lowmemorykiller.c
index 3715d56ca96b..6be1b08a4c15 100644
--- a/drivers/misc/lowmemorykiller.c
+++ b/drivers/misc/lowmemorykiller.c
@@ -58,36 +58,45 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
int min_adj = OOM_ADJUST_MAX + 1;
int selected_tasksize = 0;
int array_size = ARRAY_SIZE(lowmem_adj);
- int other_free = global_page_state(NR_FREE_PAGES) + global_page_state(NR_FILE_PAGES);
+ int other_free = global_page_state(NR_FREE_PAGES);
+ int other_file = global_page_state(NR_FILE_PAGES);
if(lowmem_adj_size < array_size)
array_size = lowmem_adj_size;
if(lowmem_minfree_size < array_size)
array_size = lowmem_minfree_size;
for(i = 0; i < array_size; i++) {
- if(other_free < lowmem_minfree[i]) {
+ if (other_free < lowmem_minfree[i] &&
+ other_file < lowmem_minfree[i]) {
min_adj = lowmem_adj[i];
break;
}
}
if(nr_to_scan > 0)
- lowmem_print(3, "lowmem_shrink %d, %x, ofree %d, ma %d\n", nr_to_scan, gfp_mask, other_free, min_adj);
+ lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n", nr_to_scan, gfp_mask, other_free, other_file, min_adj);
+ rem = global_page_state(NR_ACTIVE) + global_page_state(NR_INACTIVE);
+ if (nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
+ lowmem_print(5, "lowmem_shrink %d, %x, return %d\n", nr_to_scan, gfp_mask, rem);
+ return rem;
+ }
+
read_lock(&tasklist_lock);
for_each_process(p) {
- if(p->oomkilladj >= 0 && p->mm) {
- tasksize = get_mm_rss(p->mm);
- if(nr_to_scan > 0 && tasksize > 0 && p->oomkilladj >= min_adj) {
- if(selected == NULL ||
- p->oomkilladj > selected->oomkilladj ||
- (p->oomkilladj == selected->oomkilladj &&
- tasksize > selected_tasksize)) {
- selected = p;
- selected_tasksize = tasksize;
- lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n",
- p->pid, p->comm, p->oomkilladj, tasksize);
- }
- }
- rem += tasksize;
+ if (p->oomkilladj < min_adj || !p->mm)
+ continue;
+ tasksize = get_mm_rss(p->mm);
+ if (tasksize <= 0)
+ continue;
+ if (selected) {
+ if (p->oomkilladj < selected->oomkilladj)
+ continue;
+ if (p->oomkilladj == selected->oomkilladj &&
+ tasksize <= selected_tasksize)
+ continue;
}
+ selected = p;
+ selected_tasksize = tasksize;
+ lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n",
+ p->pid, p->comm, p->oomkilladj, tasksize);
}
if(selected != NULL) {
lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
diff --git a/drivers/misc/ram_console.c b/drivers/misc/ram_console.c
index aec20f7f1b6d..2a1274b0f4b7 100644
--- a/drivers/misc/ram_console.c
+++ b/drivers/misc/ram_console.c
@@ -224,9 +224,23 @@ static int __init ram_console_init(struct ram_console_buffer *buffer,
ram_console_buffer_size =
buffer_size - sizeof(struct ram_console_buffer);
+ if (ram_console_buffer_size > buffer_size) {
+ pr_err("ram_console: buffer %p, invalid size %d, datasize %d\n",
+ buffer, buffer_size, ram_console_buffer_size);
+ return 0;
+ }
+
+
#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
ram_console_buffer_size -= (DIV_ROUND_UP(ram_console_buffer_size,
ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
+ if (ram_console_buffer_size > buffer_size) {
+ pr_err("ram_console: buffer %p, invalid size %d, "
+ "non-ecc datasize %d\n",
+ buffer, buffer_size, ram_console_buffer_size);
+ return 0;
+ }
+
ram_console_par_buffer = buffer->data + ram_console_buffer_size;
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 73d1891ee625..0cf26ef0fd46 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -553,9 +553,9 @@ static u64 swap_pte_to_pagemap_entry(pte_t pte)
return swp_type(e) | (swp_offset(e) << MAX_SWAPFILES_SHIFT);
}
-static unsigned long pte_to_pagemap_entry(pte_t pte)
+static u64 pte_to_pagemap_entry(pte_t pte)
{
- unsigned long pme = 0;
+ u64 pme = 0;
if (is_swap_pte(pte))
pme = PM_PFRAME(swap_pte_to_pagemap_entry(pte))
| PM_PSHIFT(PAGE_SHIFT) | PM_SWAP;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 80ace615182c..925111185049 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -465,8 +465,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
-/* Forcably turn off esco for Android until we fix HFP compatibility */
-#define lmp_esco_capable(dev) 0
+#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
/* ----- HCI protocols ----- */
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3cba788d90b5..fbd73b84708a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -916,10 +916,11 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
}
}
- hci_proto_connect_cfm(conn, ev->status);
if (ev->status) {
+ hci_proto_connect_cfm(conn, ev->status);
hci_conn_del(conn);
- }
+ } else if (ev->link_type != ACL_LINK)
+ hci_proto_connect_cfm(conn, ev->status);
unlock:
hci_dev_unlock(hdev);