Andrew Morton
71c5576fbd
revert "percpu counter: clean up percpu_counter_sum_and_set()"
...
Revert
commit 1f7c14c62c
Author: Mingming Cao <cmm@us.ibm.com >
Date: Thu Oct 9 12:50:59 2008 -0400
percpu counter: clean up percpu_counter_sum_and_set()
Before this patch we had the following:
percpu_counter_sum(): return the percpu_counter's value
percpu_counter_sum_and_set(): return the percpu_counter's value, copying
that value into the central value and zeroing the per-cpu counters before
returning.
After this patch, percpu_counter_sum_and_set() has gone, and
percpu_counter_sum() gets the old percpu_counter_sum_and_set()
functionality.
Problem is, as Eric points out, the old percpu_counter_sum_and_set()
functionality was racy and wrong. It zeroes out counters on "other" cpus,
without holding any locks which will prevent races agaist updates from
those other CPUS.
This patch reverts 1f7c14c62c . This means
that percpu_counter_sum_and_set() still has the race, but
percpu_counter_sum() does not.
Note that this is not a simple revert - ext4 has since started using
percpu_counter_sum() for its dirty_blocks counter as well.
Note that this revert patch changes percpu_counter_sum() semantics.
Before the patch, a call to percpu_counter_sum() will bring the counter's
central counter mostly up-to-date, so a following percpu_counter_read()
will return a close value.
After this patch, a call to percpu_counter_sum() will leave the counter's
central accumulator unaltered, so a subsequent call to
percpu_counter_read() can now return a significantly inaccurate result.
If there is any code in the tree which was introduced after
e8ced39d5e was merged, and which depends
upon the new percpu_counter_sum() semantics, that code will break.
Reported-by: Eric Dumazet <dada1@cosmosbay.com >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Mingming Cao <cmm@us.ibm.com >
Cc: <linux-ext4@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2008-12-10 08:01:52 -08:00
..
2008-10-20 08:52:40 -07:00
2008-12-03 15:52:35 -08:00
2008-10-17 17:15:43 -03:00
2008-10-22 01:19:37 +02:00
2008-10-04 17:12:27 -04:00
2008-11-12 17:17:18 -08:00
2008-11-28 21:29:46 -08:00
2008-11-08 21:37:46 +01:00
2008-11-05 14:40:25 +01:00
2008-11-24 16:06:17 -08:00
2008-10-08 11:35:19 +02:00
2008-10-08 11:35:00 +02:00
2008-09-29 17:56:56 -04:00
2008-10-21 13:25:28 +11:00
2008-10-13 21:51:51 +01:00
2008-10-30 11:38:47 -07:00
2008-11-10 13:50:19 -08:00
2008-10-15 15:54:56 -04:00
2008-10-20 16:07:19 +01:00
2008-11-11 21:15:50 -05:00
2008-10-20 11:01:52 -07:00
2008-10-16 11:21:51 -07:00
2008-10-10 22:39:31 +02:00
2008-12-09 02:27:41 -05:00
2008-10-16 11:21:39 -07:00
2008-10-16 11:21:39 -07:00
2008-10-20 08:50:25 -07:00
2008-10-20 08:52:42 -07:00
2008-10-16 11:21:38 -07:00
2008-11-06 08:41:55 +01:00
2008-10-23 08:20:34 -07:00
2008-04-29 08:11:16 -07:00
2008-12-05 14:49:18 -08:00
2008-10-17 08:46:57 +02:00
2006-12-07 08:39:20 -08:00
2008-10-20 08:52:32 -07:00
2008-11-12 17:17:18 -08:00
2008-08-14 22:59:43 +10:00
2008-10-21 07:47:22 -04:00
2008-10-20 08:52:34 -07:00
2008-10-30 11:38:45 -07:00
2008-10-16 11:21:32 -07:00
2008-09-05 11:11:51 +02:00
2008-11-09 11:17:33 -08:00
2005-04-16 15:20:36 -07:00
2008-11-30 11:00:15 -08:00
2008-10-14 10:35:08 +02:00
2005-04-16 15:20:36 -07:00
2008-10-14 12:12:02 -07:00
2008-05-27 10:11:36 +02:00
2008-09-08 19:25:24 +02:00
2008-10-09 13:52:43 -04:00
2008-11-09 21:09:54 +01:00
2008-11-19 18:49:58 -08:00
2008-10-23 18:51:22 +04:00
2005-04-16 15:20:36 -07:00
2008-07-22 17:30:57 -07:00
2008-10-23 05:13:16 -04:00
2008-10-23 10:23:07 -07:00
2008-10-22 20:21:31 +02:00
2008-10-13 09:51:43 -07:00
2008-10-21 17:45:06 +01:00
2008-10-18 14:29:15 +01:00
2008-10-16 16:53:04 +02:00
2008-10-13 16:05:06 +01:00
2008-10-15 12:46:51 +01:00
2008-10-16 09:24:47 -07:00
2008-10-16 16:53:13 +02:00
2008-10-09 08:56:13 +02:00
2008-10-12 12:05:55 +02:00
2008-02-07 08:42:30 -08:00
2008-08-07 02:22:08 -04:00
2008-07-24 10:47:29 -07:00
2008-10-16 11:21:30 -07:00
2008-10-20 08:52:37 -07:00
2008-10-16 11:21:30 -07:00
2008-10-20 08:52:36 -07:00
2005-04-16 15:20:36 -07:00
2008-10-09 08:56:19 +02:00
2008-05-16 17:22:26 -04:00
2008-10-08 19:44:18 -04:00
2008-10-21 07:47:06 -04:00
2008-10-15 22:21:11 +02:00
2005-04-16 15:20:36 -07:00
2008-10-30 11:38:45 -07:00
2008-12-04 04:22:58 -05:00
2008-10-31 00:59:46 -04:00
2008-10-21 07:47:06 -04:00
2008-10-23 16:00:24 +02:00
2008-10-16 16:08:57 +02:00
2008-07-20 17:12:36 -07:00
2008-11-18 15:08:56 +01:00
2006-09-30 01:47:55 +02:00
2008-10-16 11:21:40 -07:00
2008-10-27 15:06:01 +01:00
2008-10-14 23:51:02 +02:00
2008-11-27 23:39:48 +00:00
2008-11-12 09:54:40 +01:00
2008-10-23 13:52:40 +04:00
2008-10-22 20:21:30 +02:00
2007-10-13 23:56:32 +02:00
2008-10-17 17:25:11 -03:00
2008-10-22 20:21:33 +02:00
2008-10-16 11:21:38 -07:00
2008-10-24 12:54:18 -04:00
2008-10-15 16:03:01 -07:00
2008-12-02 20:40:03 +01:00
2008-12-01 19:55:25 -08:00
2008-09-24 16:18:02 -04:00
2008-10-13 19:01:08 -07:00
2008-10-13 19:01:08 -07:00
2008-10-13 19:01:08 -07:00
2008-09-22 21:28:11 -07:00
2008-10-01 01:30:19 -07:00
2008-10-09 11:59:55 -07:00
2008-11-04 14:49:57 -08:00
2008-09-22 21:28:11 -07:00
2008-10-13 19:01:08 -07:00
2008-10-01 07:30:02 -07:00
2008-07-09 12:09:28 -04:00
2008-10-07 15:34:37 -07:00
2008-10-29 22:02:09 +01:00
2005-04-16 15:20:36 -07:00
2008-11-15 12:26:44 -08:00
2008-11-13 10:31:36 +01:00
2008-10-18 14:29:15 +01:00
2008-10-20 13:23:01 -07:00
2008-11-03 18:21:45 +01:00
2008-07-03 13:21:14 +02:00
2008-10-16 11:21:33 -07:00
2008-10-16 15:17:40 -07:00
2008-10-15 14:24:08 +02:00
2008-08-15 09:26:14 +10:00
2007-04-25 22:25:31 -07:00
2008-02-08 09:22:23 -08:00
2006-10-04 00:31:09 -07:00
2008-07-21 13:41:16 -07:00
2008-11-23 10:52:45 +01:00
2008-10-21 15:54:40 +02:00
2008-10-12 09:37:01 -02:00
2008-10-16 20:00:24 -04:00
2008-10-23 08:55:01 -07:00
2008-10-16 11:21:32 -07:00
2008-10-16 11:21:31 -07:00
2008-10-20 08:52:40 -07:00
2007-04-04 21:12:47 -07:00
2008-10-20 13:23:01 -07:00
2008-11-15 11:43:37 -08:00
2008-10-12 11:44:37 -07:00
2008-10-09 08:56:04 +02:00
2007-05-17 05:23:04 -07:00
2008-10-16 11:21:29 -07:00
2008-07-24 10:47:17 -07:00
2008-10-14 10:34:22 +02:00
2008-04-30 08:29:54 -07:00
2008-10-28 14:21:34 +02:00
2008-10-28 14:22:15 +02:00
2008-09-23 22:01:33 +01:00
2008-10-20 22:34:12 +01:00
2008-12-01 13:49:27 -05:00
2008-05-16 14:50:49 -04:00
2007-07-17 10:23:03 -07:00
2008-10-14 10:35:08 +02:00
2008-11-13 23:19:10 -08:00
2008-02-06 10:41:03 -08:00
2008-10-13 09:47:43 +11:00
2008-10-09 08:56:06 +02:00
2008-10-10 23:16:16 -04:00
2008-10-14 10:39:28 +02:00
2008-10-20 08:52:39 -07:00
2008-11-30 10:03:38 -08:00
2006-03-26 08:57:00 -08:00
2008-10-20 08:50:25 -07:00
2008-10-20 08:52:31 -07:00
2008-10-20 08:52:39 -07:00
2008-10-20 08:52:30 -07:00
2008-10-14 10:37:17 +02:00
2008-10-20 08:52:39 -07:00
2008-10-29 00:51:25 +01:00
2008-10-22 10:00:23 +11:00
2008-10-22 10:00:23 +11:00
2008-10-16 11:21:30 -07:00
2008-11-06 15:41:21 -08:00
2008-10-23 05:13:20 -04:00
2008-11-19 18:49:57 -08:00
2008-10-30 23:54:35 -07:00
2008-10-08 11:35:01 +02:00
2008-10-01 07:03:24 -07:00
2008-10-06 20:08:26 -04:00
2008-10-17 13:06:45 -04:00
2008-10-07 17:22:20 -04:00
2008-10-14 19:23:17 -04:00
2007-10-17 21:17:42 -07:00
2008-10-13 10:55:47 +11:00
2008-10-21 15:17:48 +11:00
2008-11-30 10:03:35 -08:00
2008-10-20 08:52:30 -07:00
2008-10-20 08:52:32 -07:00
2008-10-20 08:50:26 -07:00
2008-10-16 11:21:49 -07:00
2008-10-13 10:10:37 -07:00
2008-10-22 16:42:43 -07:00
2008-10-23 10:20:36 -07:00
2008-10-22 16:42:35 -07:00
2008-11-03 14:31:18 -08:00
2008-12-10 08:01:52 -08:00
2008-10-05 13:33:42 -07:00
2008-10-26 23:07:25 -07:00
2008-01-23 19:33:58 -06:00
2008-10-08 16:38:41 -07:00
2008-10-16 11:21:48 -07:00
2008-10-16 09:24:51 -07:00
2008-10-16 11:21:30 -07:00
2008-10-23 00:11:07 -04:00
2008-09-05 21:35:03 -07:00
2008-09-24 15:45:48 +02:00
2008-06-11 21:00:38 -07:00
2007-10-19 20:35:04 +02:00
2008-10-23 18:54:05 +04:00
2008-10-23 08:55:01 -07:00
2008-10-20 08:52:39 -07:00
2008-09-02 19:21:38 -07:00
2008-10-16 11:21:46 -07:00
2008-10-16 11:21:46 -07:00
2008-04-19 19:10:33 -07:00
2008-10-02 15:53:13 -07:00
2007-02-12 09:48:44 -08:00
2008-11-12 17:17:17 -08:00
2008-10-03 10:36:08 +02:00
2008-09-30 12:08:41 +02:00
2008-01-30 13:31:47 +01:00
2008-10-21 07:49:04 -04:00
2008-10-16 11:21:30 -07:00
2008-10-30 11:38:45 -07:00
2008-11-11 15:02:04 -05:00
2008-10-20 08:52:40 -07:00
2008-07-26 12:00:12 -07:00
2008-10-16 11:21:30 -07:00
2008-09-22 19:51:15 -07:00
2008-12-01 19:55:24 -08:00
2008-12-02 15:50:40 -08:00
2007-10-16 09:43:17 -07:00
2008-07-25 10:53:42 -07:00
2008-10-20 08:52:39 -07:00
2008-11-12 12:29:56 +09:00
2008-02-26 14:52:45 +09:00
2008-10-13 09:51:40 -07:00
2008-10-01 16:13:54 +09:00
2008-10-07 14:22:33 -07:00
2008-11-13 20:49:02 +02:00
2008-09-23 08:09:13 -07:00
2008-10-22 07:00:38 -04:00
2008-11-06 09:05:33 +01:00
2008-10-05 11:16:16 -07:00
2008-02-03 17:45:46 +02:00
2006-10-04 07:55:30 -07:00
2008-10-03 18:22:18 -07:00
2007-05-08 11:15:18 -07:00
2008-08-26 00:19:27 +10:00
2008-10-03 11:46:14 -05:00
2008-11-02 10:15:07 -08:00
2008-10-20 08:52:40 -07:00
2008-10-20 08:52:31 -07:00
2008-10-16 11:21:28 -07:00
2008-11-19 18:49:57 -08:00
2008-10-16 11:21:47 -07:00
2008-10-20 08:52:42 -07:00
2008-10-16 11:21:32 -07:00
2006-12-07 08:39:34 -08:00
2008-10-07 14:43:06 -07:00
2008-11-11 09:30:23 -08:00
2008-10-13 09:51:40 -07:00
2008-10-17 18:13:38 +02:00
2008-10-22 09:48:06 +02:00
2008-11-06 08:42:48 +01:00
2008-09-24 17:33:13 +02:00
2006-10-18 19:55:22 -07:00
2008-11-07 16:09:23 +01:00
2008-09-05 14:39:38 -07:00
2008-10-14 10:39:31 +02:00
2008-10-13 09:51:43 -07:00
2008-07-20 17:12:34 -07:00
2008-10-13 09:51:44 -07:00
2008-10-21 07:47:06 -04:00
2007-10-19 11:53:42 -07:00
2008-11-13 14:45:00 -08:00
2005-04-16 15:20:36 -07:00
2007-12-26 19:36:35 -08:00
2008-10-21 14:31:15 -02:00
2008-07-27 11:07:12 -03:00
2008-10-23 15:48:28 +04:00
2008-10-23 17:35:04 +04:00
2008-10-13 09:51:42 -07:00
2008-10-16 11:21:31 -07:00
2008-10-02 22:48:34 +01:00
2008-11-06 09:05:33 +01:00
2008-10-16 10:09:17 -04:00
2008-10-05 13:33:42 -07:00