Files
android_kernel_xiaomi_sm8450/include/linux
KOSAKI Motohiro 00a62ce91e mm: fix Committed_AS underflow on large NR_CPUS environment
The Committed_AS field can underflow in certain situations:

>         # while true; do cat /proc/meminfo  | grep _AS; sleep 1; done | uniq -c
>               1 Committed_AS: 18446744073709323392 kB
>              11 Committed_AS: 18446744073709455488 kB
>               6 Committed_AS:    35136 kB
>               5 Committed_AS: 18446744073709454400 kB
>               7 Committed_AS:    35904 kB
>               3 Committed_AS: 18446744073709453248 kB
>               2 Committed_AS:    34752 kB
>               9 Committed_AS: 18446744073709453248 kB
>               8 Committed_AS:    34752 kB
>               3 Committed_AS: 18446744073709320960 kB
>               7 Committed_AS: 18446744073709454080 kB
>               3 Committed_AS: 18446744073709320960 kB
>               5 Committed_AS: 18446744073709454080 kB
>               6 Committed_AS: 18446744073709320960 kB

Because NR_CPUS can be greater than 1000 and meminfo_proc_show() does
not check for underflow.

But NR_CPUS proportional isn't good calculation.  In general,
possibility of lock contention is proportional to the number of online
cpus, not theorical maximum cpus (NR_CPUS).

The current kernel has generic percpu-counter stuff.  using it is right
way.  it makes code simplify and percpu_counter_read_positive() don't
make underflow issue.

Reported-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: <stable@kernel.org>		[All kernel versions]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-05-02 15:36:10 -07:00
..
2009-01-30 19:50:25 +05:30
2009-04-07 10:23:34 +01:00
2009-03-18 19:45:11 -07:00
2009-03-31 09:56:26 +01:00
2009-03-05 14:39:32 -05:00
2008-10-20 11:01:52 -07:00
2009-01-30 23:38:03 +05:30
2008-12-29 08:29:50 +01:00
2009-01-21 14:02:19 -08:00
2009-04-06 20:00:51 -04:00
2009-01-30 23:38:37 +05:30
2008-12-03 22:12:38 -08:00
2008-12-03 22:12:38 -08:00
2009-02-12 09:40:14 +11:00
2009-04-01 08:59:23 -07:00
2009-01-30 23:39:42 +05:30
2009-04-01 08:59:23 -07:00
2008-10-20 08:52:42 -07:00
2009-01-30 23:40:06 +05:30
2009-05-02 15:36:10 -07:00
2009-04-22 08:35:10 +02:00
2009-04-23 10:06:35 +01:00
2009-04-24 08:54:21 +02:00
2009-01-04 13:33:20 -08:00
2008-11-12 17:17:18 -08:00
2009-01-30 23:44:08 +05:30
2009-01-02 12:19:34 -08:00
2009-04-03 14:53:32 -07:00
2008-12-25 11:01:43 +11:00
2008-11-24 18:57:41 -05:00
2009-03-27 14:43:59 -04:00
2009-03-01 00:19:35 -08:00
2008-08-28 11:49:15 -05:00
2009-01-30 23:46:03 +05:30
2009-04-03 14:53:32 -07:00
2009-01-30 23:46:40 +05:30
2008-10-16 16:53:13 +02:00
2009-01-30 23:48:33 +05:30
2009-02-10 00:41:26 +01:00
2009-03-16 08:32:27 -06:00
2008-08-20 13:19:51 -07:00
2008-12-29 11:27:46 +02:00
2009-02-18 15:37:56 -08:00
2008-12-01 19:14:02 +01:00
2008-10-16 11:21:40 -07:00
2009-03-30 15:14:53 +02:00
2009-01-30 23:51:17 +05:30
2009-04-03 09:48:29 -07:00
2008-10-16 11:21:38 -07:00
2009-01-30 23:51:41 +05:30
2009-04-08 14:13:03 +02:00
2009-04-02 19:04:53 -07:00
2009-01-30 23:52:16 +05:30
2009-01-30 23:53:12 +05:30
2009-01-30 23:53:40 +05:30
2009-01-30 23:54:53 +05:30
2009-01-30 23:55:45 +05:30
2009-01-30 23:56:13 +05:30
2009-01-30 23:56:48 +05:30
2009-01-30 23:57:16 +05:30
2009-02-11 15:27:15 +11:00
2009-02-02 21:40:58 +05:30
2009-04-13 15:04:29 -07:00
2008-10-15 14:24:08 +02:00
2009-04-21 13:41:48 -07:00
2009-04-21 13:41:48 -07:00
2009-01-30 23:58:41 +05:30
2009-01-30 23:59:44 +05:30
2009-01-31 00:00:06 +05:30
2009-01-05 08:40:30 -08:00
2009-04-02 19:04:49 -07:00
2009-01-22 10:18:58 +01:00
2009-04-06 16:06:26 +01:00
2008-09-01 09:47:16 +02:00
2009-04-01 08:59:17 -07:00
2009-01-21 10:39:51 +01:00
2009-04-07 08:12:38 +02:00
2009-01-31 00:00:35 +05:30
2009-04-02 19:04:48 -07:00
2009-03-26 10:56:35 -07:00
2009-01-31 00:01:11 +05:30
2009-03-20 10:48:14 -07:00
2009-01-14 18:09:02 +01:00
2009-03-15 19:59:13 -07:00
2009-04-03 17:41:23 -07:00
2009-04-01 13:28:15 -04:00
2009-04-03 17:41:12 -07:00
2009-03-10 20:33:18 -04:00
2008-12-21 14:21:14 +11:00
2009-04-01 08:59:13 -07:00
2009-04-01 08:59:13 -07:00
2008-10-16 11:21:49 -07:00
2009-04-13 15:04:32 -07:00
2009-01-31 00:02:54 +05:30
2009-04-13 14:51:23 -07:00
2009-01-08 08:31:12 -08:00
2009-01-31 00:03:40 +05:30
2009-04-24 08:54:21 +02:00
2008-10-23 00:11:07 -04:00
2009-04-01 08:59:13 -07:00
2009-01-06 15:59:12 -08:00
2009-03-13 16:09:12 -07:00
2009-03-30 15:22:01 +02:00
2009-03-26 02:18:35 +01:00
2009-01-05 18:31:12 -08:00
2008-10-02 15:53:13 -07:00
2009-01-31 00:05:59 +05:30
2008-11-12 17:17:17 -08:00
2008-11-16 19:39:21 -08:00
2009-02-26 23:42:11 -08:00
2009-03-30 14:28:58 -07:00
2009-04-01 08:59:24 -07:00
2009-02-16 00:03:10 -08:00
2009-04-08 14:33:38 -07:00
2009-01-29 16:56:32 +09:00
2009-02-27 16:53:50 +09:00
2009-04-13 15:04:29 -07:00
2009-01-31 00:06:33 +05:30
2009-04-03 12:23:06 +02:00
2009-02-20 17:57:48 -08:00
2008-12-29 15:34:05 +02:00
2009-04-21 19:40:00 -07:00
2009-04-03 12:23:06 +02:00
2008-09-09 17:41:42 +02:00
2008-11-24 21:27:22 -08:00
2009-03-27 12:18:56 -04:00
2009-01-31 00:07:00 +05:30
2009-04-01 08:59:15 -07:00
2009-04-02 19:05:01 -07:00
2008-10-13 09:51:40 -07:00
2009-01-01 10:12:25 +10:30
2009-02-18 15:37:53 -08:00
2009-02-03 11:23:12 +11:00
2009-03-26 18:14:21 +01:00
2009-04-17 10:50:27 -07:00