linux-um archives
 help / color / mirror / Atom feed
From: "roland" <for_spam@gmx.de>
To: Laurent Vivier <LaurentVivier@wanadoo.fr>
Cc: user-mode-linux-devel@lists.sourceforge.net,
	Jeff Dike <jdike@addtoit.com>,
	blaisorblade_spam@yahoo.it, uml@hno.marasystems.com
Subject: [uml-devel] [PATCH] commandline switch for sysemu patch
Date: Sun, 23 May 2004 02:42:14 +0200	[thread overview]
Message-ID: <05e201c4405e$cebf6610$2000000a@schlepptopp> (raw)
In-Reply-To: 1085057350.1197.2.camel@chartreuse

[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]

hi !
I have enhanced laurents sysemu patch a little bit.

the attached patch adds an additional commandline-switch to uml.
if you specify "sysemu" on the commandline, it makes uml use sysemu, if
the host has the sysemu patch,too.
if you don`t specify it, uml doesn`t use sysemu at all.
this makes it easier to compare uml behaviour with and without sysemu (you
don`t need 2 different kernels for that purpose)

Laurent - if you like it, perhaps you could publish that on your website or
include it in your sysemu patch?

regards
roland

ps:
sorry - i have only done it for 2.6.6

pps:
since this is my first patch, maybe this is far from being perfect. feel free
to comment. :)


>Hi,
>
>I put all related information at this URL:
>
>http://perso.wanadoo.fr/laurent.vivier/UML
>
>I have modified the 2.4.24 patches to set PTRACE_SYSEMU to 31 too.
>This modification allows to use 2.4.24 UML on 2.6.6 host, and 2.6.6 UML
>on 2.4.24 host.
>
>Regards,
>Laurent
>
>Le jeu 20/05/2004 à 04:30, roland a écrit :
> Hi Laurent,
> i wondered about:
> "Checking syscall emulation patch for ptrace...missing"
>
> so  - i dig into this:
>
> the uml-patch needs to be adjusted to the fix you gave for the host patch:
> in arch/um/kernel/skas/include/ptrace-skas.h
> i changed :
> #define PTRACE_SYSEMU 25
> to
> #define PTRACE_SYSEMU 31
>
> whoha - now sysemu patch is running with 2.6.6  :)
>
> same positive effect: the getpid loop runs MUCH faster.
> i have tested some other commands and if i run a "vmstat 1" on the HOST,
> i can see the context-swap-rate drop down significantly.
>
> great!
>
> laurent, can you post the sysemu uml and host patch again in ONE mail,
> containing the corrected defines?
> others will probably have it easier this way!
> (maybe some notes about how it works and what it does would be helpful, too)
>
> thanks a lot!
>
> now we need some real-world performance tests/comparisons :)
> regards
> roland
>
> ps:
> i will do some more tests. maybe blaisorblade already wants to mention that
> patch in his 2.6 documentation at: http://www.user-mode-linux.org/~blaisorblade/ ?
>
>
>
>
>
>
> >in include/linux/ptrace.h ,
> >change
> >#define PTRACE_SCEMU            25
> >by
> >#define PTRACE_SCEMU            31
>
>
>
>
>
> ----- Original Message ----- 
> From: "Laurent Vivier" <LaurentVivier@wanadoo.fr>
> To: "roland" <for_spam@gmx.de>
> Cc: <user-mode-linux-devel@lists.sourceforge.net>
> Sent: Wednesday, May 19, 2004 9:49 PM
> Subject: Re: [uml-devel] [PATCH] host context switch reduction
>



[-- Attachment #2: sysemu_cmdline.patch --]
[-- Type: application/octet-stream, Size: 2294 bytes --]

--- linux-2.6.6/arch/um/kernel/process.c	2004-07-07 06:21:19.144801856 +0200
+++ linux-2.6.6/arch/um/kernel/process.c.sysemu	2004-07-07 06:21:09.136323376 +0200
@@ -41,6 +41,8 @@
 #include "skas_ptrace.h"
 #endif
 
+int sysemu_active=0;
+
 void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
 {
 	int flags = 0, pages;
@@ -230,12 +232,12 @@
 	printk("OK\n");
 
 #ifdef PTRACE_SYSEMU
-	printk("Checking syscall emulation patch for ptrace...");
+       printk("Checking syscall emulation patch for ptrace on HOST...");
 	use_sysemu = 0;
 	pid = start_ptraced_child(&stack);
 	if(ptrace(PTRACE_SYSEMU, pid, 0, 0) >= 0) {
-		struct user_regs_struct regs;
-
+  	 	struct user_regs_struct regs;
+ 
 		if (waitpid(pid, &status, WUNTRACED) < 0)
 			panic("check_ptrace : wait failed, errno = %d", errno);
 		if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP))
@@ -252,18 +254,44 @@
 
 		stop_ptraced_child(pid, stack, 0);
 
-		printk("OK\n");
-		use_sysemu = 1;
-	}
-	else
-	{
-		printk("missing\n");
+		printk("Found!\n");
+                printk("Syscall emulation is...");
+                if(sysemu_active) {
+         	 use_sysemu = 1;
+                 printk("On!\n"); 
+                }           
+                else {
+                 use_sysemu = 0;
+                 printk("Off!\n");  
+                }          
+     
+	 }
+	 else
+	 {
+	 	printk("Missing!\n");
+                if(sysemu_active) {
+                 printk("Notice: You cannot use syscall emulation on this host!\n");
+                }
 		stop_ptraced_child(pid, stack, 1);
-	}
-
+	 }
+        
+        
 # endif /* PTRACE_SYSEMU */
 }
 
+
+static void sysemufnc(char *str)
+{
+ sysemu_active=1;
+}
+
+__uml_setup("sysemu",sysemufnc,
+"sysemu\n    Turn syscall emulation patch for ptrace (SYSEMU) on.\n"
+"    SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\n"
+"    behaviour of ptrace() and helps reducing host context switch rate.\n"
+"    To make it working, you need a kernel patch for your host, too.\n"
+"    See http://perso.wanadoo.fr/laurent.vivier/UML/ for further information.\n\n");
+
 int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
 {
 	jmp_buf buf;

  reply	other threads:[~2004-05-23  0:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-29  4:35 [uml-devel] [PATCH] host context switch reduction Jeff Dike
2004-02-29 16:48 ` BlaisorBlade
2004-03-15 11:42 ` Sven 'Darkman' Michels
2004-03-15 19:13   ` Jeff Dike
2004-05-17 20:08 ` roland
2004-05-17 22:00   ` Laurent Vivier
2004-05-17 22:22     ` roland
2004-05-18 17:59       ` Jeff Dike
2004-05-19 17:27         ` Laurent Vivier
2004-05-19 18:01           ` roland
2004-05-19 18:17             ` Laurent Vivier
2004-05-19 19:39               ` roland
2004-05-19 19:49                 ` Laurent Vivier
2004-05-20  2:30                   ` roland
2004-05-20 12:49                     ` Laurent Vivier
2004-05-23  0:42                       ` roland [this message]
2004-05-23 13:31                       ` roland
2004-05-19 23:54               ` Jeff Dike
2004-05-20  1:01               ` roland
2004-05-20 14:12                 ` Henrik Nordstrom
2004-05-20 15:27                   ` roland
2004-05-20 15:35                     ` Henrik Nordstrom
2004-05-19 22:40           ` Nuno Silva
2004-05-20 18:28           ` roland
2004-05-20 18:47             ` Henrik Nordstrom
2004-05-27  6:16           ` Christopher S. Aker
2004-05-27  8:22             ` Laurent Vivier
2004-05-27  9:25               ` Christopher S. Aker
2004-05-27 11:50                 ` Laurent Vivier
2004-05-28  4:53                   ` [uml-devel] [PATCH] host context switch reduction Benchmarks Christopher S. Aker

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='05e201c4405e$cebf6610$2000000a@schlepptopp' \
    --to=for_spam@gmx.de \
    --cc=LaurentVivier@wanadoo.fr \
    --cc=blaisorblade_spam@yahoo.it \
    --cc=jdike@addtoit.com \
    --cc=uml@hno.marasystems.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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