Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1288777ybx; Thu, 31 Oct 2019 08:23:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzejTQs0WBsxytdgHq41nfpwcRuPyy6u6v+PIHxOaBs9nQO5ut52Qe8V/DGY8kfGx3uyuj4 X-Received: by 2002:a50:f70d:: with SMTP id g13mr6857454edn.172.1572535390695; Thu, 31 Oct 2019 08:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572535390; cv=none; d=google.com; s=arc-20160816; b=d/zQc9qrqMjGWA8dkvw2kRA3iVj023YMx8mLHeWPgGDw6sKGJvqU+gYZaiwQb8TftN l+u4tNUSWlqWNR0722QiEEAIFcXjFdUdv+v81CIVQDIROFOc6VZdyigb/49ZYz2MtFKg I0kbgOyhtWdm6TGi05+UCNUjfXBvSNDj4xD17z1qsxDU/GikpjP/k/ea88SVm7zAdzOv s93BLGDVlL8UbREztPHo4+8RSAXqY/NFJmxkExa/nZphUjaxiC/Hq4s1osHA06yHgJAv SSPg4HPSrWPfdO0WPxPtMcwhtU4PQh9tUXoHBcKkmyC33W+twXScLWETD3inH69Z0rkE s7rw== 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:message-id:date :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=KB0w+J47Vm67r8tjhUMxa0RlzCeaXYS337IcG/e9RSQ=; b=eUyBH1zj4CbVdQFg//YmVLKpB3J8XJF8S7CI5om4UNE4Gu32mpfpIpiag1iJoIakmU CNf9XABogC/giW7txbg93DNeDf30mNIhl1T8DuGwjrUcI3ReuWpt2r2P2ZaOARO2HoTq BRnjWvj6zFqc0QjSKgY4TS5jDx7Jq0S7HBu6apMyLUTo4Kv8JUyzh2asuBIwCs4+jE+n k9boKd5M7XFjuXh+rZow691XsiI5RrYcbOhcmU6jqhg0QqV27MZgzmukkLG68MdGma2n ankuNwXo7x+q2uv2YIHEylCRfgZxzGPAt4GDeeTMNg2ezH+BoXz5fDfLPIlQL8S8yOz9 wRJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LQi9iZHk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m16si3954883ejd.306.2019.10.31.08.22.46; Thu, 31 Oct 2019 08:23:10 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=LQi9iZHk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728330AbfJaPVd (ORCPT + 99 others); Thu, 31 Oct 2019 11:21:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:49646 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727973AbfJaPVd (ORCPT ); Thu, 31 Oct 2019 11:21:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572535292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KB0w+J47Vm67r8tjhUMxa0RlzCeaXYS337IcG/e9RSQ=; b=LQi9iZHkEOU+3+yN5mVUrBp9KbLSzqkUr6k6izHp0VXVLSQt4Kh0vq004FTzMDgU329RWW 0n4l1JXloysRQbFpdNuEjLyvIFPks/IZcLfWF9GTpJJXYi7CsW51pn0vahgHePsq7iEf8R kZazmhGVlUbGwO0daf7lEAxIpptAcMM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-MUMIyamRN_mM4zAREXjqFg-1; Thu, 31 Oct 2019 11:21:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 976B3107ACC0; Thu, 31 Oct 2019 15:21:26 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-121-40.rdu2.redhat.com [10.10.121.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F00F60BEC; Thu, 31 Oct 2019 15:21:23 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <157186182463.3995.13922458878706311997.stgit@warthog.procyon.org.uk> <157186189069.3995.10292601951655075484.stgit@warthog.procyon.org.uk> To: Konstantin Khlebnikov Cc: dhowells@redhat.com, torvalds@linux-foundation.org, Rasmus Villemoes , Greg Kroah-Hartman , Peter Zijlstra , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 07/10] pipe: Conditionalise wakeup in pipe_read() [ver #2] MIME-Version: 1.0 Content-ID: <18021.1572535282.1@warthog.procyon.org.uk> Date: Thu, 31 Oct 2019 15:21:22 +0000 Message-ID: <18022.1572535282@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: MUMIyamRN_mM4zAREXjqFg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Konstantin Khlebnikov wrote: > > Only do a wakeup in pipe_read() if we made space in a completely full > > buffer. The producer shouldn't be waiting on pipe->wait otherwise. >=20 > We could go further and wakeup writer only when at least half of buffer i= s > empty. This gives better batching and reduces rate of context switches. >=20 > https://lore.kernel.org/lkml/157219118016.7078.16223055699799396042.stgit= @buzz/T/#u Yeah, I saw that. I suspect that where you put the slider may depend on th= e context. David