Commit Graph

6 Commits

Author SHA1 Message Date
ozaki-r
48f9f2189f Implement a debugging facility (overflow/underflow detection) for localcount
We cannot get an accurate count from a localcount instance because it consists
of per-cpu counters and we have no way to sum them up atomically. So we cannot
detect counter overflow/underflow as we can do on a normal refcount.

The facility adds an atomic counter to each localcount instance to enable the
validations. The counter ups and downs in synchronization with the per-CPU
counters. The counter is used iff both DEBUG and LOCKDEBUG are enabled in the
kernel.

Discussed on tech-kern@
2017-11-17 09:26:36 +00:00
riastradh
26bd73f202 Add heading comment for private localcount_adjust subroutine. 2017-06-12 21:08:34 +00:00
riastradh
44df486bb8 Move forward declaration to top of file.
Keep header comment above localcount_init adjoined to it.

No functional change.
2017-06-12 21:07:14 +00:00
chs
ffb3d80455 localcount_init() can't fail because percpu_alloc() can't fail.
remove the check and change the return type to void.
2017-06-02 00:32:12 +00:00
pgoyette
cb99404632 Fix a comment - in localcount_fini(), we don't care whether it was the
caller or some other code that drained the localcount;  all we care is
that it has been drained.
2017-05-19 02:20:24 +00:00
pgoyette
a372bceac2 Introduce new localcount(9) reference-count primitives. 2017-05-19 00:01:33 +00:00