* Re: pause() [not found] <20000331151555.A5911@uni-koblenz.de> @ 2000-03-31 17:53 ` Florian Lohoff 2000-04-02 0:34 ` pause() Ralf Baechle 0 siblings, 1 reply; 4+ messages in thread From: Florian Lohoff @ 2000-03-31 17:53 UTC (permalink / raw) To: Ralf Baechle; +Cc: linux, linux-mips, linux-mips, aj On Fri, Mar 31, 2000 at 03:15:55PM +0200, Ralf Baechle wrote: > I just found another brainfart in the libc / kernel interface. In the > believe libc wouldn't use the pause(2) syscall any longer I removed it. > This makes a number of programs like screen burn all CPU they can get. > I'll provide two fixes, one to libc and a second for the kernel and > either one will be sufficient. Could this also be the cause of "top" refreshing the screen as fast as it can ? I noticed that when i rebuild the debian procps package and tried top ... It then consumes the cpu it gets ... Flo -- Florian Lohoff flo@rfc822.org +49-5241-470566 "Technology is a constant battle between manufacturers producing bigger and more idiot-proof systems and nature producing bigger and better idiots." ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pause() 2000-03-31 17:53 ` pause() Florian Lohoff @ 2000-04-02 0:34 ` Ralf Baechle 2000-04-02 12:22 ` pause() Ralf Baechle 0 siblings, 1 reply; 4+ messages in thread From: Ralf Baechle @ 2000-04-02 0:34 UTC (permalink / raw) To: Florian Lohoff; +Cc: linux, linux-mips, linux-mips, aj On Fri, Mar 31, 2000 at 07:53:03PM +0200, Florian Lohoff wrote: > On Fri, Mar 31, 2000 at 03:15:55PM +0200, Ralf Baechle wrote: > > I just found another brainfart in the libc / kernel interface. In the > > believe libc wouldn't use the pause(2) syscall any longer I removed it. > > This makes a number of programs like screen burn all CPU they can get. > > I'll provide two fixes, one to libc and a second for the kernel and > > either one will be sufficient. > > Could this also be the cause of "top" refreshing the screen as fast > as it can ? I noticed that when i rebuild the debian procps package > and tried top ... It then consumes the cpu it gets ... I haven't tried myself but sounds very probable. The sympthon is that an strace will show large numbers of pause(2) syscalls which all return with -ENOSYS as error. Ralf ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pause() 2000-04-02 0:34 ` pause() Ralf Baechle @ 2000-04-02 12:22 ` Ralf Baechle 2000-04-02 16:20 ` pause() Florian Lohoff 0 siblings, 1 reply; 4+ messages in thread From: Ralf Baechle @ 2000-04-02 12:22 UTC (permalink / raw) To: Florian Lohoff, linux, linux-mips, linux-mips, aj On Sun, Apr 02, 2000 at 02:34:25AM +0200, Ralf Baechle wrote: > > On Fri, Mar 31, 2000 at 03:15:55PM +0200, Ralf Baechle wrote: > > > I just found another brainfart in the libc / kernel interface. In the > > > believe libc wouldn't use the pause(2) syscall any longer I removed it. > > > This makes a number of programs like screen burn all CPU they can get. > > > I'll provide two fixes, one to libc and a second for the kernel and > > > either one will be sufficient. > > > > Could this also be the cause of "top" refreshing the screen as fast > > as it can ? I noticed that when i rebuild the debian procps package > > and tried top ... It then consumes the cpu it gets ... > > I haven't tried myself but sounds very probable. The sympthon is that > an strace will show large numbers of pause(2) syscalls which all return > with -ENOSYS as error. Ok, fix implemented and tested. I made sure that glibc now actually compiles even with 2.3.99-pre3 headers which stock 2.0 won't on any architecture. The full glibc patch is a bit too large to be posted to this list, so I'll just put it on oss.sgi.com after my arrival in Mountain View so that should be about Tuesday. The pause fix itself is a new pause(3) function which tries to use pause(2) where available. If that ever fails with ENOSYS then it will switch over to the emulation of the pause syscall. I'll also add the pause(2) syscall back to all kernel flavours which will ensure that either a libc or a kernel upgrade will fix the pause bug. This is the fix: New file glibc/sysdeps/unix/sysv/linux/mips/pause.c: /* Copyright (C) 1991, 1996, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <errno.h> #include <signal.h> #include <unistd.h> /* Suspend the process until a signal arrives. This always returns -1 and sets errno to EINTR. */ extern int __sys_pause(void); int __libc_pause (void) { static int must_emulate = 0; if (!must_emulate) { int errno_saved = errno; int retval = __sys_pause(); if (retval >= 0 || errno != ENOSYS) return retval; __set_errno(errno_saved); must_emulate = 1; } return __sigpause (__sigblock (0), 0); } weak_alias (__libc_pause, pause) Add an entry for pause in sysdeps/unix/sysv/linux/mips/syscalls.list: s_pause pause pause 0 __sys_pause This next libc release fixes all open bugs on my list except maybe a merge with all one of the inofficial 2.0.7 releases that have been made by non-FSF people. So if after the release there should still be open bugs, please report again. Ralf ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pause() 2000-04-02 12:22 ` pause() Ralf Baechle @ 2000-04-02 16:20 ` Florian Lohoff 0 siblings, 0 replies; 4+ messages in thread From: Florian Lohoff @ 2000-04-02 16:20 UTC (permalink / raw) To: Ralf Baechle; +Cc: linux, linux-mips, linux-mips, aj On Sun, Apr 02, 2000 at 02:22:45PM +0200, Ralf Baechle wrote: > The pause fix itself is a new pause(3) function which tries to use pause(2) > where available. If that ever fails with ENOSYS then it will switch over > to the emulation of the pause syscall. I'll also add the pause(2) syscall > back to all kernel flavours which will ensure that either a libc or a kernel > upgrade will fix the pause bug. This is the fix: As we are still quiet experimental and nobody else complained about pause syscall wouldnt it be overkill to do a pause emulation ? Just fix the kernel and other glibc bugs and document this in the MIPS-FAQ that people seeing this problem should upgrade to <blafasel>. > This next libc release fixes all open bugs on my list except maybe a merge > with all one of the inofficial 2.0.7 releases that have been made by > non-FSF people. So if after the release there should still be open bugs, > please report again. I have made a glibc 2.0.7 package (debian) from the original slink debian package + the mips patches - I have problems building without hacking as binarys like "zic" etc dont work with the old glibc installed natively (They are compiled against the fresh glibc and run with the old glibc something IIRC so they segfault - Makefile bugs). This package has not been used by me but other debian people afaik - Probably they should speak up and report problems/success. Flo -- Florian Lohoff flo@rfc822.org +49-5241-470566 "Technology is a constant battle between manufacturers producing bigger and more idiot-proof systems and nature producing bigger and better idiots." ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-04-02 16:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20000331151555.A5911@uni-koblenz.de>
2000-03-31 17:53 ` pause() Florian Lohoff
2000-04-02 0:34 ` pause() Ralf Baechle
2000-04-02 12:22 ` pause() Ralf Baechle
2000-04-02 16:20 ` pause() Florian Lohoff
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox