Commit 19d1a497 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/monitor: add support for recursive gate locking



Managing recursive mutexes is fully performed from userland in
libevl. However, by making the lock nesting count visible in the
shared state, we can have the kernel export it via /sysfs which may be
helpful to users.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent ff3979d7
......@@ -10,7 +10,7 @@
#include <linux/types.h>
#include <uapi/evl/sched.h>
#define EVL_ABI_LEVEL 11
#define EVL_ABI_LEVEL 12
#define EVL_CONTROL_DEV "/dev/evl/control"
......
......@@ -41,6 +41,8 @@ struct evl_monitor_state {
struct {
atomic_t owner;
__u32 ceiling;
__u32 recursive: 1,
nesting : 31;
} gate;
struct {
atomic_t value;
......
......@@ -896,9 +896,11 @@ static ssize_t state_show(struct device *dev,
if (fun != EVL_NO_HANDLE)
owner = evl_get_element_by_fundle(&evl_thread_factory,
fun, struct evl_thread);
ret = snprintf(buf, PAGE_SIZE, "%d %u\n",
ret = snprintf(buf, PAGE_SIZE, "%d %u %u\n",
owner ? evl_get_inband_pid(owner) : -1,
state->u.gate.ceiling);
state->u.gate.ceiling,
owner ? (state->u.gate.recursive ?
state->u.gate.nesting : 1) : 0);
if (owner)
evl_put_element(&owner->element);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment