GNU bug report logs - #66288
29.1; Performance regression using pipe for subprocess

Previous Next

Package: emacs;

Reported by: Chris Hanson <cph <at> chris-hanson.org>

Date: Sun, 1 Oct 2023 00:59:02 UTC

Severity: normal

Found in version 29.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #98 received at 66288 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Chris Hanson <cph <at> chris-hanson.org>
Cc: gerd.moellmann <at> gmail.com, dmitry <at> gutov.dev, gregory <at> heytings.org,
 66288 <at> debbugs.gnu.org
Subject: Re: bug#66288: 29.1; Performance regression using pipe for subprocess
Date: Wed, 4 Oct 2023 15:49:00 -0700
On 10/3/23 23:52, Eli Zaretskii wrote:


> +#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ)

A small point: no need to check whether GNU_LINUX is defined; any system 
having these two Linux macros should be Linux-compatible.

> +      /* If they requested larger reads than the default system pipe
> +         capacity, enlarge the capacity to match the request.  */
> +      if (read_process_output_max > fcntl (inchannel, F_GETPIPE_SZ))
> +	{
> +	  int readmax = clip_to_bounds (1, read_process_output_max. INT_MAX);

"." -> "," of course.

> +	  fcntl (inchannel, F_SETPIPE_SZ, readmax);

This call can fail if you aren't root and you exceed the system limit in 
/proc/sys/fs/pipe-max-size. So I suggest that if this fnctl fails with 
EPERM, trying it again after clipping to that limit.





This bug report was last modified 1 year and 229 days ago.

Previous Next


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