linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* UML hang with 100% CPU
@ 2007-02-08 18:46 Miklos Szeredi
  2007-02-08 19:57 ` [uml-devel] " Jeff Dike
  0 siblings, 1 reply; 6+ messages in thread
From: Miklos Szeredi @ 2007-02-08 18:46 UTC (permalink / raw)
  To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel

Hi Jeff,

I'm having problems using 2.6.20 UML.  It's a long time I last tried,
so don't know which version this started with.

It boots fine, then usually just after logging in and before starting
the shell (but sometimes after the shell started) it gets into some
loop.  Looking at the strace shows that two processes are
sending/receiving single '\0' bytes on some sockets endlessly.

Does this ring a bell?

Thanks,
Miklos

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20
# Thu Feb  8 17:06:19 2007
#
CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig"
CONFIG_GENERIC_HARDIRQS=y
CONFIG_UML=y
CONFIG_MMU=y
# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_BUG=y
CONFIG_IRQ_RELEASE_METHOD=y

#
# UML-specific options
#
# CONFIG_STATIC_LINK is not set
CONFIG_MODE_SKAS=y

#
# Host processor type and features
#
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MCORE2 is not set
CONFIG_MPENTIUM4=y
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MGEODEGX1 is not set
# CONFIG_MGEODE_LX is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_X86_GENERIC is not set
CONFIG_X86_CMPXCHG=y
CONFIG_X86_XADD=y
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_GOOD_APIC=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
CONFIG_X86_TSC=y
CONFIG_UML_X86=y
# CONFIG_64BIT is not set
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_HOST_VMSPLIT_3G=y
# CONFIG_HOST_VMSPLIT_3G_OPT is not set
# CONFIG_HOST_VMSPLIT_2G is not set
# CONFIG_HOST_VMSPLIT_1G is not set
CONFIG_TOP_ADDR=0xC0000000
# CONFIG_3_LEVEL_PGTABLES is not set
CONFIG_STUB_CODE=0xbfffe000
CONFIG_STUB_DATA=0xbffff000
CONFIG_STUB_START=0xbfffe000
CONFIG_ARCH_HAS_SC_SIGNALS=y
CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_RESOURCES_64BIT is not set
CONFIG_LD_SCRIPT_DYN=y
CONFIG_NET=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_HOSTFS=y
# CONFIG_HPPFS is not set
CONFIG_MCONSOLE=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_NEST_LEVEL=0
# CONFIG_HIGHMEM is not set
CONFIG_KERNEL_STACK_ORDER=3
CONFIG_UML_REAL_TIME_CLOCK=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=128

#
# General setup
#
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
CONFIG_SLAB=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
# CONFIG_SLOB is not set

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
# CONFIG_KMOD is not set

#
# Block layer
#
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"

#
# Block devices
#
CONFIG_BLK_DEV_UBD=y
# CONFIG_BLK_DEV_UBD_SYNC is not set
CONFIG_BLK_DEV_COW_COMMON=y
# CONFIG_MMAPPER is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_ATA_OVER_ETH is not set

#
# Character Devices
#
CONFIG_STDERR_CONSOLE=y
CONFIG_STDIO_CONSOLE=y
# CONFIG_SSL is not set
# CONFIG_NULL_CHAN is not set
# CONFIG_PORT_CHAN is not set
# CONFIG_PTY_CHAN is not set
# CONFIG_TTY_CHAN is not set
CONFIG_XTERM_CHAN=y
CONFIG_NOCONFIG_CHAN=y
CONFIG_CON_ZERO_CHAN="fd:0,fd:1"
CONFIG_CON_CHAN="xterm"
CONFIG_SSL_CHAN="pty"
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_WATCHDOG is not set
# CONFIG_UML_SOUND is not set
# CONFIG_SOUND is not set
# CONFIG_HOSTAUDIO is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_UML_RANDOM is not set

#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_SYS_HYPERVISOR is not set

#
# Networking
#

#
# Networking options
#
# CONFIG_NETDEBUG is not set
# CONFIG_PACKET is not set
CONFIG_UNIX=y
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_FIB_HASH=y
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set

#
# DCCP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_DCCP is not set

#
# SCTP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_SCTP is not set

#
# TIPC Configuration (EXPERIMENTAL)
#
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_IEEE80211 is not set

#
# UML Network Devices
#
CONFIG_UML_NET=y
# CONFIG_UML_NET_ETHERTAP is not set
CONFIG_UML_NET_TUNTAP=y
# CONFIG_UML_NET_SLIP is not set
# CONFIG_UML_NET_DAEMON is not set
# CONFIG_UML_NET_MCAST is not set
# CONFIG_UML_NET_PCAP is not set
# CONFIG_UML_NET_SLIRP is not set

#
# Network device support
#
# CONFIG_NETDEVICES is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set

#
# Connector - unified userspace <-> kernelspace linker
#
# CONFIG_CONNECTOR is not set

#
# File systems
#
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
# CONFIG_EXT4DEV_FS is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=m

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
# CONFIG_CONFIGFS_FS is not set

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Network File Systems
#
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
# CONFIG_9P_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y

#
# Native Language Support
#
# CONFIG_NLS is not set

#
# Distributed Lock Manager
#
# CONFIG_DLM is not set

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

#
# Library routines
#
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC32 is not set
# CONFIG_LIBCRC32C is not set
CONFIG_PLIST=y

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
# CONFIG_INPUT is not set

#
# Kernel hacking
#
# CONFIG_PRINTK_TIME is not set
CONFIG_ENABLE_MUST_CHECK=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_DETECT_SOFTLOCKUP is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_RWSEMS is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
CONFIG_FRAME_POINTER=y
CONFIG_FORCED_INLINING=y
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_GPROF is not set
# CONFIG_GCOV is not set

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

* Re: [uml-devel] UML hang with 100% CPU
  2007-02-08 18:46 UML hang with 100% CPU Miklos Szeredi
@ 2007-02-08 19:57 ` Jeff Dike
  2007-02-08 20:13   ` Miklos Szeredi
  2007-02-08 21:02   ` Pekka Enberg
  0 siblings, 2 replies; 6+ messages in thread
