From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: Emacs in CVS plus GTK patches hogs CPU Date: Wed, 8 Jan 2003 22:12:35 +0100 (MET) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030108211311.DFHC21.fep04-svc.swip.net@coolsville.localdomain> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1042062138 6949 80.91.224.249 (8 Jan 2003 21:42:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 8 Jan 2003 21:42:18 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18WNxp-0001nx-00 for ; Wed, 08 Jan 2003 22:42:17 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18WO33-0001Gk-00 for ; Wed, 08 Jan 2003 22:47:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WNtm-0000pq-02 for emacs-devel@quimby.gnus.org; Wed, 08 Jan 2003 16:38:06 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18WNjp-00058k-00 for emacs-devel@gnu.org; Wed, 08 Jan 2003 16:27:49 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18WNZb-0007dT-00 for emacs-devel@gnu.org; Wed, 08 Jan 2003 16:17:16 -0500 Original-Received: from fep04.swip.net ([130.244.199.132] helo=fep04-svc.swip.net) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WNVk-0006Ah-00 for emacs-devel@gnu.org; Wed, 08 Jan 2003 16:13:16 -0500 Original-Received: from coolsville.localdomain ([213.101.4.80]) by fep04-svc.swip.net with ESMTP <20030108211311.DFHC21.fep04-svc.swip.net@coolsville.localdomain>; Wed, 8 Jan 2003 22:13:11 +0100 Original-To: jas@extundo.com (Simon Josefsson) In-Reply-To: from "Simon Josefsson" at jan 08, 2003 09:40:24 X-Mailer: ELM [version 2.5 PL0pre8] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10589 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10589 > > "Jan D." writes: > > > Can you strace or truss the Emacs process to see if is in some sort of busy > > wait? A very short timeout perhaps? > > Yes, it is a busy wait: > > ... > kill(17005, SIGIO) = 0 > gettimeofday({1042058269, 284790}, NULL) = 0 > select(8, [3 7], NULL, NULL, {0, 451252}) = 1 (in [7], left {0, 453096}) > gettimeofday({1042058269, 284976}, NULL) = 0 > getpid() = 17005 > kill(17005, SIGIO) = 0 > gettimeofday({1042058269, 285079}, NULL) = 0 > select(8, [3 7], NULL, NULL, {0, 450963}) = 1 (in [7], left {0, 451143}) > gettimeofday({1042058269, 285265}, NULL) = 0 > getpid() = 17005 > kill(17005, SIGIO) = 0 > gettimeofday({1042058269, 285368}, NULL) = 0 > select(8, [3 7], NULL, NULL, {0, 450674}) = 1 (in [7], left {0, 451143}) > gettimeofday({1042058269, 285554}, NULL) = 0 > > This doesn't look GTK related, but rather network process related, > though. Hm. 17005 is the pid of the emacs process itself. Does GTK > catch SIGIO or something? I could not find anything in the GTK source. This looks like fd 7 is ready for reading everytime select is called and then select returns immediately. The X connection is usually a very low fd, 3 or 4 so I guess 3 is the X connection and 7 is some network connection that for example Gnus has open. Could it be that Gnus/Emacs doesn't read from it or perhaps it is closed at the other side, but Gnus/Emacs does not close this side? As seen above, there is no read between the selects even though 7 clearly is readable. You could try to start emacs, and strace it to see if this other fd 7 is opened with Gnus or something else. Jan D.