Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp811033ybk; Wed, 13 May 2020 13:48:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCkQpssiv69k4FCCxICmoQmYsk3Zck4jaS/A3MeeDtUaKeT0EoZtre4TaIv33Jx6WBS2zm X-Received: by 2002:a17:906:1dcc:: with SMTP id v12mr817953ejh.236.1589402932327; Wed, 13 May 2020 13:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589402932; cv=none; d=google.com; s=arc-20160816; b=Um3Ptf7IsGM050LCWmtHG8XRZQ2HRFmfI1rMRtfaSG7ficKUz9MCE32Ttu6LLySz1q yhmcRJEgDo+1H2S3iyIgMb+hDqY1mMkYtWuDvDwtCbZXGl3OBE/33uVdwDWxy5+/DQQz zzHu2frkvOQgXhtvOwxfKi7vKaqOqZGoQ9d2jdLvPIIeUYFwmGs9r3gK3+VmIKIpK82s vvCgpbsgh3KCgVJCeqYr0/wcJj7m7B8tM9RftNMhmQBPz2sW0lwBORfEaC0Va2ZcfLDb aB+vGW2WQLNBjyGq/S/wMG1QvWQvMe6kxgk9ku5QrhcnmxUw4l204CbFCRMoZhkAgWcm Aq8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:reply-to:from :subject:message-id; bh=k8r38je46zJyviYF+Hli1L9n+sQL8tzRi4lOdHSuZ0A=; b=x6boKxzy7FP7Vx1x99Da5AUVjXT9qGlCEYleeAAvgNGM077gLnzfKhI+V5NuYd3VQ9 3WUpD2QCoBAnGsplQtfo9yJJel+QM4XvpE1lKgmoJNnS3i2WQNO7CcLQl4uVOp3hKjsu DQV1wHAW8zA74OgErMtcjSsj7kT13CWiTrvV4eXEfRJ7qi+Yw2ASFXFFjP+gVplV0Rgk gIcZK36s6G+mWFoL3rrGY+jwIRDjUL2h0d8ucBh8NXJqLya4q1PQ6wchQCxRV0ws7xIJ ec0lh8/5tW78N/UkPN1afWhMzbZ4GtnI8aZbRJZ0kgoosdJFray+ytbx6UfYqNBKvh6o sW1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a63si384173ede.399.2020.05.13.13.48.29; Wed, 13 May 2020 13:48:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389196AbgEMPc6 (ORCPT + 99 others); Wed, 13 May 2020 11:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728678AbgEMPc6 (ORCPT ); Wed, 13 May 2020 11:32:58 -0400 Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58C40C061A0C for ; Wed, 13 May 2020 08:32:58 -0700 (PDT) Received: from fencepost.gnu.org ([2001:470:142:3::e]:39604) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYtNM-0002SM-79; Wed, 13 May 2020 11:32:52 -0400 Received: from pool-98-118-0-140.bstnma.fios.verizon.net ([98.118.0.140]:51596 helo=pdslaptop.home) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYtNL-0000Cx-Q6; Wed, 13 May 2020 11:32:52 -0400 Message-ID: <6a5a75043f697a130422fbc3a3f8464dc6d03e2f.camel@gnu.org> Subject: Re: I disabled more compiler warnings.. From: Paul Smith Reply-To: psmith@gnu.org To: David Laight , 'Linus Torvalds' Cc: 'Arnd Bergmann' , 'Masahiro Yamada' , 'Linux Kernel Mailing List' Date: Wed, 13 May 2020 11:32:50 -0400 In-Reply-To: <4a540a5d341c468bae131934b413e4ce@AcuMS.aculab.com> References: <8320f29ca61146fc985083621685ac95@AcuMS.aculab.com> <0ff4860b4202a6ef3bb3b29912d083d471e1cc1d.camel@gnu.org> <90909f30775744b89d1a0c40265779d9@AcuMS.aculab.com> <5564c992dfeb40adbc3e6f6a29e43d2e@AcuMS.aculab.com> <73dace5aca21bee09ce12aa8dcfd50daa2cd6051.camel@gnu.org> <464ab7c2d9e144718e4a3135a41f3056@AcuMS.aculab.com> <4a540a5d341c468bae131934b413e4ce@AcuMS.aculab.com> Organization: GNU's Not UNIX! Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-05-13 at 08:21 +0000, David Laight wrote: > > 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. > > Does that even work - seems like it requires close() to abort poll(). > Better is to just have the SIGCHLD handler write a byte into a pipe. Sorry I guess I wasn't clear. We use _either_ pselect(), _or_ the close()-the-dup trick. Not both. If we have pselect() we use that: no dup'ing or close'ing needed. If we don't have pselect() we use the close() in the signal handler. In that case we're just waiting in the read(), we're not using select() or poll() or whatever. It's definitely the case that if we're waiting in read() and someone closes the FD, we'll wake up! :) > > 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. > > Hmmm... > That means the sub-make must always hold one token. > Otherwise the parent-make could use it to create a new sub-make. Right, my first idea has this same problem so it won't work. > Actually the token pipe can be opened NON_BLOCK because poll() > can/will be used to wait for a token. Again, that only works on systems where pselect() is available. > So you always try to read a token - even when you have one 'in your > hand' (either entry or because a job just finished). If it isn't the > 'abort' one, put it back. Something like that would be needed, yes. Note this is only needed in a rare situation where you're running with parallelism enabled BUT you have a makefile which never actually tries to run two or more jobs at the same time for some reason.