From: Jeff Dike @ 2007-02-08 19:57 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-kernel, user-mode-linux-devel

On Thu, Feb 08, 2007 at 07:46:47PM +0100, Miklos Szeredi wrote:
> It boots fine, then usually just after logging in and before starting
> the shell (but sometimes after the shell started) it gets into some
> loop.  Looking at the strace shows that two processes are
> sending/receiving single '\0' bytes on some sockets endlessly.
> 
> Does this ring a bell?

No, it doesn't.  This is a strace on the host, I take it?

Can you get backtraces from the processes?

				Jeff

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

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

* Re: [uml-devel] UML hang with 100% CPU
  2007-02-08 19:57 ` [uml-devel] " Jeff Dike
@ 2007-02-08 20:13   ` Miklos Szeredi
  2007-02-15  0:22     ` Jeff Dike
  2007-02-08 21:02   ` Pekka Enberg
  1 sibling, 1 reply; 6+ messages in thread
From: Miklos Szeredi @ 2007-02-08 20:13 UTC (permalink / raw)
  To: jdike; +Cc: linux-kernel, user-mode-linux-devel

> No, it doesn't.  This is a strace on the host, I take it?

Yes.

> Can you get backtraces from the processes?

Here's one:

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7f0fbc3 in write () from /lib/tls/i686/cmov/libc.so.6
#2  0x08066f52 in file_io (fd=10, buf=0x8a0fc8b, len=1,
    io_proc=0x8056a68 <write@plt>,
    copy_user_proc=0x8059826 <copy_to_user_proc>)
    at arch/um/os-Linux/file.c:337
#3  0x08067002 in os_write_file (fd=10, buf=0x8a0fc8b, len=1)
    at arch/um/os-Linux/file.c:359
#4  0x08069317 in update_thread () at arch/um/os-Linux/sigio.c:127
#5  0x080694eb in add_sigio_fd (fd=8) at arch/um/os-Linux/sigio.c:183
#6  0x080581b2 in reactivate_fd (fd=8, irqnum=11) at arch/um/kernel/irq.c:290
#7  0x08059f5f in sigio_interrupt (irq=11, data=0x0)
    at arch/um/kernel/sigio.c:25
