Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1226507ybl; Wed, 18 Dec 2019 14:52:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwfW/ti9KdZQux6NdyZcmo7sToy8vay8I7/RCxpLBlfAQmHv+QK0jtnAz0puYJV4Nr2y01Y X-Received: by 2002:a05:6830:1d4c:: with SMTP id p12mr5471269oth.198.1576709564800; Wed, 18 Dec 2019 14:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576709564; cv=none; d=google.com; s=arc-20160816; b=ymoqllj2U8f43THywBDSi3k6nKSOpv5e73c8a1FakOttAfuKGZN/1dhpqR5UblZhnw /8E7fmuq2dibN789HOpzL7TSRWx74lk4GM1HzNppjtsULpLvfP7A3llhJWps6deEQ3Bj uwkKuzgh/bmVpiVJiq1bN585VUt9jdE/VNETP7ow9Zqy8Qm3pQzQ+2Xbz1Ykfcq1COf7 rYzLPT2aAkE3ZyAIyQBSoxLqyOseBDASvStlLg55LYBUo5dUNq1nkqh4OQEQ00QeAEgT rFC9vKWAM3b432ySilhREPdcWX5uhErTHh/qdF14FuNO6u7ceM15LfVInATSKbcXuoem 7m/A== 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=0opJ0B65Q5BiWbXOfLeRpbLzFdNkXbzXfsShY/S8STo=; b=RNztErXizrB7BsGOS00V6uHCww1rEO0n1TpAwOOWUy+dNjup5wXDINGrXN4NKjOPgu V7Jb/ewGBtJjvmWUGdjhnUnsC8opzFPl7cdXfnARW+mwR9VxmIGfMKSEXEMVw9lhv+qq Exji4Ir9zsFMShqYk2q2LOSeM2O8DEedCVcuV71jMsLtr9eQ0h1HGlBh0/a4KkBKJBzG Vn4qtbi4Vz9B590TbDj+Ao3kr/fr2ylodrUjqJgsyKDiNgvvAJp1Tz5EcO0rhadwoLva nJ+NfUqA6KwE04M4uCGLgYBxji+1GOTpv+Wkl552EqaxWIn8sxahEDInY1Ax8zUheukp gkBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=DUkxLRvm; 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 b10si2487226otp.124.2019.12.18.14.52.32; Wed, 18 Dec 2019 14:52:44 -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=DUkxLRvm; 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 S1726622AbfLRWvu (ORCPT + 99 others); Wed, 18 Dec 2019 17:51:50 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38885 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbfLRWvt (ORCPT ); Wed, 18 Dec 2019 17:51:49 -0500 Received: by mail-lf1-f66.google.com with SMTP id r14so2894875lfm.5 for ; Wed, 18 Dec 2019 14:51:48 -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=0opJ0B65Q5BiWbXOfLeRpbLzFdNkXbzXfsShY/S8STo=; b=DUkxLRvmbaiH3+fF8+61ttVLfREI0A+NWtWnJOtLUOSriU6hVGAfH7iqm4AZPXQqzt 7aO270kl1hKuJ5aO8Gokb2xsJxP0eGToFjcV4DL7BdieT8cYuox6b9GzA72q3+lVU+Px napMS5WIEyhf5c/+6313JTnavgdEB2AaJj+cI= 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=0opJ0B65Q5BiWbXOfLeRpbLzFdNkXbzXfsShY/S8STo=; b=f9PiElNUy9YqF7GTP78mjrnlSmZqsErTnTzggFPdd1NNvHBGSNVeJABLnEhXdvjItC j7gGB3byplWsGfJGHcxXYcaKC86RKWKfybY/QFrTP8VWqexC1SsZZUOn40RyjXuGHetn m2ppfl/2S2pHat5VBGZZm0sdIzTqDYdQOIjgAUs/nofs1/NeeHZ1mhTt8D/6hAeH97ct BqrJVSNv1flSxsiG4ei8Wzb0TSTxdHgnJMF+JHODE8pLOrM1Es4Io6pY33I5LZ2nNh4D 4eRDTU3s5oX/CoKB+5AUfHtSN/hvJVfna+Nk7KhgXB8Twp6T6YK3DiZlmUnFUSqREWc0 +ZEw== X-Gm-Message-State: APjAAAUQaEp3D8qq3l5iFJhFAfYtdeYAVI28RGWGNzQdlUCxKQxljNyk fIRcH/V/3Xp2EOaZsTYsNS21GwCZlOc= X-Received: by 2002:a19:ae04:: with SMTP id f4mr3375937lfc.64.1576709506714; Wed, 18 Dec 2019 14:51:46 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id n13sm1846252lji.91.2019.12.18.14.51.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Dec 2019 14:51:45 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id m30so2889455lfp.8 for ; Wed, 18 Dec 2019 14:51:44 -0800 (PST) X-Received: by 2002:ac2:465e:: with SMTP id s30mr3406731lfo.134.1576709503936; Wed, 18 Dec 2019 14:51: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: Wed, 18 Dec 2019 14:51:27 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] pipe: Fixes [ver #2] To: Konstantin Khlebnikov , Josh Triplett , Akemi Yagi , DJ Delorie Cc: David Sterba , David Howells , Eric Biggers , Al Viro , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Ingo Molnar , Vincent Guittot Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 12, 2019 at 2:18 AM Konstantin Khlebnikov wrote: > > commit f467a6a66419 pipe: fix and clarify pipe read wakeup logic > killed "wake writer when buffer becomes half empty" part added by > commit cefa80ced57a ("pipe: Increase the writer-wakeup threshold to reduce context-switch count"). > > I suppose that was unintentional. Jobserver juggles with few bytes and > should never reach half/full buffer thresholds. It wasn'tunintentional - the rest of the cleanups should mean that we never wake things up unnecessarily - we now only wake up if it _used_ to be 100% full, and we only do it once per read. And it did it without the watermark, which I was worried about might break something that "knew" the size of the pipe. But performance testing would be good. Both for the "no unnecessary wakeups" case, but also for the thundering herd issue. To answer Josh's email in this same thread: On Wed, Dec 18, 2019 at 12:59 PM Josh Triplett wrote: > > Debian and Ubuntu have make 4.2.1-1.2, which includes "[SV 51159] Use a > non-blocking read with pselect to avoid hangs." and various other fixes. > https://metadata.ftp-master.debian.org/changelogs/main/m/make-dfsg/make-dfsg_4.2.1-1.2_changelog > So, both Debian and Ubuntu should be fine with the pipe improvements. > (I'm testing that now.) > > Is the version of your non-thundering-herd pipe wakeup patch attached to > https://lore.kernel.org/lkml/CAHk-=wicgTacrHUJmSBbW9MYAdMPdrXzULPNqQ3G7+HkLeNf1Q@mail.gmail.com/ > still the best version to test performance with? That's my latest version, but you'll have to tweak it a tiny bit because of d1c6a2aa02af ("pipe: simplify signal handling in pipe_read() and add comments") which I did after that patch. The easiest way to resolve it is likely to revert that d1c6a2aa02af, then apply the non-thundering-herd patch and then apply d1c6a2aa02af again by hand - it's fairly straightforward (and you can return -ERESTARTSYS directly if wait_event_interruptible_exclusive() fails, because of all the same reasons why it coul dhappen without the thundering-herd patch. I can look at re-creating that patch if you find it to be too annoying. Linus