Files
ack-tegra/include/linux
Peter Zijlstra 3c8ed88974 kref: Remove the memory barriers
Commit 1b0b3b9980 ("kref: fix CPU ordering with respect to krefs")
wrongly adds memory barriers to kref.

It states:

  some atomic operations are only atomic, not ordered. Thus a CPU is allowed
  to reorder memory references to an object to before the reference is
  obtained. This fixes it.

While true, it fails to show why this is a problem. I say it is not a
problem because if there is a race with kref_put() such that we could
end up referencing a free'd object without this memory barrier, we
would still have that race with the memory barrier.

The kref_put() in question could complete (and free the object) before
the atomic_inc() and we'd still be up shit creek.

The kref_init() case is even worse, if your object is published at this
time you're so wrong the memory barrier won't make a difference what
so ever. If its not published, the act of publishing should include
the needed barriers/locks to make sure all writes prior to the act of
publishing are complete such that others will only observe a complete
object.

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-13 09:11:19 -08:00
..
2011-11-07 09:11:16 -08:00
2011-11-02 16:07:03 -07:00
2011-10-26 15:43:25 -04:00
2011-08-03 11:30:42 -04:00
2011-09-27 09:25:02 +01:00
2011-10-31 17:30:44 -07:00
2011-08-25 16:25:33 -07:00
2011-11-02 12:53:43 +01:00
2011-10-02 00:19:34 +02:00
2011-10-31 20:19:04 +00:00
2011-09-14 15:24:51 -04:00
2011-08-08 16:08:08 +02:00
2011-10-30 04:43:30 -04:00
2011-09-27 18:08:04 +02:00
2011-12-13 09:11:19 -08:00
2011-09-25 19:52:59 +03:00
2011-10-30 12:24:05 +02:00
2011-09-16 19:20:20 -04:00
2011-11-02 16:06:57 -07:00
2011-11-02 16:06:58 -07:00
2011-10-31 11:51:28 -04:00
2011-10-31 14:03:22 +01:00
2011-11-02 16:07:02 -07:00
2011-10-28 15:03:52 +09:00
2011-10-31 17:30:47 -07:00
2011-08-16 00:16:49 -07:00
2011-08-03 14:25:22 -10:00
2011-10-31 17:30:44 -07:00
2011-11-02 16:07:02 -07:00
2011-10-03 14:01:21 -04:00
2011-08-23 10:10:38 -07:00
2011-11-02 16:07:02 -07:00
2011-09-14 15:24:51 -04:00