#8  0x08094759 in handle_IRQ_event (irq=11, action=0x8798380)
    at kernel/irq/handle.c:141
#9  0x080947fb in __do_IRQ (irq=11) at kernel/irq/handle.c:233
#10 0x0805829c in do_IRQ (irq=11, regs=0x879c3b0) at arch/um/kernel/irq.c:361
#11 0x08057e58 in sigio_handler (sig=29, regs=0x879c3b0)
    at arch/um/kernel/irq.c:105
#12 0x0806d31e in sig_handler_common_skas (sig=29, sc_ptr=0x0)
    at arch/um/os-Linux/skas/trap.c:52
#13 0x08069c8a in unblock_signals () at arch/um/os-Linux/signal.c:217
#14 0x0810500c in __make_request (q=0x8799a94, bio=0x895f8c0)
---Type <return> to continue, or q <return> to quit---
    at block/ll_rw_blk.c:3016
#15 0x08105433 in generic_make_request (bio=0x895f8c0)
    at block/ll_rw_blk.c:3212
#16 0x08105509 in submit_bio (rw=1, bio=0x895f8c0) at block/ll_rw_blk.c:3251
#17 0x080d09cb in submit_bh (rw=1, bh=0x9d5a8c0) at fs/buffer.c:2681
#18 0x080f8fcd in journal_do_submit_data (wbuf=0x8759000, bufs=3)
    at fs/jbd/commit.c:170
#19 0x080f90e0 in journal_submit_data_buffers (journal=0x88ff580,
    commit_transaction=0x8c07500) at fs/jbd/commit.c:275
#20 0x080f935c in journal_commit_transaction (journal=0x88ff580)
    at fs/jbd/commit.c:432
#21 0x080fba41 in kjournald (arg=0x88ff580) at fs/jbd/journal.c:151
#22 0x0808905a in kthread (_create=0x889fc4c) at kernel/kthread.c:105
#23 0x080690f1 in run_kernel_thread (fn=0x8088fb3 <kthread>, arg=0x889fc4c,
    jmp_ptr=0x879c688) at arch/um/os-Linux/process.c:289
#24 0x0805c975 in new_thread_handler () at arch/um/kernel/skas/process.c:64
#25 0x00000000 in ?? ()

And the other doesn't seem to be so interesting:

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7f157cb in poll () from /lib/tls/i686/cmov/libc.so.6
#2  0x0806913b in write_sigio_thread (unused=0x0)
    at arch/um/os-Linux/sigio.c:61
#3  0xb7f1f51e in clone () from /lib/tls/i686/cmov/libc.so.6

Strangely enough after continuing in gdb, UML is back to normal, and I
can't make it hang any more.  It must be something timing related.

Miklos


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

* Re: [uml-devel] UML hang with 100% CPU
  2007-02-08 19:57 ` [uml-devel] " Jeff Dike
  2007-02-08 20:13   ` Miklos Szeredi
@ 2007-02-08 21:02   ` Pekka Enberg
  1 sibling, 0 replies; 6+ messages in thread
From: Pekka Enberg @ 2007-02-08 21:02 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Miklos Szeredi, linux-kernel, user-mode-linux-devel

Hi,

On Thu, Feb 08, 2007 at 07:46:47PM +0100, Miklos Szeredi wrote:
> > It boots fine, then usually just after logging in and before starting
> > the shell (but sometimes after the shell started) it gets into some
> > loop.  Looking at the strace shows that two processes are
> > sending/receiving single '\0' bytes on some sockets endlessly.
> >
> > Does this ring a bell?

On 2/8/07, Jeff Dike <jdike@addtoit.com> wrote:
> No, it doesn't.  This is a strace on the host, I take it?
>
> Can you get backtraces from the processes?

Just a datapoint: I had a similar problem with UML hanging on
2.6.20-rc something _host_ kernel whereas 2.6.19 worked fine. That was
with Gentoo userspace which I don't have anymore.

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

* Re: [uml-devel] UML hang with 100% CPU
  2007-02-08 20:13   ` Miklos Szeredi
@ 2007-02-15  0:22     ` Jeff Dike
  2007-02-15 10:07       ` Miklos Szeredi
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Dike @ 2007-02-15  0:22 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-kernel, user-mode-linux-devel

