Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4217824ybg; Fri, 25 Oct 2019 15:16:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4CApSZPAD/SVOHdKHONSFSAZ1WKR6wgVHRiIY9+O2Y05IiJEbGppsUKxd0tI3SCWa4RjY X-Received: by 2002:aa7:cd59:: with SMTP id v25mr6666240edw.26.1572041812205; Fri, 25 Oct 2019 15:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572041812; cv=none; d=google.com; s=arc-20160816; b=Rz1Y3oNu/quksEUYc7ZBVQBppejYaL0feDwE7C6UubmkONI8vjKzy0UYcmlfS4K4Xp FmSwt4uGEwTaMsQ5/mDzN8QUM3oMWSOZmJjqAduCcZycXRwCdxEOjX9mMCVUOUBbPeAU HAcw5vtfDbC7NkzA7eDheioYcM6CCq7zeX8iTqgoBml/Um9AxI4qWpsL72Cg7qdgHLN2 ew+DOyL65ql1LplTqXpcbzDkyUgkm/5mxRoWiOuprOdjUR8/34qBT6pBIBHpP5ZgqsIC 47+7DMy3jb5v4m9LdLRcOeC0XxJT5jSWep1gdIJ6KjKCm2wFnEMu+uRezdFrjWijiL2f Wz4w== 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=gsc+0cnWp+SeXo5Ab/Z5m/x0oLsQUzNBoPuLzeohPH8=; b=OMz4ZsG/7dMBO1Ni4hnEp0qnzIxIZT6LFl3MH9s1UJrBHDb6Q6PJpioPr+CeGJF1kS fzIR8L12Q2nt/3G6bVouWWQBieOV3THDVwsGTm+S3LvicDLRwir83sUGeufUyQKcKxsK ZZz+51YHFJb2wY5fOvG4Uc74xr7MzVE3ax2hw4Qbv2nn0h440U+6jgMKYm8KpHWmkAO9 8aoOJquTCqc1irxIhh9NrtpNDxYyAAElisy7W6ejY0n49abfIJOQV3VspWw+PX6D40D1 9fgmd/4EqT+Ox7BIeMUZzZ/ntNfqzbeLhWbHwNUvYd2pkGDKz/lQXykZlP9lpuIwowqR /12Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NOPUEBQc; 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 f27si2112620ejb.310.2019.10.25.15.16.28; Fri, 25 Oct 2019 15:16:52 -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=NOPUEBQc; 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 S2404987AbfJYIfL (ORCPT + 99 others); Fri, 25 Oct 2019 04:35:11 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:49966 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404439AbfJYIfL (ORCPT ); Fri, 25 Oct 2019 04:35:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571992510; 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=gsc+0cnWp+SeXo5Ab/Z5m/x0oLsQUzNBoPuLzeohPH8=; b=NOPUEBQcEdYBmqATxtXkRECvwvwTFH+9JO5ZYGM6BHmE/mluTOZi+2GQUBQyru2lR6UaZ4 1iYY5FOhu12pgVbavx/TQkfDfBV9WRRAe37Mf0+MJSFznfgbKUMPSOo0gbGPEnZC7mPyq3 dUL/Jzb7wLq4cjMVOw5lX8zi5Dp5tlg= 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-331-Yt-flKkyMo6CKNT7t3AOmw-1; Fri, 25 Oct 2019 04:35:05 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5E9E800D41; Fri, 25 Oct 2019 08:35:03 +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 AFDF84100; Fri, 25 Oct 2019 08:35:00 +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> <30394.1571936252@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Rasmus Villemoes , Greg Kroah-Hartman , Peter Zijlstra , Nicolas Dichtel , raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block , LSM List , linux-fsdevel , Linux API , Linux Kernel Mailing List Subject: Re: [RFC PATCH 11/10] pipe: Add fsync() support [ver #2] MIME-Version: 1.0 Content-ID: <9190.1571992499.1@warthog.procyon.org.uk> Date: Fri, 25 Oct 2019 09:34:59 +0100 Message-ID: <9191.1571992499@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: Yt-flKkyMo6CKNT7t3AOmw-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 Linus Torvalds wrote: > > The keyrings testsuite needs the ability to wait for all the outstandin= g > > notifications in the queue to have been processed so that it can then g= o > > through them to find out whether the notifications it expected have bee= n > > emitted. >=20 > Can't you just do >=20 > ioctl(fd, FIONREAD, &count); >=20 > in a loop instead? "No paperwork. Just sprinkle some msleep() crack on > him, and let's get out of here" Using FIONREAD like this means that I would have to quiesce the tests in or= der to sync up. For the moment that's fine, but at some point I would like to = be able to stress test the system by running tests in parallel against the sam= e keyring. Each test needs to check with the monitor whether its keys have generated the appropriate notifications against a backdrop of events being continuously generated by other tests. I can hold this patch for now. Let me see if I can come up with a better w= ay to do it. Maybe it can be done by dead reckoning, holding up until either we've counted out a complete ring-full of notifications or read() has come = up empty. David