Jeff Dike | 1 Jun 01:39 2007

Re: [PATCH] Syslets - Fix cachemiss_thread return value

On Thu, May 31, 2007 at 03:07:16PM -0700, Zach Brown wrote:
> Can you explain what motivated you to send out this patch?
> 
> It used to return 0.  It was changed because, unlike the syslet
> syscalls, sys_io_submit() doesn't have a simple 0 value to indicate
> success.  The current implementation wants to return the number of iocbs
> that were processed, including the one which blocked, from the cachemiss
> thread.  So before calling into an operation it sets task_ret_ret() so
> that the cachemiss thread can return it if it takes over.
> task_ret_reg() is holding a return value that is being returned by the
> cachemiss thread on behalf of a sys_io_submit() which blocked.
> 
> When I made the change I didn't really audit its effect on the other
> paths.  I suppose it's time to do that, and you could help by telling me
> if you saw something bad happen :).

The bad thing was sys_async_exec returning -NOSYS every time a new
cachemiss thread was created.

Without this patch, you'll see sys_async_exec failures with either of
the demos I sent out.  Dunno about the existing ones, but I bet they do
the same.

				Jeff

--

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
(Continue reading)

Zach Brown | 1 Jun 02:00 2007
Picon

Re: [PATCH] Syslets - Fix cachemiss_thread return value

> the demos I sent out.  Dunno about the existing ones, but I bet they do
> the same.

Hmm, they didn't when I ran them, but I'll give yours a try and take a
closer look.  Thanks for taking the time to bring it up.

- z

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Jeff Dike | 3 Jun 19:15 2007

[PATCH] syslets demo - fix malloc failure check

Fix the stack malloc failure check.

Signed-off-by: Jeff Dike <jdike <at> linux.intel.com>
--
 syslets/async-test-v5/sys.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/syslets/async-test-v5/sys.h