On Thu, Feb 08, 2007 at 09:13:36PM +0100, Miklos Szeredi wrote:
> Strangely enough after continuing in gdb, UML is back to normal, and I
> can't make it hang any more.  It must be something timing related.

Can you see if the patch below fixes it?

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


Index: linux-2.6.18-mm/arch/um/os-Linux/sigio.c
===================================================================
--- linux-2.6.18-mm.orig/arch/um/os-Linux/sigio.c	2007-02-08 16:48:00.000000000 -0500
+++ linux-2.6.18-mm/arch/um/os-Linux/sigio.c	2007-02-14 19:16:22.000000000 -0500
@@ -97,20 +97,22 @@ static int write_sigio_thread(void *unus
 
 static int need_poll(struct pollfds *polls, int n)
 {
-	if(n <= polls->size){
-		polls->used = n;
+	struct pollfd *new;
+
+	if(n <= polls->size)
 		return 0;
-	}
-	kfree(polls->poll);
-	polls->poll = um_kmalloc_atomic(n * sizeof(struct pollfd));
-	if(polls->poll == NULL){
+
+	new = um_kmalloc_atomic(n * sizeof(struct pollfd));
+	if(new == NULL){
 		printk("need_poll : failed to allocate new pollfds\n");
-		polls->size = 0;
-		polls->used = 0;
 		return -ENOMEM;
 	}
+
+	memcpy(new, polls->poll, polls->used * sizeof(struct pollfd));
+	kfree(polls->poll);
+
+	polls->poll = new;
 	polls->size = n;
-	polls->used = n;
 	return 0;
 }
 
@@ -171,15 +173,15 @@ int add_sigio_fd(int fd)
 			goto out;
 	}
 
-	n = current_poll.used + 1;
-	err = need_poll(&next_poll, n);
+	n = current_poll.used;
+	err = need_poll(&next_poll, n + 1);
 	if(err)
 		goto out;
 
-	for(i = 0; i < current_poll.used; i++)
-		next_poll.poll[i] = current_poll.poll[i];
-
-	next_poll.poll[n - 1] = *p;
+	memcpy(next_poll.poll, current_poll.poll,
+	       current_poll.used * sizeof(struct pollfd));
+	next_poll.poll[n] = *p;
+	next_poll.used = n + 1;
 	update_thread();
  out:
 	sigio_unlock();
@@ -214,6 +216,7 @@ int ignore_sigio_fd(int fd)
 		if(p->fd != fd)
 			next_poll.poll[n++] = *p;
 	}
+	next_poll.used = current_poll.used - 1;
 
 	update_thread();
  out:
@@ -331,10 +334,9 @@ void maybe_sigio_broken(int fd, int read
 
 	sigio_lock();
 	err = need_poll(&all_sigio_fds, all_sigio_fds.used + 1);
-	if(err){
-		printk("maybe_sigio_broken - failed to add pollfd\n");
+	if(err)
 		goto out;
-	}
+
 	all_sigio_fds.poll[all_sigio_fds.used++] =
 		((struct pollfd) { .fd  	= fd,
 				   .events 	= read ? POLLIN : POLLOUT,

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

* Re: [uml-devel] UML hang with 100% CPU
  2007-02-15  0:22     ` Jeff Dike
@ 2007-02-15 10:07       ` Miklos Szeredi
  0 siblings, 0 replies; 6+ messages in thread
From: Miklos Szeredi @ 2007-02-15 10:07 UTC (permalink / raw)
  To: jdike; +Cc: linux-kernel, user-mode-linux-devel

> > Strangely enough after continuing in gdb, UML is back to normal, and I
> > can't make it hang any more.  It must be something timing related.
> 
> Can you see if the patch below fixes it?

Yay!  Got my nice fast UML back instead of ugly slow QEmu ;)

Seems to work perfectly now.

Thanks,
Miklos

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

end of thread, other threads:[~2007-02-15 10:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08 18:46 UML hang with 100% CPU Miklos Szeredi
2007-02-08 19:57 ` [uml-devel] " Jeff Dike
2007-02-08 20:13   ` Miklos Szeredi
2007-02-15  0:22     ` Jeff Dike
2007-02-15 10:07       ` Miklos Szeredi
2007-02-08 21:02   ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).