Lines Matching full:foo

243 For example, ASSERT_EXCLUSIVE_ACCESS(foo) tells KCSAN that any
244 concurrent access to variable foo by any other CPU is an error, even
246 ASSERT_EXCLUSIVE_WRITER(foo) tells KCSAN that although it is OK for there
247 to be concurrent reads from foo from other CPUs, it is an error for some
248 other CPU to be concurrently writing to foo, even if that concurrent
269 For example, suppose a shared variable "foo" is read only while a
274 int foo;
280 foo = newval;
291 ret = foo;
298 pr_info("Current value of foo: %d\n", data_race(foo));
302 bugs into any part of the main algorithm using foo, which means that
303 the accesses to foo within both update_foo() and read_foo() can (and
306 reads from or updates to foo. The data_race() in read_foo_diagnostic()
316 pr_info("Current value of foo: %d\n", data_race(READ_ONCE(foo)));
324 pr_info("Current value of foo: %d\n", READ_ONCE(foo));
330 the value of foo, you also need CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=n.
344 For another example, suppose a shared variable "foo" is updated only
348 int foo;
354 WRITE_ONCE(foo, newval);
355 ASSERT_EXCLUSIVE_WRITER(foo);
363 return READ_ONCE(foo);
366 Because foo is read locklessly, all accesses are marked. The purpose
382 struct foo {
387 /* All foo structures are in the following array. */
389 struct foo *foo_array;
391 void do_something_locked(struct foo *fp)
451 For this to work, only those foo structures in foo_array[] may be passed
454 every foo structure.
457 changes to a foo structure between calls to begin_global() and
467 For another example, suppose a shared variable "foo" is both read and
470 int foo;
476 ret = xchg(&foo, newval);
484 return READ_ONCE(foo);
487 Because foo is accessed locklessly, all accesses are marked. It does
490 flag any concurrent plain C-language reads from foo, and given
492 C-language writes to foo.
498 For yet another example, suppose that foo is initialized in a
500 that locklessly and concurrently access foo. Some snippets of this code
503 int foo;
509 foo = initval;
510 ASSERT_EXCLUSIVE_ACCESS(foo);
520 ret = xchg(&foo, newval);
529 return READ_ONCE(foo);
532 The initialize_foo() uses a plain C-language write to foo because there
547 int foo;
551 return xchg(&foo, newval);
558 newold = data_race(foo); /* Checked by cmpxchg(). */
562 newold = cmpxchg(&foo, old, new);
569 return READ_ONCE(foo);
577 int foo;
581 ASSERT_EXCLUSIVE_ACCESS(foo);
582 return xchg(&foo, newval);
589 newold = data_race(foo); /* Checked by cmpxchg(). */
593 ASSERT_EXCLUSIVE_ACCESS(foo);
594 newold = cmpxchg(&foo, old, new);
602 ASSERT_EXCLUSIVE_ACCESS(foo);
603 return READ_ONCE(foo);