===================================================================
--- linux-2.6.orig/syslets/async-test-v5/sys.h	2007-05-31 13:29:57.000000000 -0400
+++ linux-2.6/syslets/async-test-v5/sys.h	2007-06-03 13:12:43.000000000 -0400
 <at>  <at>  -108,9 +108,10  <at>  <at>  static u64 completion_ring[MAX_PENDING];

 static unsigned long thread_stack_alloc()
 {
-	void *stack = malloc(THREAD_STACK_SIZE) + THREAD_STACK_SIZE;
+	void *stack = malloc(THREAD_STACK_SIZE);
 	assert(stack != NULL);

+	stack += THREAD_STACK_SIZE;
 	pr("allocated stack: %p\n", stack);

 	return (unsigned long)stack;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
(Continue reading)

Antoine Martin | 4 Jun 12:49 2007
Picon

Re: Query ....


battipatisainagendra Bhavaniprasad wrote:
> I have been beating my head against the wall trying to get a working UML for several days, so any help is
greatly appreciated!I have downloaded
> "linux-2.6.16.tar" (which has UML patch In built) followed by the commands.....
> 
> 
> make defconfig ARCH=um
> 
> make ARCH=um
> 
> but i am getting the following errors...
> 
> arch/um/os-Linux/sys-i386/registers.c: In function 'get_thread_regs':
> 
> arch/um/os-Linux/sys-i386/registers.c:137: error: 'JB_PC' undeclared (first use in this function)
> arch/um/os-Linux/sys-i386/registers.c:137: error: (Each undeclared identifier is reported only once
> arch/um/os-Linux/sys-i386/registers.c:137: error: for each function it appears in.)
> 
> arch/um/os-Linux/sys-i386/registers.c:138: error: 'JB_SP' undeclared (first use in this function)
> arch/um/os-Linux/sys-i386/registers.c:139: error: 'JB_BP' undeclared (first use in this function)
> make[2]: *** [arch/um/os-Linux/sys-i386/registers.o] Error 1
> 
> make[1]: *** [arch/um/os-Linux/sys-i386] Error 2
> 
> Please help me.....
Search the archives, this problem was discussed before and there is a
patch for it.
But the easiest way to fix it is to use something more recent.
Try 2.6.21.3
(Continue reading)

Haifeng He | 5 Jun 01:50 2007
Picon

Error: F_SETLK failed, file already locked by pid 0

Hi, all
 
I was making some changes to UML kernel and my changes would cause the UML to
fail to run sometimes. My problem is, if my modified UML kernel fails, it causes the
filesystem loaded locked and can't be loaded again by other UML kernel. The error
message shows," F_SETLK failed, file already locked by pid 0".
 
I know there is already a description in the UML website but either the solutions seem
to be helpful in my case. I have killed all the processes related to UML but the file
is still locked. I can only either reboot the machine or make another copy of that file.
Is there other simple way to solve the problem?
 
Thanks
 
Haifeng
 
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Jeff Dike | 5 Jun 18:27 2007

Re: modprobe: Can't locate module scsi_debug

On Tue, May 29, 2007 at 08:37:44PM +0530, rajasekhar.pulluru <at> wipro.com wrote:
> Hi,
> Am a newbie to linux and UML. I have been trying to modprobe the
> scsi_debug,
> [root <at> mandrake82 host]# modprobe scsi_debug
> modprobe: Can't locate module scsi_debug
> 
> Could someone help me to modprobe successfully? 

You build the modules in the UML kernel pool, then copy them into the
UML filesystem - a good way is loop-mounting the UML filesystem and
doing a modules_install with the install directory being /lib in the
loopback mount.

> [root <at> mandrake82 2.4.20-8um]#

You might try something more modern than this - if you have any
trouble with it, no one will be able to help.

				Jeff

--

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Jeff Dike | 5 Jun 22:50 2007

[PATCH 1/2] UML - Fix request->sector update

[ This is post-2.6.22 material - it fixes a bug, but not one that I
think has been seen in the wild, plus an earlier version of this fix
caused file corruption ]

It is theoretically possible for a request to finish and be freed
between writing it to the I/O thread and updating the sector count.
In this case, the update will dereference a freed pointer.

To avoid this, I delay the update until processing the next sg
segment, when the request pointer is known to be good.

Signed-off-by: Jeff Dike <jdike <at> linux.intel.com>
--
 arch/um/drivers/ubd_kern.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.21-mm/arch/um/drivers/ubd_kern.c
===================================================================
--- linux-2.6.21-mm.orig/arch/um/drivers/ubd_kern.c	2007-06-02 12:13:50.000000000 -0400
+++ linux-2.6.21-mm/arch/um/drivers/ubd_kern.c	2007-06-02 22:23:41.000000000 -0400
 <at>  <at>  -1082,7 +1082,7  <at>  <at>  static void do_ubd_request(request_queue
 {
 	struct io_thread_req *io_req;
 	struct request *req;
-	int n;
+	int n, last_sectors;

 	while(1){
 		struct ubd *dev = q->queuedata;
 <at>  <at>  -1098,9 +1098,11  <at>  <at>  static void do_ubd_request(request_queue
 		}

 		req = dev->request;
+		last_sectors = 0;
 		while(dev->start_sg < dev->end_sg){
 			struct scatterlist *sg = &dev->sg[dev->start_sg];

+			req->sector += last_sectors;
 			io_req = kmalloc(sizeof(struct io_thread_req),
 					 GFP_ATOMIC);
 			if(io_req == NULL){
 <at>  <at>  -1112,6 +1114,7  <at>  <at>  static void do_ubd_request(request_queue
 					(unsigned long long) req->sector << 9,
 					sg->offset, sg->length, sg->page);

+			last_sectors = sg->length >> 9;
 			n = os_write_file(thread_fd, &io_req,
 					  sizeof(struct io_thread_req *));
 			if(n != sizeof(struct io_thread_req *)){
 <at>  <at>  -1123,7 +1126,6  <at>  <at>  static void do_ubd_request(request_queue
 				return;
 			}

-			req->sector += sg->length >> 9;
 			dev->start_sg++;
 		}
 		dev->end_sg = 0;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Jeff Dike | 5 Jun 22:50 2007

[PATCH 2/2] UML - Fix kernel stack size on x86_64

[ This is 2.6.22 material ]

Having KERNEL_STACK_ORDER in defconfig overrides the value provided by
Kconfig, breaking UML/x86_64, which wants 2 page stacks.

Signed-off-by: Jeff Dike <jdike <at> linux.intel.com>
--
 arch/um/defconfig |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6.21-mm/arch/um/defconfig
===================================================================
--- linux-2.6.21-mm.orig/arch/um/defconfig	2007-06-05 12:18:35.000000000 -0400
+++ linux-2.6.21-mm/arch/um/defconfig	2007-06-05 12:19:12.000000000 -0400
 <at>  <at>  -86,7 +86,6  <at>  <at>  CONFIG_MCONSOLE=y
 # CONFIG_MAGIC_SYSRQ is not set
 CONFIG_NEST_LEVEL=0
 # CONFIG_HIGHMEM is not set
-CONFIG_KERNEL_STACK_ORDER=0
 CONFIG_UML_REAL_TIME_CLOCK=y

 #

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Jeff Dike | 5 Jun 22:57 2007

[PATCH] UML - Improve host PTRACE_SYSEMU check

Make the PTRACE_SYSEMU checking more robust.  It will make sure that
system call numbers are reported correctly.  If there is a problem, it
will disable PTRACE_SYSEMU use and use PTRACE_SYSCALL instead.

This fixes a hang on boot on FC6 hosts with a broken PTRACE_SYSEMU.

Signed-off-by: Jeff Dike <jdike <at> linux.intel.com>
--
 arch/um/os-Linux/start_up.c |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

Index: linux-2.6.17/arch/um/os-Linux/start_up.c
===================================================================
--- linux-2.6.17.orig/arch/um/os-Linux/start_up.c	2007-06-05 16:53:41.000000000 -0400
+++ linux-2.6.17/arch/um/os-Linux/start_up.c	2007-06-05 16:54:21.000000000 -0400
 <at>  <at>  -144,9 +144,7  <at>  <at>  static int stop_ptraced_child(int pid, v
 		int exit_with = WEXITSTATUS(status);
 		if (exit_with == 2)
 			non_fatal("check_ptrace : child exited with status 2. "
-				  "Serious trouble happening! Try updating "
-				  "your host skas patch!\nDisabling SYSEMU "
-				  "support.");
+				  "\nDisabling SYSEMU support.\n");
 		non_fatal("check_ptrace : child exited with exitcode %d, while "
 			  "expecting %d; status 0x%x\n", exit_with,
 			  exitcode, status);
 <at>  <at>  -209,6 +207,7  <at>  <at>  __uml_setup("nosysemu", nosysemu_cmd_par
 static void __init check_sysemu(void)
 {
 	void *stack;
+	unsigned long regs[MAX_REG_NR];
 	int pid, n, status, count=0;

 	non_fatal("Checking syscall emulation patch for ptrace...");
 <at>  <at>  -225,11 +224,20  <at>  <at>  static void __init check_sysemu(void)
 		fatal("check_sysemu : expected SIGTRAP, got status = %d",
 		      status);

-	n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,
-		   os_getpid());
-	if(n < 0)
-		fatal_perror("check_sysemu : failed to modify system call "
-			     "return");
+	if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
+		fatal_perror("check_sysemu : PTRACE_GETREGS failed");
+	if(PT_SYSCALL_NR(regs) != __NR_getpid){
+		non_fatal("check_sysemu got system call number %d, "
+			  "expected %d...", PT_SYSCALL_NR(regs), __NR_getpid);
+		goto fail;
+	}
+
+	n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET, os_getpid());
+	if(n < 0){
+		non_fatal("check_sysemu : failed to modify system call "
+			  "return");
+		goto fail;
+	}

 	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
 		goto fail_stopped;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Andrew Morton | 6 Jun 02:00 2007

Re: [PATCH 2/2] UML - Fix kernel stack size on x86_64

On Tue, 5 Jun 2007 16:50:55 -0400
Jeff Dike <jdike <at> addtoit.com> wrote:

> [ This is 2.6.22 material ]
> 
> Having KERNEL_STACK_ORDER in defconfig overrides the value provided by
> Kconfig, breaking UML/x86_64, which wants 2 page stacks.
> 
> Signed-off-by: Jeff Dike <jdike <at> linux.intel.com>
> --
>  arch/um/defconfig |    1 -
>  1 file changed, 1 deletion(-)
> 
> Index: linux-2.6.21-mm/arch/um/defconfig
> ===================================================================
> --- linux-2.6.21-mm.orig/arch/um/defconfig	2007-06-05 12:18:35.000000000 -0400
> +++ linux-2.6.21-mm/arch/um/defconfig	2007-06-05 12:19:12.000000000 -0400
>  <at>  <at>  -86,7 +86,6  <at>  <at>  CONFIG_MCONSOLE=y
>  # CONFIG_MAGIC_SYSRQ is not set
>  CONFIG_NEST_LEVEL=0
>  # CONFIG_HIGHMEM is not set
> -CONFIG_KERNEL_STACK_ORDER=0
>  CONFIG_UML_REAL_TIME_CLOCK=y
>  

That means the Kconfig rules are wrong, surely?

Gmane