From 84cbadadc6eafc4798513773a2c8fce37dcd2fb8 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 6 Jul 2017 07:02:24 -0400 Subject: lib: add errseq_t type and infrastructure for handling it An errseq_t is a way of recording errors in one place, and allowing any number of "subscribers" to tell whether an error has been set again since a previous time. It's implemented as an unsigned 32-bit value that is managed with atomic operations. The low order bits are designated to hold an error code (max size of MAX_ERRNO). The upper bits are used as a counter. The API works with consumers sampling an errseq_t value at a particular point in time. Later, that value can be used to tell whether new errors have been set since that time. Note that there is a 1 in 512k risk of collisions here if new errors are being recorded frequently, since we have so few bits to use as a counter. To mitigate this, one bit is used as a flag to tell whether the value has been sampled since a new value was recorded. That allows us to avoid bumping the counter if no one has sampled it since it was last bumped. Later patches will build on this infrastructure to change how writeback errors are tracked in the kernel. Signed-off-by: Jeff Layton Reviewed-by: NeilBrown Reviewed-by: Jan Kara --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'MAINTAINERS') diff --git a/MAINTAINERS b/MAINTAINERS index 9e984645c4b0..c2465dc21946 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4999,6 +4999,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git F: drivers/video/fbdev/s1d13xxxfb.c F: include/video/s1d13xxxfb.h +ERRSEQ ERROR TRACKING INFRASTRUCTURE +M: Jeff Layton +S: Maintained +F: lib/errseq.c +F: include/linux/errseq.h + ET131X NETWORK DRIVER M: Mark Einon S: Odd Fixes -- cgit v1.2.3-59-g8ed1b