GNU bug report logs - #10404
[PATCH] Power: sleep longer than two seconds at a time

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Daniel Colascione <dancol@HIDDEN>; Keywords: patch help; dated Thu, 29 Dec 2011 23:44:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) help. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 10404 <at> debbugs.gnu.org:


Received: (at 10404) by debbugs.gnu.org; 13 Dec 2016 23:43:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 13 18:43:51 2016
Received: from localhost ([127.0.0.1]:41163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cGwjf-0003gD-Ld
	for submit <at> debbugs.gnu.org; Tue, 13 Dec 2016 18:43:51 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:54470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1cGwjd-0003g3-V5
 for 10404 <at> debbugs.gnu.org; Tue, 13 Dec 2016 18:43:50 -0500
Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories)
 by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <larsi@HIDDEN>)
 id 1cGwjX-0001sD-FT; Wed, 14 Dec 2016 00:43:47 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#10404: [PATCH] Power: sleep longer than two seconds at a time
References: <E1RgPZx-0008S8-CU@HIDDEN> <s74nd3utp6.fsf@HIDDEN>
 <834nd3kxhn.fsf@HIDDEN> <apfvv99fpv.fsf@HIDDEN>
 <87povlwbt7.fsf@HIDDEN> <vfwpf4aaoj.fsf@HIDDEN>
Date: Wed, 14 Dec 2016 00:43:43 +0100
In-Reply-To: <vfwpf4aaoj.fsf@HIDDEN> (Glenn Morris's message of
 "Mon, 12 Dec 2016 20:18:36 -0500")
Message-ID: <m3zijz4cpc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 10404
Cc: dancol@HIDDEN, 10404 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Glenn Morris <rgm@HIDDEN> writes:

> I don't see anything, unless I do something with the Emacs window, like
> move the cursor over it, or move another application's window over it.
>
> This report is 5 years old. It would be good to resolve it one way or
> the other. I'm not qualified to do so.

Yeah, I don't see it either on Debian Jessie, so it's presumably
something that's dependent on the distribution...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.

Message received at 10404 <at> debbugs.gnu.org:


Received: (at 10404) by debbugs.gnu.org; 13 Dec 2016 01:18:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 12 20:18:57 2016
Received: from localhost ([127.0.0.1]:39844 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cGbk9-0000l9-Fr
	for submit <at> debbugs.gnu.org; Mon, 12 Dec 2016 20:18:57 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54171)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1cGbk7-0000kv-Bv
 for 10404 <at> debbugs.gnu.org; Mon, 12 Dec 2016 20:18:55 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rgm@HIDDEN>) id 1cGbk1-0000gl-5T
 for 10404 <at> debbugs.gnu.org; Mon, 12 Dec 2016 20:18:50 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37497)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1cGbjo-0000ei-So; Mon, 12 Dec 2016 20:18:36 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1cGbjo-000870-C4; Mon, 12 Dec 2016 20:18:36 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#10404: [PATCH] Power: sleep longer than two seconds at a time
References: <E1RgPZx-0008S8-CU@HIDDEN> <s74nd3utp6.fsf@HIDDEN>
 <834nd3kxhn.fsf@HIDDEN> <apfvv99fpv.fsf@HIDDEN>
 <87povlwbt7.fsf@HIDDEN>
X-Spook: Bruxelles Outbreak USCODE Project Monarch Phishing Soviet
X-Ran: Xy"mjo))0wQ)NeSr$L-QH}tZE5?L1R.<whyy>TD6Gw8#`PoqO{D\Gr}[[NM05+cB-Mt_(R
X-Hue: cyan
X-Attribution: GM
Date: Mon, 12 Dec 2016 20:18:36 -0500
In-Reply-To: <87povlwbt7.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 25 Feb 2016 16:50:36 +1030")
Message-ID: <vfwpf4aaoj.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.1 (--------)
X-Debbugs-Envelope-To: 10404
Cc: dancol@HIDDEN, 10404 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.1 (--------)

Lars Ingebrigtsen wrote:

> If I start "emacs -Q" and strace it, I see basically the following every
> couple of seconds.
>
> [pid  8439] --- SIGIO {si_signo=SIGIO, si_code=SI_KERNEL} ---
> [pid  8439] rt_sigreturn()              = 1
> [pid 8439] recvmsg(9, {msg_name(0)=NULL, msg_iov(1)=[{"\241
> \33\f\263\0\340\3!\1\0\0.\1\0\0000\5\0\0\263\0\340\3\0\0\0\0\0\0\0\0",
> 4096}], msg_controllen=0, msg_flags=0}, 0) = 32
> [pid 8439] recvmsg(9, 0x7ffda37f3120, 0) = -1 EAGAIN (Resource
> temporarily unavailable)
> [pid 8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9,
> events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
> [pid 8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9,
> events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
> [pid 8439] poll([{fd=9, events=POLLIN|POLLOUT}], 1, 4294967295) = 1
> ([{fd=9, revents=POLLOUT}])
> [pid 8439] writev(9, [{"\31\0\v\0\366\0\0\0\0\0\30\0!
> \0\0\366\0\0\0!\1\0\0.\1\0\0000\5\0\0"..., 44}, {NULL, 0}, {"", 0}],
> 3) = 44
> [pid 8439] recvmsg(9, 0x7ffda37f2ff0, 0) = -1 EAGAIN (Resource
> temporarily unavailable)
> [pid 8439] recvmsg(9, 0x7ffda37f3120, 0) = -1 EAGAIN (Resource
> temporarily unavailable)
> [pid 8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9,
> events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
> [pid 8439] recvmsg(9, 0x7ffda37f3340, 0) = -1 EAGAIN (Resource
> temporarily unavailable)
> [pid 8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9,
> events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
> [pid 8439] pselect6(14, [6 8 9 13], [], NULL, {100000, 0}, {NULL, 8})
> = 1 (in [9], left {99998, 551877999})
>
> So something is polling and stuff on Linux, at least...


I don't see anything, unless I do something with the Emacs window, like
move the cursor over it, or move another application's window over it.

This report is 5 years old. It would be good to resolve it one way or
the other. I'm not qualified to do so.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.

Message received at 10404 <at> debbugs.gnu.org:


Received: (at 10404) by debbugs.gnu.org; 25 Feb 2016 06:21:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 25 01:21:07 2016
Received: from localhost ([127.0.0.1]:44600 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aYpIR-0000ag-2h
	for submit <at> debbugs.gnu.org; Thu, 25 Feb 2016 01:21:07 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:58571)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <larsi@HIDDEN>) id 1aYpIP-0000aW-Gf
 for 10404 <at> debbugs.gnu.org; Thu, 25 Feb 2016 01:21:05 -0500
Received: from [175.103.25.178] (helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <larsi@HIDDEN>)
 id 1aYpI1-0004Vn-Ia; Thu, 25 Feb 2016 07:20:42 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#10404: [PATCH] Power: sleep longer than two seconds at a time
References: <E1RgPZx-0008S8-CU@HIDDEN> <s74nd3utp6.fsf@HIDDEN>
 <834nd3kxhn.fsf@HIDDEN> <apfvv99fpv.fsf@HIDDEN>
Date: Thu, 25 Feb 2016 16:50:36 +1030
In-Reply-To: <apfvv99fpv.fsf@HIDDEN> (Glenn Morris's message of
 "Sat, 20 Jul 2013 15:46:52 -0400")
Message-ID: <87povlwbt7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1aYpI1-0004Vn-Ia
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1456986042.52473@cPNabrzV5t4gjJKi/2d2XQ
X-Spam-Status: No
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 10404
Cc: dancol@HIDDEN, 10404 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Glenn Morris <rgm@HIDDEN> writes:

> Comments from Jan in
> http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00540.html
>
>     I don't know, I haven't seen this 2 second polling that is mentioned
>     (with strace/dtruss). When the cursor stops blinking, there is a 30
>     second timeout, and after that a very long timeout (thousands of
>     seconds, I don't have the exact value). But on the other hand, I was
>     not running Lisp at the time.
>
> I don't know where that leaves this patch.
> (See also comments in http://debbugs.gnu.org/10404#11 )

If I start "emacs -Q" and strace it, I see basically the following every
couple of seconds.

[pid  8439] --- SIGIO {si_signo=SIGIO, si_code=SI_KERNEL} ---
[pid  8439] rt_sigreturn()              = 1
[pid  8439] recvmsg(9, {msg_name(0)=NULL, msg_iov(1)=[{"\241 \33\f\263\0\340\3!\1\0\0.\1\0\0000\5\0\0\263\0\340\3\0\0\0\0\0\0\0\0", 4096}], msg_controllen=0, msg_flags=0}, 0) = 32
[pid  8439] recvmsg(9, 0x7ffda37f3120, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid  8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
[pid  8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
[pid  8439] poll([{fd=9, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=9, revents=POLLOUT}])
[pid  8439] writev(9, [{"\31\0\v\0\366\0\0\0\0\0\30\0! \0\0\366\0\0\0!\1\0\0.\1\0\0000\5\0\0"..., 44}, {NULL, 0}, {"", 0}], 3) = 44
[pid  8439] recvmsg(9, 0x7ffda37f2ff0, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid  8439] recvmsg(9, 0x7ffda37f3120, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid  8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
[pid  8439] recvmsg(9, 0x7ffda37f3340, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid  8439] poll([{fd=6, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=13, events=POLLIN}], 4, 0) = 0 (Timeout)
[pid  8439] pselect6(14, [6 8 9 13], [], NULL, {100000, 0}, {NULL, 8}) = 1 (in [9], left {99998, 551877999})

So something is polling and stuff on Linux, at least...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.

Message received at 10404 <at> debbugs.gnu.org:


Received: (at 10404) by debbugs.gnu.org; 20 Jul 2013 19:46:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 15:46:55 2013
Received: from localhost ([127.0.0.1]:40062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V0d7H-0000PI-10
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2013 15:46:55 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:43276 ident=Debian-exim)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1V0d7F-0000PA-5o
 for 10404 <at> debbugs.gnu.org; Sat, 20 Jul 2013 15:46:53 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1V0d7E-0003sh-K9; Sat, 20 Jul 2013 15:46:52 -0400
From: Glenn Morris <rgm@HIDDEN>
To: dancol@HIDDEN
Subject: Re: bug#10404: [PATCH] Power: sleep longer than two seconds at a time
References: <E1RgPZx-0008S8-CU@HIDDEN> <s74nd3utp6.fsf@HIDDEN>
 <834nd3kxhn.fsf@HIDDEN>
X-Spook: doctrine computer terrorism ICE NATO kilo class MDA spies
X-Ran: F>k%>4J*xR%Q00Iz^~D=2)zd-I|e?Y]Ynh\uWK1GGOkR+sa'(duRZ!.*9ym0YbRkY>,|nQ
X-Hue: blue
X-Attribution: GM
Date: Sat, 20 Jul 2013 15:46:52 -0400
In-Reply-To: <834nd3kxhn.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 12 Jun
 2013 21:14:12 +0300")
Message-ID: <apfvv99fpv.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -5.4 (-----)
X-Debbugs-Envelope-To: 10404
Cc: 10404 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.4 (-----)


Comments from Jan in
http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00540.html

    I don't know, I haven't seen this 2 second polling that is mentioned
    (with strace/dtruss). When the cursor stops blinking, there is a 30
    second timeout, and after that a very long timeout (thousands of
    seconds, I don't have the exact value). But on the other hand, I was
    not running Lisp at the time.

I don't know where that leaves this patch.
(See also comments in http://debbugs.gnu.org/10404#11 )




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.

Message received at 10404 <at> debbugs.gnu.org:


Received: (at 10404) by debbugs.gnu.org; 12 Jun 2013 18:14:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 12 14:14:15 2013
Received: from localhost ([127.0.0.1]:59241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UmpYl-0002F1-4z
	for submit <at> debbugs.gnu.org; Wed, 12 Jun 2013 14:14:15 -0400
Received: from mtaout20.012.net.il ([80.179.55.166]:40843)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1UmpYh-0002Ea-Sq
 for 10404 <at> debbugs.gnu.org; Wed, 12 Jun 2013 14:14:14 -0400
Received: from conversion-daemon.a-mtaout20.012.net.il by
 a-mtaout20.012.net.il (HyperSendmail v2007.08) id
 <0MOA00600L9IH600@HIDDEN> for 10404 <at> debbugs.gnu.org;
 Wed, 12 Jun 2013 21:14:05 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0MOA006XYLBGG910@HIDDEN>;
 Wed, 12 Jun 2013 21:14:05 +0300 (IDT)
Date: Wed, 12 Jun 2013 21:14:12 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#10404: [PATCH] Power: sleep longer than two seconds at a time
In-reply-to: <s74nd3utp6.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Glenn Morris <rgm@HIDDEN>
Message-id: <834nd3kxhn.fsf@HIDDEN>
References: <E1RgPZx-0008S8-CU@HIDDEN> <s74nd3utp6.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 10404
Cc: 10404 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Glenn Morris <rgm@HIDDEN>
> Date: Wed, 12 Jun 2013 13:25:57 -0400
> 
> 
> This sounds like a good idea.
> Does anyone have any comments?

We don't use sigblock or sigsetmask, I believe because they are
obsolescent.  We use sigprocmask instead.

The other comment is that these changes ignore the MS-Windows
implementation of SIGALRM.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.

Message received at 10404 <at> debbugs.gnu.org:


Received: (at 10404) by debbugs.gnu.org; 12 Jun 2013 17:26:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 12 13:26:01 2013
Received: from localhost ([127.0.0.1]:59173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Umoo5-0008HZ-4h
	for submit <at> debbugs.gnu.org; Wed, 12 Jun 2013 13:26:01 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:45901 ident=Debian-exim)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1Umoo3-0008HN-Ej
 for 10404 <at> debbugs.gnu.org; Wed, 12 Jun 2013 13:25:59 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1Umoo2-0006eL-AJ; Wed, 12 Jun 2013 13:25:58 -0400
From: Glenn Morris <rgm@HIDDEN>
To: 10404 <at> debbugs.gnu.org
Subject: Re: bug#10404: [PATCH] Power: sleep longer than two seconds at a time
References: <E1RgPZx-0008S8-CU@HIDDEN>
X-Spook: SWAT kibo target South Africa Craig Livingstone embassy
X-Ran: k#Zb-(G)8[p),0V2~_Kt74&`u"}vh&daK?dN2Z}UW\`_[h{'m>YON%EB0SR:wPO<{pFBJB
X-Hue: yellow
X-Attribution: GM
Date: Wed, 12 Jun 2013 13:25:57 -0400
In-Reply-To: <E1RgPZx-0008S8-CU@HIDDEN> (Daniel Colascione's message of
 "Thu, 29 Dec 2011 15:40:09 -0800")
Message-ID: <s74nd3utp6.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -4.5 (----)
X-Debbugs-Envelope-To: 10404
Cc: Daniel Colascione <dancol@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.5 (----)


This sounds like a good idea.
Does anyone have any comments?

Daniel Colascione wrote:

> Emacs uses an atimer to poll for input every so often so it can detect
> C-g presses while lisp code is running; atimer arranges for this polling
> to be done by having a SIGALRM delivered every so often --- by default,
> every two seconds.  But while lisp code is not running and emacs is
> blocked in select() [or a platform-specific analogue], we want to
> stop this polling to save power: we don't need it because the select
> will return as soon as there's input.
>
> Emacs has code that's meant to turn off atimers while we wait for
> input --- wait_reading_process_output calls stop_polling and
> turn_on_atimers (0).  But time ago, we started calling redisplay
> code inside the select loop, and this select code turns atimers
> back on.  The effect is that we don't sleep longer than two second
> at a time.
>
> This patch turns off SIGALRM delivery around select, making sure that
> we stay asleep.  With this patch (and blink-cursor-mode off), Emacs
> will process input, then sleep for 30 seconds, and if no input
> arrives in that time, will sleep for several hours.  The patch
> does not adversely any functionality.
> ---
>  src/process.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/src/process.c b/src/process.c
> index 5c8eef7..f81a5c4 100644
> --- a/src/process.c
> +++ b/src/process.c
> @@ -4304,6 +4304,10 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
>    int got_some_input = 0;
>    int count = SPECPDL_INDEX ();
>  
> +#ifdef SIGALRM
> +  SIGMASKTYPE mask;
> +#endif /* SIGALRM */
> +
>    FD_ZERO (&Available);
>    FD_ZERO (&Writeok);
>  
> @@ -4606,6 +4610,14 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
>  	    }
>  #endif
>  
> +#ifdef SIGALRM
> +          /* We don't want SIGALRM going off while we're blocked in
> +             select.  If there any any pending timers, timeout has
> +             been set appropriately already and we'll wake up
> +             automatically.  */
> +          mask = sigblock (sigmask (SIGALRM));
> +#endif /* SIGALRM */
> +
>  #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
>            nfds = xg_select
>  #elif defined (HAVE_NS)
> @@ -4618,6 +4630,10 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
>               (check_write ? &Writeok : (SELECT_TYPE *)0),
>               (SELECT_TYPE *)0, &timeout);
>  
> +#ifdef SIGALRM
> +          sigsetmask (mask);
> +#endif /* SIGALRM */
> +
>  #ifdef HAVE_GNUTLS
>            /* GnuTLS buffers data internally.  In lowat mode it leaves
>               some data in the TCP buffers so that select works, but




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Dec 2011 23:43:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 29 18:43:13 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RgPct-00088i-R2
	for submit <at> debbugs.gnu.org; Thu, 29 Dec 2011 18:43:13 -0500
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dancol@HIDDEN>) id 1RgPco-00088T-91
	for submit <at> debbugs.gnu.org; Thu, 29 Dec 2011 18:43:08 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dancol@HIDDEN>) id 1RgPa0-00074Y-Tq
	for submit <at> debbugs.gnu.org; Thu, 29 Dec 2011 18:40:13 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([140.186.70.17]:48394)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dancol@HIDDEN>) id 1RgPa0-00074U-SK
	for submit <at> debbugs.gnu.org; Thu, 29 Dec 2011 18:40:12 -0500
Received: from eggs.gnu.org ([140.186.70.92]:43538)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dancol@HIDDEN>) id 1RgPZz-0003k8-TL
	for bug-gnu-emacs@HIDDEN; Thu, 29 Dec 2011 18:40:12 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dancol@HIDDEN>) id 1RgPZy-00074B-MZ
	for bug-gnu-emacs@HIDDEN; Thu, 29 Dec 2011 18:40:11 -0500
Received: from dancol.org ([96.126.100.184]:34802)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dancol@HIDDEN>) id 1RgPZy-00073o-Ef
	for bug-gnu-emacs@HIDDEN; Thu, 29 Dec 2011 18:40:10 -0500
Received: from dancol by dancol.org with local (Exim 4.72)
	(envelope-from <dancol@HIDDEN>) id 1RgPZx-0008S8-CU
	for bug-gnu-emacs@HIDDEN; Thu, 29 Dec 2011 15:40:09 -0800
Date: Thu, 29 Dec 2011 15:40:09 -0800
Message-Id: <E1RgPZx-0008S8-CU@HIDDEN>
From: Daniel Colascione <dancol@HIDDEN>
Subject: [PATCH] Power: sleep longer than two seconds at a time
To: bug-gnu-emacs@HIDDEN
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.9 (-----)

Emacs uses an atimer to poll for input every so often so it can detect
C-g presses while lisp code is running; atimer arranges for this polling
to be done by having a SIGALRM delivered every so often --- by default,
every two seconds.  But while lisp code is not running and emacs is
blocked in select() [or a platform-specific analogue], we want to
stop this polling to save power: we don't need it because the select
will return as soon as there's input.

Emacs has code that's meant to turn off atimers while we wait for
input --- wait_reading_process_output calls stop_polling and
turn_on_atimers (0).  But time ago, we started calling redisplay
code inside the select loop, and this select code turns atimers
back on.  The effect is that we don't sleep longer than two second
at a time.

This patch turns off SIGALRM delivery around select, making sure that
we stay asleep.  With this patch (and blink-cursor-mode off), Emacs
will process input, then sleep for 30 seconds, and if no input
arrives in that time, will sleep for several hours.  The patch
does not adversely any functionality.
---
 src/process.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/process.c b/src/process.c
index 5c8eef7..f81a5c4 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4304,6 +4304,10 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
   int got_some_input = 0;
   int count = SPECPDL_INDEX ();
 
+#ifdef SIGALRM
+  SIGMASKTYPE mask;
+#endif /* SIGALRM */
+
   FD_ZERO (&Available);
   FD_ZERO (&Writeok);
 
@@ -4606,6 +4610,14 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
 	    }
 #endif
 
+#ifdef SIGALRM
+          /* We don't want SIGALRM going off while we're blocked in
+             select.  If there any any pending timers, timeout has
+             been set appropriately already and we'll wake up
+             automatically.  */
+          mask = sigblock (sigmask (SIGALRM));
+#endif /* SIGALRM */
+
 #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
           nfds = xg_select
 #elif defined (HAVE_NS)
@@ -4618,6 +4630,10 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
              (check_write ? &Writeok : (SELECT_TYPE *)0),
              (SELECT_TYPE *)0, &timeout);
 
+#ifdef SIGALRM
+          sigsetmask (mask);
+#endif /* SIGALRM */
+
 #ifdef HAVE_GNUTLS
           /* GnuTLS buffers data internally.  In lowat mode it leaves
              some data in the TCP buffers so that select works, but
-- 
1.7.5.1





Acknowledgement sent to Daniel Colascione <dancol@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#10404; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 14 Dec 2016 17:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.