• Marco Elver's avatar
    mm, kcsan: Enable barrier instrumentation · d37d1fa0
    Marco Elver authored
    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: default avatarMarco Elver <elver@google.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    d37d1fa0
Makefile 4.81 KB