diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-09 20:54:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-09 20:54:59 -0400 |
commit | 5c56b563b4486281bff80658194f0d1da6feba67 (patch) | |
tree | 80ab610988c049511122c53078578e538a0b9ffa | |
parent | b507146bb6b9ac0c0197100ba3e299825a21fed3 (diff) | |
parent | 44f43e99fe70833058482d183e99fdfd11220996 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton:
"2 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
zsmalloc: fix zs_can_compact() integer overflow
Revert "proc/base: make prompt shell start from new line after executing "cat /proc/$pid/wchan""
-rw-r--r-- | fs/proc/base.c | 2 | ||||
-rw-r--r-- | mm/zsmalloc.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 92e37e224cd2..0d163a84082d 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -434,7 +434,7 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns, | |||
434 | && !lookup_symbol_name(wchan, symname)) | 434 | && !lookup_symbol_name(wchan, symname)) |
435 | seq_printf(m, "%s", symname); | 435 | seq_printf(m, "%s", symname); |
436 | else | 436 | else |
437 | seq_puts(m, "0\n"); | 437 | seq_putc(m, '0'); |
438 | 438 | ||
439 | return 0; | 439 | return 0; |
440 | } | 440 | } |
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index e72efb109fde..fe47fbba995a 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c | |||
@@ -1735,10 +1735,13 @@ static struct page *isolate_source_page(struct size_class *class) | |||
1735 | static unsigned long zs_can_compact(struct size_class *class) | 1735 | static unsigned long zs_can_compact(struct size_class *class) |
1736 | { | 1736 | { |
1737 | unsigned long obj_wasted; | 1737 | unsigned long obj_wasted; |
1738 | unsigned long obj_allocated = zs_stat_get(class, OBJ_ALLOCATED); | ||
1739 | unsigned long obj_used = zs_stat_get(class, OBJ_USED); | ||
1738 | 1740 | ||
1739 | obj_wasted = zs_stat_get(class, OBJ_ALLOCATED) - | 1741 | if (obj_allocated <= obj_used) |
1740 | zs_stat_get(class, OBJ_USED); | 1742 | return 0; |
1741 | 1743 | ||
1744 | obj_wasted = obj_allocated - obj_used; | ||
1742 | obj_wasted /= get_maxobj_per_zspage(class->size, | 1745 | obj_wasted /= get_maxobj_per_zspage(class->size, |
1743 | class->pages_per_zspage); | 1746 | class->pages_per_zspage); |
1744 | 1747 | ||