Whamcloud - gitweb
LU-14428 libcfs: separate daemon_list from cfs_trace_data
cfs_trace_data provides a fifo for trace messages. To minimize
locking, there is a separate fifo for each CPU, and even for different
interrupt levels per-cpu.
When a page is remove from the fifo to br written to a file, the page
is added to a "daemon_list". Trace message on the daemon_list have
already been logged to a file, but can be easily dumped to the console
when a bug occurs.
The daemon_list is always accessed from a single thread at a time, so
the per-CPU facilities for cfs_trace_data are not needed. However
daemon_list is currently managed per-cpu as part of cfs_trace_data.
This patch moves the daemon_list of pages out to a separate structure
- a simple linked list, protected by cfs_tracefile_sem.
Rather than using a 'cfs_trace_page' to hold linkage information and
content size, we use page->lru for linkage and page->private for
the size of the content in each page.
This is a step towards replacing cfs_trace_data with the Linux
ring_buffer which provides similar functionality with even less
locking.
In the current code, if the daemon which writes trace data to a file
cannot keep up with load, excess pages are moved to the daemon_list
temporarily before being discarded. With the patch, these page are
simply discarded immediately.
If the daemon thread cannot keep up, that is a configuration problem
and temporarily preserving a few pages is unlikely to really help.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie894f7751cadacb515215f18182163ea5d26e969
Reviewed-on: https://review.whamcloud.com/41493
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>