public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] misc fixes
@ 2013-07-27 14:35 Tommi Rantala
  2013-07-27 14:35 ` [PATCH 1/2] Fix child crash when disabling some syscalls on biarch Tommi Rantala
  2013-07-27 14:35 ` [PATCH 2/2] Do not busy loop child processes on startup Tommi Rantala
  0 siblings, 2 replies; 3+ messages in thread
From: Tommi Rantala @ 2013-07-27 14:35 UTC (permalink / raw)
  To: davej; +Cc: trinity, Tommi Rantala

Greetings, two small trinity fixes this time.

Tommi Rantala (2):
  Fix child crash when disabling some syscalls on biarch
  Do not busy loop child processes on startup

 main.c    |  3 ++-
 syscall.c | 10 ++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Fix child crash when disabling some syscalls on biarch
  2013-07-27 14:35 [PATCH 0/2] misc fixes Tommi Rantala
@ 2013-07-27 14:35 ` Tommi Rantala
  2013-07-27 14:35 ` [PATCH 2/2] Do not busy loop child processes on startup Tommi Rantala
  1 sibling, 0 replies; 3+ messages in thread
From: Tommi Rantala @ 2013-07-27 14:35 UTC (permalink / raw)
  To: davej; +Cc: trinity, Tommi Rantala

Check if search_syscall_table() fails and returns -1. This avoids
crashing the child processes, that I was seeing on x86-64 with the
msgrcv() syscall.
---
 syscall.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/syscall.c b/syscall.c
index dc93b64..866ac71 100644
--- a/syscall.c
+++ b/syscall.c
@@ -112,8 +112,8 @@ long mkcall(int childno)
 {
 	unsigned long olda1, olda2, olda3, olda4, olda5, olda6;
 	unsigned int call = shm->syscallno[childno];
-	unsigned int call32, call64;
 	unsigned long ret = 0;
+	int call32, call64;
 	int errno_saved;
 	char string[512], *sptr;
 
@@ -292,10 +292,12 @@ args_done:
 			syscalls[call].entry->flags &= ~ACTIVE;
 		} else {
 			call32 = search_syscall_table(syscalls_32bit, max_nr_32bit_syscalls, syscalls[call].entry->name);
-			syscalls_32bit[call32].entry->flags &= ~ACTIVE;
+			if (call32 != -1)
+				syscalls_32bit[call32].entry->flags &= ~ACTIVE;
+
 			call64 = search_syscall_table(syscalls_64bit, max_nr_64bit_syscalls, syscalls[call].entry->name);
-			syscalls_64bit[call64].entry->flags &= ~ACTIVE;
-			output(1, "Disabled syscalls 32bit:%d 64bit:%d\n", call32, call64);
+			if (call64 != -1)
+				syscalls_64bit[call64].entry->flags &= ~ACTIVE;
 		}
 	}
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Do not busy loop child processes on startup
  2013-07-27 14:35 [PATCH 0/2] misc fixes Tommi Rantala
  2013-07-27 14:35 ` [PATCH 1/2] Fix child crash when disabling some syscalls on biarch Tommi Rantala
@ 2013-07-27 14:35 ` Tommi Rantala
  1 sibling, 0 replies; 3+ messages in thread
From: Tommi Rantala @ 2013-07-27 14:35 UTC (permalink / raw)
  To: davej; +Cc: trinity, Tommi Rantala

Stop busy looping the child processes on trinity startup, so that they
do not compete with the main process for CPU time.
---
 main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 1401de7..fefc4bf 100644
--- a/main.c
+++ b/main.c
@@ -143,7 +143,8 @@ static void fork_children(void)
 			}
 
 			/* Wait for all the children to start up. */
-			while (shm->ready == FALSE);
+			while (shm->ready == FALSE)
+				sleep(1);
 
 			init_child(pidslot);
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-27 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-27 14:35 [PATCH 0/2] misc fixes Tommi Rantala
2013-07-27 14:35 ` [PATCH 1/2] Fix child crash when disabling some syscalls on biarch Tommi Rantala
2013-07-27 14:35 ` [PATCH 2/2] Do not busy loop child processes on startup Tommi Rantala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox