[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/16] hurd: add proc_mark_important
From: |
Justus Winter |
Subject: |
[PATCH 06/16] hurd: add proc_mark_important |
Date: |
Mon, 5 Aug 2013 12:06:30 +0200 |
This is based on a fragment of Guillem Jovers patch presented here:
http://lists.gnu.org/archive/html/bug-hurd/2006-02/msg00081.html
It has been refreshed, updated and the copyright year is adjusted
properly. It has been complemented with the necessary features to
address the issues the original patch set out to address, namely
that killall5 freezes the proc translator before it tries to walk
over /proc/*/stat to decide which process to kill. Prior to this
patch (and the one marking the procfs server as important
process), killall5 would deadlock trying to walk over the proc
file system.
Ironically it would not have killed any process later on even if
it had the chance, since two values obtained from /proc/*/stat
are currently hardcoded to zero in our procfs. Patches addressing
the problem as a whole are prepared and will be sent as a follow
up.
* hurd/process.defs (proc_mark_important): New routine definitions.
* hurd/process_reply.defs (proc_mark_important_request): Likewise.
* hurd/process_request.defs (proc_mark_important_request): Likewise.
---
hurd/process.defs | 11 ++++++++++-
hurd/process_reply.defs | 9 ++++++++-
hurd/process_request.defs | 12 +++++++++++-
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/hurd/process.defs b/hurd/process.defs
index 95d63f5..055ad72 100644
--- a/hurd/process.defs
+++ b/hurd/process.defs
@@ -1,5 +1,5 @@
/* Definitions for process server interface
- Copyright (C) 1992,93,94,95,96,97,2001 Free Software Foundation
+ Copyright (C) 1992,93,94,95,96,97,2001,2013 Free Software Foundation
This file is part of the GNU Hurd.
@@ -378,3 +378,12 @@ routine proc_getnports (
routine proc_set_init_task (
process: process_t;
task: task_t);
+
+/* Inform the process server that the process is important. */
+routine proc_mark_important (
+ process: process_t);
+
+/* Query whether the process is important. */
+routine proc_is_important (
+ process: process_t;
+ out essential: boolean_t);
diff --git a/hurd/process_reply.defs b/hurd/process_reply.defs
index 3a946c7..6f208eb 100644
--- a/hurd/process_reply.defs
+++ b/hurd/process_reply.defs
@@ -1,5 +1,5 @@
/* Reply half of wait
- Copyright (C) 1991,93,94,96,2001 Free Software Foundation, Inc.
+ Copyright (C) 1991,93,94,96,2001,13 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -176,3 +176,10 @@ simpleroutine proc_getnports (
nports: mach_msg_type_number_t);
skip; /* proc_set_init_task */
+skip; /* proc_mark_important */
+
+simpleroutine proc_is_important (
+ reply_port: reply_port_t;
+ RETURN_CODE_ARG;
+ essential: boolean_t);
+
diff --git a/hurd/process_request.defs b/hurd/process_request.defs
index 5b87166..5493fbc 100644
--- a/hurd/process_request.defs
+++ b/hurd/process_request.defs
@@ -1,6 +1,6 @@
/* Definitions for process server interface (request-only version)
- Copyright (C) 1992, 93, 94, 95, 96, 98 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 98, 2013 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -380,3 +380,13 @@ simpleroutine proc_set_init_task_request (
process: process_t;
ureplyport reply: reply_port_t;
task: task_t);
+
+/* Inform the process server that the process is important. */
+simpleroutine proc_mark_important_request (
+ process: process_t;
+ ureplyport reply: reply_port_t);
+
+/* Query whether the process is important. */
+simpleroutine proc_is_important_request (
+ process: process_t;
+ ureplyport reply: reply_port_t);
--
1.7.10.4
- Make sysvinit pid 1, fix killall5, Justus Winter, 2013/08/05
- [PATCH 02/16] Define and use symbolic names for important processes, Justus Winter, 2013/08/05
- [PATCH 01/16] hurd: add missing routines in process_reply.defs, Justus Winter, 2013/08/05
- [PATCH 04/16] proc: make the function check_owner available, Justus Winter, 2013/08/05
- [PATCH 03/16] Add proc_set_init_task, make runsystem pid 1, Justus Winter, 2013/08/05
- [PATCH 05/16] proc: add proc_mark_important server code, Justus Winter, 2013/08/05
- [PATCH 06/16] hurd: add proc_mark_important,
Justus Winter <=
- [PATCH 07/16] init: Mark all of inits children and init itself as important, Justus Winter, 2013/08/05
- [PATCH 08/16] libdiskfs: register libdiskfs-based translators as important, Justus Winter, 2013/08/05
- [PATCH 09/16] libnetfs: register libnetfs-based translators as important, Justus Winter, 2013/08/05
- [PATCH 10/16] libtrivfs: register libtrivfs-based translators as important, Justus Winter, 2013/08/05
- [PATCH 11/16] mach-defpager: register mach-defpager translators as important, Justus Winter, 2013/08/05
- [PATCH 12/16] trans: register symlink translators as important, Justus Winter, 2013/08/05
- [PATCH 13/16] proc: keep track of {start,end}_code, Justus Winter, 2013/08/05
- [PATCH 14/16] hurd: add proc_{get,set}_code, Justus Winter, 2013/08/05
- [PATCH 15/16] exec: keep track of the range where executable segments are mapped, Justus Winter, 2013/08/05
- [PATCH 16/16] Build fixes: Build processUser.o and link against it, Justus Winter, 2013/08/05