mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: inaky.perez-gonzalez@intel.com
To: linux-kernel@vger.kernel.org
Cc: inaky.perez-gonzalez@intel.com, robustmutexes@lists.osdl.org
Subject: [RFC/PATCH] FUSYN 9/10: stub for priority protection
Date: Wed, 14 Jan 2004 14:50:32 -0800	[thread overview]
Message-ID: <0401141450.1csdscaa2ckcVcJcZdDdhcfdocVdFabd9031@intel.com> (raw)
In-Reply-To: <0401141450.od8bZbVcfdkcKdCcXdtdZdFbcaNdraOc9031@intel.com>

 fulock-pp.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+)

--- /dev/null	Wed Jan 14 14:39:30 2004
+++ linux/kernel/fulock-pp.c	Wed Jan 14 11:13:33 2004
@@ -0,0 +1,66 @@
+
+/*
+ * Fast User real-time/pi/pp/robust/deadlock SYNchronization
+ * (C) 2002-2003 Intel Corp
+ * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>.
+ *
+ * Licensed under the FSF's GNU Public License v2 or later.
+ *
+ * Based on normal futexes (futex.c), (C) Rusty Russell.
+ * Please refer to Documentation/fusyn.txt for more info.
+ *
+ * Stuff for priority-protected fulocks
+ */
+
+#include <linux/fulock.h>
+#include <linux/plist.h>
+#include <linux/time.h>     /* struct timespec */
+#include <linux/sched.h>    /* MAX_SCHEDULE_TIMEOUT */
+#include <linux/errno.h>
+#include <linux/fulock.h>
+
+/**
+ * Check if a process is allowed to lock a PP fulock.
+ *
+ * @fulock: fulock to check on.
+ * @task:   Task to check for acquisition.
+ */
+int __fulock_pp_allowed (struct fulock *fulock)
+{
+	int policy = fulock->flags & FULOCK_FL_PP_PLC_MK > 20;
+	int priority = fulock->flags & FULOCK_FL_PP_PRIO_MK > 12;
+	int prio;
+
+	if (policy != SCHED_NORMAL)
+		prio = MAX_USER_RT_PRIO - 1 - priority;
+	else
+		prio = priority;
+	fulock->flags &= ~FULOCK_FL_PP_PRIO_MK;
+	fulock->flags |= prio & FULOCK_FL_PP_PRIO_MK;
+#warning FIXME: interaction with PI? Compare against static, not dynamic?
+	if (prio > current->prio)
+		return -EINVAL;
+	return 0;
+}
+
+
+/** FIXME */
+void __fulock_pp_boost (struct fulock *fulock)
+{
+#warning FIXME: finish me
+}
+
+
+/**
+ * Remove the boosting in priority of the owner of a
+ * priority-protected @fulock.
+ *
+ * @fulock: fulock whose owner's priority is to be boosted.
+ *
+ * If the fulock is a priority-protected lock, boost the priority of
+ * the owner to the fulock's priority ceiling.
+ */
+void __fulock_pp_unboost (struct fulock *fulock)
+{
+}
+

  reply	other threads:[~2004-01-14 22:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 22:49 [RFC/PATCH] FUSYN Realtime & Robust mutexes for Linux try 2.1 inaky.perez-gonzalez
2004-01-14 22:49 ` [RFC/PATCH] FUSYN 1/10: documentation files inaky.perez-gonzalez
2004-01-14 22:49   ` [RFC/PATCH] FUSYN 2/10: modifications to the core inaky.perez-gonzalez
2004-01-14 22:50     ` [RFC/PATCH] FUSYN 3/10: Support for i386 inaky.perez-gonzalez
2004-01-14 22:50       ` [RFC/PATCH] FUSYN 4/10: Support for ia64 inaky.perez-gonzalez
2004-01-14 22:50         ` [RFC/PATCH] FUSYN 5/10: kernel fuqueues inaky.perez-gonzalez
2004-01-14 22:50           ` [RFC/PATCH] FUSYN 6/10: user space/kernel space tracker inaky.perez-gonzalez
2004-01-14 22:50             ` [RFC/PATCH] FUSYN 7/10: user space fuqueues inaky.perez-gonzalez
2004-01-14 22:50               ` [RFC/PATCH] FUSYN 8/10: kernel fulocks inaky.perez-gonzalez
2004-01-14 22:50                 ` inaky.perez-gonzalez [this message]
2004-01-14 22:50                   ` [RFC/PATCH] FUSYN 10/10: user space fulocks inaky.perez-gonzalez
2004-01-15  1:12 ` [RFC/PATCH] FUSYN Realtime & Robust mutexes for Linux try 2.1 Bernhard Kuhn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0401141450.1csdscaa2ckcVcJcZdDdhcfdocVdFabd9031@intel.com \
    --to=inaky.perez-gonzalez@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robustmutexes@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®