Date: Fri, 13 Apr 2012 20:32:22 +0000 From: Alexander Best <arundel@freebsd.org> To: Jung-uk Kim <jkim@FreeBSD.org> Cc: freebsd-emulation@FreeBSD.org Subject: Re: [PATCH] pipe2 for Linuxulator Message-ID: <20120413203222.GA80646@freebsd.org> In-Reply-To: <201204102027.42344.jkim@FreeBSD.org> References: <201204101856.46591.jkim@FreeBSD.org> <201204101939.33201.jkim@FreeBSD.org> <201204102027.42344.jkim@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue Apr 10 12, Jung-uk Kim wrote: > On Tuesday 10 April 2012 07:39 pm, Jung-uk Kim wrote: > > On Tuesday 10 April 2012 06:56 pm, Jung-uk Kim wrote: > > > Th attached patch implements pipe2 syscall for Linuxulator, which > > > is quite trivial. Although it was added in Linux 2.6.27 (thanks, > > > netchild!), it is often used by popular Linux applications, e.g., > > > Adobe Flash plugin. Please note linux_pipe() was moved from MD > > > files to sys/compat/linux/linux_file.c because both amd64 and > > > i386 versions looked the same and I failed to see any reason. I > > > also changed file descriptor argument from l_ulong * to l_int *, > > > which seemed more appropriate. Any objections? > > > > Oops, I missed a patch for sys/kern/kern_descript.c: > > > > Index: sys/kern/kern_descrip.c > > =================================================================== > > --- sys/kern/kern_descrip.c (revision 234112) > > +++ sys/kern/kern_descrip.c (working copy) > > @@ -1681,6 +1681,8 @@ finstall(struct thread *td, struct file *fp, > > int * > > } > > fhold(fp); > > fdp->fd_ofiles[*fd] = fp; > > + if ((flags & O_NONBLOCK) != 0) > > + fp->f_flag |= FNONBLOCK; > > if ((flags & O_CLOEXEC) != 0) > > fdp->fd_ofileflags[*fd] |= UF_EXCLOSE; > > FILEDESC_XUNLOCK(fdp); > > > > > * PS: This patch is also available from here: > > > > > > http://people.freebsd.org/~jkim/linux_pipe2.diff > > > > This patch is updated with it. > > Oops, oops... I found that non-blocking does not really work because > finit() resets the flag later. The patch was re-done to set the > non-blocking flag correctly. > > I'm really sorry about the mess. i'm having problems with the patch. beforehand, playing music from www.mixcloud.com worked. now the flash based player is initialising forever. 'ps alx' says the following about the npviewer.bin task: UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND 1001 1044 1034 0 40 0 0 0 - Z - 0:00,05 <defunct> and procstat -a says: PID PPID PGID SID TSID THR LOGIN WCHAN EMUL COMM 0 0 0 0 0 11 - - - kernel 1 0 1 1 0 1 root wait FreeBSD ELF64 init 2 0 0 0 0 1 - ccb_scan - xpt_thrd 3 0 0 0 0 1 - psleep - pagedaemon 4 0 0 0 0 1 - psleep - vmdaemon 5 0 0 0 0 1 - pgzero - pagezero 6 0 0 0 0 1 - psleep - bufdaemon 7 0 0 0 0 1 - syncer - syncer 8 0 0 0 0 1 - vlruwt - vnlru 9 0 0 0 0 1 - sdflush - softdepflush 10 0 0 0 0 2 - - - idle 11 0 0 0 0 15 - - - intr 12 0 0 0 0 3 - - - geom 13 0 0 0 0 1 - - - yarrow 14 0 0 0 0 32 - - - usb 15 0 0 0 0 1 - - - schedcpu 325 1 325 325 0 1 root select FreeBSD ELF64 wpa_supplicant 429 1 429 429 0 1 root select FreeBSD ELF64 devd 616 1 616 616 0 1 root select FreeBSD ELF64 syslogd 680 1 680 680 0 1 root select FreeBSD ELF64 powerd 708 1 707 707 0 1 root nanslp FreeBSD ELF64 smartd 713 1 713 713 0 1 root select FreeBSD ELF64 dbus-daemon 725 1 725 725 0 3 root uwait FreeBSD ELF64 musicpd 730 1 730 730 0 1 root select FreeBSD ELF64 mpdscribble 771 1 771 771 0 1 root select FreeBSD ELF64 sendmail 774 1 774 774 0 1 root pause FreeBSD ELF64 sendmail 778 1 778 778 0 1 root nanslp FreeBSD ELF64 cron 788 1 788 788 0 1 root select FreeBSD ELF64 identd 816 1 816 816 816 1 arundel wait FreeBSD ELF64 login 817 1 817 817 817 1 root ttyin FreeBSD ELF64 getty 818 1 818 818 818 1 root ttyin FreeBSD ELF64 getty 819 1 819 819 819 1 root ttyin FreeBSD ELF64 getty 820 1 820 820 820 1 root ttyin FreeBSD ELF64 getty 821 1 821 821 821 1 root ttyin FreeBSD ELF64 getty 822 1 822 822 822 1 root ttyin FreeBSD ELF64 getty 823 1 823 823 823 1 root ttyin FreeBSD ELF64 getty 828 1 828 828 0 2 root piperd FreeBSD ELF64 hald 830 1 713 713 0 18 root waitvt FreeBSD ELF64 console-kit-daemon 832 1 713 713 0 2 root select FreeBSD ELF64 polkitd 834 1 833 833 0 1 root select FreeBSD ELF64 gam_server 835 828 828 828 0 1 root select FreeBSD ELF64 hald-runner 866 835 828 828 0 1 root kqread FreeBSD ELF64 hald-addon-mouse-sy 886 835 828 828 0 1 root select FreeBSD ELF64 hald-addon-storage 902 816 902 816 816 1 arundel pause FreeBSD ELF64 zsh 930 1 930 930 0 1 arundel select FreeBSD ELF64 ssh-agent 950 902 950 816 816 1 arundel wait FreeBSD ELF64 sh 968 950 950 816 816 1 arundel wait FreeBSD ELF64 xinit 969 968 969 816 816 1 arundel select FreeBSD ELF64 Xorg 972 968 972 816 816 1 arundel wait FreeBSD ELF64 sh 973 972 972 816 816 1 arundel kqread FreeBSD ELF64 awesome 977 1 972 816 816 1 arundel select FreeBSD ELF64 dbus-launch 978 1 978 978 0 1 arundel select FreeBSD ELF64 dbus-daemon 982 1 982 982 0 2 arundel piperd FreeBSD ELF64 sakura 983 982 982 982 0 1 arundel sbwait FreeBSD ELF64 gnome-pty-helper 984 982 984 984 984 1 arundel pause FreeBSD ELF64 zsh 986 1 986 986 0 1 arundel select FreeBSD ELF64 pidgin 989 984 989 984 984 1 arundel select FreeBSD ELF64 ssh 991 1 991 991 0 18 arundel uwait FreeBSD ELF64 chrome 992 991 991 991 0 1 arundel select FreeBSD ELF64 chrome 993 991 991 991 0 1 arundel sbwait FreeBSD ELF64 chrome 996 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 997 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 998 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1000 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1001 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1003 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1004 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1007 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1008 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1009 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1010 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1011 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1012 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1034 991 991 991 0 2 arundel kqread FreeBSD ELF64 chrome 1044 1034 991 991 0 1 arundel - Linux ELF32 npviewer.bin 1053 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1062 982 1062 1062 1062 1 arundel pause FreeBSD ELF64 zsh 1096 982 1096 1096 1096 1 arundel ttyin FreeBSD ELF64 zsh 1139 1062 1139 1062 1062 1 arundel - FreeBSD ELF64 procstat process 1044 was not killable via 'kill -9'. i had to wait for about a minute, until eventually some timeout was hit and the process was ended. eventually i managed to get the flash player to work. this might be related to your patch or it might have been a bug in the linux futex implementation, which has also caused some problems before your patch. now that the flash player is running 'procstat -a' reports: PID PPID PGID SID TSID THR LOGIN WCHAN EMUL COMM 0 0 0 0 0 11 - - - kernel 1 0 1 1 0 1 root wait FreeBSD ELF64 init 2 0 0 0 0 1 - ccb_scan - xpt_thrd 3 0 0 0 0 1 - psleep - pagedaemon 4 0 0 0 0 1 - psleep - vmdaemon 5 0 0 0 0 1 - pgzero - pagezero 6 0 0 0 0 1 - psleep - bufdaemon 7 0 0 0 0 1 - syncer - syncer 8 0 0 0 0 1 - vlruwt - vnlru 9 0 0 0 0 1 - sdflush - softdepflush 10 0 0 0 0 2 - - - idle 11 0 0 0 0 15 - - - intr 12 0 0 0 0 3 - - - geom 13 0 0 0 0 1 - - - yarrow 14 0 0 0 0 32 - - - usb 15 0 0 0 0 1 - - - schedcpu 325 1 325 325 0 1 root select FreeBSD ELF64 wpa_supplicant 429 1 429 429 0 1 root select FreeBSD ELF64 devd 616 1 616 616 0 1 root select FreeBSD ELF64 syslogd 680 1 680 680 0 1 root select FreeBSD ELF64 powerd 708 1 707 707 0 1 root nanslp FreeBSD ELF64 smartd 713 1 713 713 0 1 root select FreeBSD ELF64 dbus-daemon 725 1 725 725 0 3 root uwait FreeBSD ELF64 musicpd 730 1 730 730 0 1 root select FreeBSD ELF64 mpdscribble 771 1 771 771 0 1 root select FreeBSD ELF64 sendmail 774 1 774 774 0 1 root pause FreeBSD ELF64 sendmail 778 1 778 778 0 1 root nanslp FreeBSD ELF64 cron 788 1 788 788 0 1 root select FreeBSD ELF64 identd 816 1 816 816 816 1 arundel wait FreeBSD ELF64 login 817 1 817 817 817 1 root ttyin FreeBSD ELF64 getty 818 1 818 818 818 1 root ttyin FreeBSD ELF64 getty 819 1 819 819 819 1 root ttyin FreeBSD ELF64 getty 820 1 820 820 820 1 root ttyin FreeBSD ELF64 getty 821 1 821 821 821 1 root ttyin FreeBSD ELF64 getty 822 1 822 822 822 1 root ttyin FreeBSD ELF64 getty 823 1 823 823 823 1 root ttyin FreeBSD ELF64 getty 828 1 828 828 0 2 root piperd FreeBSD ELF64 hald 830 1 713 713 0 18 root waitvt FreeBSD ELF64 console-kit-daemon 832 1 713 713 0 2 root select FreeBSD ELF64 polkitd 834 1 833 833 0 1 root select FreeBSD ELF64 gam_server 835 828 828 828 0 1 root select FreeBSD ELF64 hald-runner 866 835 828 828 0 1 root kqread FreeBSD ELF64 hald-addon-mouse-sy 886 835 828 828 0 1 root select FreeBSD ELF64 hald-addon-storage 902 816 902 816 816 1 arundel pause FreeBSD ELF64 zsh 930 1 930 930 0 1 arundel select FreeBSD ELF64 ssh-agent 950 902 950 816 816 1 arundel wait FreeBSD ELF64 sh 968 950 950 816 816 1 arundel wait FreeBSD ELF64 xinit 969 968 969 816 816 1 arundel select FreeBSD ELF64 Xorg 972 968 972 816 816 1 arundel wait FreeBSD ELF64 sh 973 972 972 816 816 1 arundel kqread FreeBSD ELF64 awesome 977 1 972 816 816 1 arundel select FreeBSD ELF64 dbus-launch 978 1 978 978 0 1 arundel select FreeBSD ELF64 dbus-daemon 982 1 982 982 0 2 arundel piperd FreeBSD ELF64 sakura 983 982 982 982 0 1 arundel sbwait FreeBSD ELF64 gnome-pty-helper 984 982 984 984 984 1 arundel pause FreeBSD ELF64 zsh 986 1 986 986 0 1 arundel select FreeBSD ELF64 pidgin 989 984 989 984 984 1 arundel select FreeBSD ELF64 ssh 991 1 991 991 0 21 arundel uwait FreeBSD ELF64 chrome 992 991 991 991 0 1 arundel select FreeBSD ELF64 chrome 993 991 991 991 0 1 arundel sbwait FreeBSD ELF64 chrome 996 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 997 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 998 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1000 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1001 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1003 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1004 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1007 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1008 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1009 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1010 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1011 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1012 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1053 993 991 991 0 4 arundel usem FreeBSD ELF64 chrome 1062 982 1062 1062 1062 1 arundel pause FreeBSD ELF64 zsh 1096 982 1096 1096 1096 1 arundel ttyin FreeBSD ELF64 zsh 1197 991 991 991 0 2 arundel kqread FreeBSD ELF64 chrome 1207 1197 991 991 0 1 arundel select Linux ELF32 npviewer.bin 1234 1197 991 991 0 1 arundel futex Linux ELF32 npviewer.bin 1235 1197 991 991 0 1 arundel futex Linux ELF32 npviewer.bin 1236 1197 991 991 0 1 arundel futex Linux ELF32 npviewer.bin 1237 1197 991 991 0 1 arundel futex Linux ELF32 npviewer.bin 1238 1197 991 991 0 1 arundel futex Linux ELF32 npviewer.bin 1240 1197 991 991 0 1 arundel pcmwrv Linux ELF32 npviewer.bin 1246 1062 1246 1062 1062 1 arundel - FreeBSD ELF64 procstat just drop me a note with exact instructions and i can give you more verbose information or debugging stats. again: this issue might be futex related and not a result of your patch. cheers. alex > > Jung-uk Kim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120413203222.GA80646>