[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d743bd7bec25c939d7419a3512239b43b990af5a.camel@gnu.org>
Date: Tue, 12 May 2020 12:55:19 -0400
From: Paul Smith <psmith@....org>
To: David Laight <David.Laight@...LAB.COM>,
'Linus Torvalds' <torvalds@...ux-foundation.org>
Cc: 'Arnd Bergmann' <arnd@...db.de>,
'Masahiro Yamada' <yamada.masahiro@...ionext.com>,
'Linux Kernel Mailing List' <linux-kernel@...r.kernel.org>
Subject: Re: I disabled more compiler warnings..
On Tue, 2020-05-12 at 15:04 +0000, David Laight wrote:
> I think there were some sub-makes that were started with make
> instead of $(MAKE) so ended up creating a new job pipe.
Oh, yes, that will do it.
> Doesn't it do blocking reads with SIGCHLD enabled?
No, because it's racy (by itself).
> (or hopefully ppoll() to avoid the race)
GNU make uses pselect(), on systems that support it. On systems that
don't support pselect() it uses a trick I described in another email:
we dup() the FD, read() on the dup, then in the SIGCHLD handler we
close() the dup.
> Another option is for the 'parent' make to return (or not acquire)
> a job token for $(MAKE) commands.
It just feels cleaner to me to have the parent simply always take the
token, and leave it up to the child to put it back if appropriate,
rather than the parent putting it back.
Having the parent not acquire a token at all won't work; without
limiting sub-makes it means you might have 100's of them running at the
same time, even with -j2 or whatever.
> Or, require the sub-make acquire a token in order to exit.
> Then it can free the token when every job terminates.
I'm not sure I follow that?
Powered by blists - more mailing lists