]> git.baikalelectronics.ru Git - kernel.git/commit
mm, kcsan: Enable barrier instrumentation
authorMarco Elver <elver@google.com>
Tue, 30 Nov 2021 11:44:28 +0000 (12:44 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 10 Dec 2021 00:42:28 +0000 (16:42 -0800)
commit3a05a05ea9acc227fb424a564fc51e9a0b84ff21
treef8d7d0c880c603a21689fb7ccf1a07d51ce92476
parent6038811a7ca3105572d95df0ee118c662af66f4f
mm, kcsan: Enable barrier instrumentation

Some memory management calls imply memory barriers that are required to
avoid false positives. For example, without the correct instrumentation,
we could observe data races of the following variant:

                   T0           |           T1
        ------------------------+------------------------
                                |
         *a = 42;    ---+       |
         kfree(a);      |       |
                        |       | b = kmalloc(..); // b == a
          <reordered> <-+       | *b = 42;         // not a data race!
                                |

Therefore, instrument memory barriers in all allocator code currently
not being instrumented in a default build.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
mm/Makefile