Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4379345ybl; Mon, 9 Dec 2019 09:50:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy/860mQbQpBc25zo9YCgqG5O/pDTT3voOTF0rTuOpFeMvx4eKzO9X04mCLbPnvRGMezhIb X-Received: by 2002:aca:53c6:: with SMTP id h189mr222049oib.11.1575913832629; Mon, 09 Dec 2019 09:50:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575913832; cv=none; d=google.com; s=arc-20160816; b=WpfM0A3mCPfoRdxayaVfd+jkcjXaU4zqH7TNRD0ToeUY/41IXpwlJgM6sEJkoZWba3 JFXtXBDkOhvozVUy11GUCkICcyWSgz2Ja3DfPFojpqIuaCfvx3T6YppJRk8bLQ4+QLt8 JWz+SHFEmwYnsxQydQkVBd3yjuQw8pGSkwOaa+L47j6CmBWtPm8Ie6lhy99tsA4yVt+F K88XcCn8wN0zYp74RfRxHxVu//MGGmdBQRV+uoDJT061wX9Ix2LiDhCs9tBderl406LB oyHgU+UyyhKjZWV5G+6htv+C3scx1nz8BLueMceqprMYyiGOxwVp8puT++C+sASuq3CN Wt9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4LQ+LMuNUc6UzcbkWxd/rVAV7ZUCn5ppE+1rXFKEHhc=; b=ImODFIz8RhmvbE2c0tcnL/BE7sCxhinqFFlJHAUHEpirqXd+HP/1DKuEIDws5jyfFx fhrYoL9BHMWlIjB04dtGV9U6A3UQ5dKz0vehIWrt8EUI0M61nOgVo3hgSUYtj/Gd5GEf FbxLDwQ5CX/VFRvC3YK+TC2tJryzvWDRL8w3oH74MERyLxBpL8A2MZDU4WEk8o+0WWFF OcYeETjLY8ToNzFRzBF6VV6qZd8WNU80YpXZpHCyfxQqFS4rXUXTHLgu8sln7fdwyN6X 04zrR9zIWJc8iYfS1fYSW1qLBYcyMKAzkR1UJLVSGzw19FDNK6pOCDMmsuPlhDpNQQJO edwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CkDKjnxW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si209991otk.177.2019.12.09.09.50.21; Mon, 09 Dec 2019 09:50:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CkDKjnxW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbfLIRst (ORCPT + 99 others); Mon, 9 Dec 2019 12:48:49 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34792 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfLIRst (ORCPT ); Mon, 9 Dec 2019 12:48:49 -0500 Received: by mail-lj1-f194.google.com with SMTP id m6so16679397ljc.1 for ; Mon, 09 Dec 2019 09:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4LQ+LMuNUc6UzcbkWxd/rVAV7ZUCn5ppE+1rXFKEHhc=; b=CkDKjnxWG4FRbtEbI7ud7XBkCBtyfJArxT9/XBR2xQYpr8HBAqwH2Tf0JminQO2nlV x7XlZnDMnvVttfpm0UsAW28SHg3Kafh2gKQ6WiOFSBT48kh6c+G6q6rtBbGrQur6oeXC /89sNopGRySvD+a7Wl8ZaN0nqRFhJbctudN9g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4LQ+LMuNUc6UzcbkWxd/rVAV7ZUCn5ppE+1rXFKEHhc=; b=Xp+6VMSQly5g8IhQYr7aBEeHzzcvjEUNHTrLYH0wHMoCpxMSXz1uH73mhM4MkFNljs 3PsL1uhBr+WZMfAv7yuIRx6Rg0D+vjZOFIk0kdo3FbQ5SDms8vgLfAbpPfAmP7CRI4ZZ mo7XlZulFbfaV1S5rOhDXgjjULADx9YUQfWm7YvMoCnBT1SRMlBLYHLm47EfDUzI/YGx 4nOjX6XCelWQWhvDUJi/9MRep7wU0M85KLtPRL3F6sBxLLUe4f9hvoGI5otSTDMO4N5M 8reKQNitoo2K1dwSmnzTTQPUghidauf/7R2XdV9wh961B3siZzBD5VHjyIJC2QuWPXNP H3IA== X-Gm-Message-State: APjAAAWte13R3TN7MGkXggn6goBc/dLYPTM2x+2FP1PdDCYy55UuIEqx /Gu/kkceKA+e2M0QAoMTjfSW+kZfRO0= X-Received: by 2002:a2e:898f:: with SMTP id c15mr7767022lji.41.1575913725698; Mon, 09 Dec 2019 09:48:45 -0800 (PST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id 10sm329896ljw.2.2019.12.09.09.48.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Dec 2019 09:48:44 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id u17so16660252lja.4 for ; Mon, 09 Dec 2019 09:48:44 -0800 (PST) X-Received: by 2002:a2e:241a:: with SMTP id k26mr17623229ljk.26.1575913723833; Mon, 09 Dec 2019 09:48:43 -0800 (PST) MIME-Version: 1.0 References: <157558502272.10278.8718685637610645781.stgit@warthog.procyon.org.uk> <20191206135604.GB2734@twin.jikos.cz> In-Reply-To: From: Linus Torvalds Date: Mon, 9 Dec 2019 09:48:27 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] pipe: Fixes [ver #2] To: Vincent Guittot , DJ Delorie Cc: David Sterba , David Howells , Eric Biggers , Al Viro , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Ingo Molnar Content-Type: multipart/mixed; boundary="000000000000b4feb20599490119" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000b4feb20599490119 Content-Type: text/plain; charset="UTF-8" [ Added DJ to the participants, since he seems to be the Fedora make maintainer - DJ, any chance that this absolutely horrid 'make' buf can be fixed in older versions too, not just rawhide? The bugfix is two and a half years old by now, and the bug looks real and very serious ] On Mon, Dec 9, 2019 at 1:54 AM Vincent Guittot wrote: > > Which version of make should I use to reproduce the problem ? So the problematic one is "make-4.2.1-13.fc30.x86_64" in Fedora 30. I'm assuming it's fairly plain 4.2.1, but I didn't try to look into the source rpm or anything like that. The working one for me was just the top of -git from https://git.savannah.gnu.org/git/make.git which is 4.2.92 right now. The fix is presumably commit b552b05 ("[SV 51159] Use a non-blocking read with pselect to avoid hangs") as per Akemi. That is indeed after 4.2.1, and it looks real. Before that commit the buggy jobserver code basically does (1) use pselect() to wait for readable and see child deaths atomically (2) use blocking read to get the token and while (1) is atomic, if the child death happens between the two, it goes into the blocking read and has SIGCHLD blocked, so it will try to read the token from the token pipe, but it will never react to the child death - and the child death is what is going to _release_ a token. So what seems to happen is that when the right timing triggers, you end up with a lot of sub-makes waiting for a token, but they are also all supposed to _release_ a token. So you don't have enough tokens to go around. In the worst case, _everybody_ who has a token is also not releasing it, and then you end up triggering the timeout code (after one second), which will make things really go into a crawl. And by a crawl I mean that worst-case you really end up with just one job per second per sub-make. It will take _hours_ to compile the kernel at that speed, when it normally finishes in 15 minutes on my machine even when I do a from-scratch allmodconfig build. It does seem to be a major bug in the jobserver code. In particular with the trial fair and exclusive wakeup patch that I sent out in the other thread, it seems to be _reliably_ much worse and triggers 100% of the time for me. It's possible that my trial patch is buggy, but everything else looks fine, and with a fixed make the trial patch works for me. I'll include the trial patch here too, I think I cc'd you on the other thread too, but hey.. Anyway, it looks like the sync wakeup thing is more of a "get timing right by luck" thing than anything else. Possibly it actually causes the reverse order of reader wakeups more often (ie the most _recent_ reader is most likely to get woken up synchronously) and that may be what really ends up masking the jobserver problem, since apparently doing wakeups in the fair and proper order makes things much worse.. What a horrible pain that pipe rework ended up being. But I think we're in better shape now than we used to be, it just had very unfortunate timing issues and several real bugs. But sadly, there's no way I can push that fair pipe wakeup thing as long as this horribly buggy version of make is widespread. Linus --000000000000b4feb20599490119 Content-Type: application/x-patch; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k3ypp8jm0 IGZzL2NvcmVkdW1wLmMgICAgICAgICAgICAgfCAgNCArLS0KIGZzL3BpcGUuYyAgICAgICAgICAg ICAgICAgfCA2NyArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrLS0tLS0tLS0tLS0tLS0t LQogZnMvc3BsaWNlLmMgICAgICAgICAgICAgICB8ICA4ICsrKy0tLQogaW5jbHVkZS9saW51eC9w aXBlX2ZzX2kuaCB8ICAyICstCiA0IGZpbGVzIGNoYW5nZWQsIDUxIGluc2VydGlvbnMoKyksIDMw IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2ZzL2NvcmVkdW1wLmMgYi9mcy9jb3JlZHVtcC5j CmluZGV4IGIxZWE3ZGZiZDE0OS4uZjgyOTZhODJkMDFkIDEwMDY0NAotLS0gYS9mcy9jb3JlZHVt cC5jCisrKyBiL2ZzL2NvcmVkdW1wLmMKQEAgLTUxNyw3ICs1MTcsNyBAQCBzdGF0aWMgdm9pZCB3 YWl0X2Zvcl9kdW1wX2hlbHBlcnMoc3RydWN0IGZpbGUgKmZp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