From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-2635669-1516969921-2-10543685654346657153 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.001, ME_NOAUTH 0.01, RCVD_IN_DNSWL_HI -5, T_RP_MATCHES_RCVD -0.01, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='209.132.180.67', Host='vger.kernel.org', Country='US', FromHeader='de', MailFrom='org' X-Spam-charsets: plain='us-ascii' X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: linux-api-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1516969921; b=e6DxJFF5NAt+hjrXDdElDuBMfIiJ7APL8QQjXq1rHp1vsES LvpHO7/7PehGeTEjFzfIXzW2/i4CIvnviobehiUtaZNMH9FGPSHZ+roEdEoNNwas 64jXn6h83/GQ0W67+rc/gM6OD+NR6JkQkpXHxNY3LZG+KvSBRcb84zfGJO+gsYKQ A/hd3LABdA3fq6WuKg+HyGUrpgg0yNXhpChFWDsNCRSC7xO6QoPjiXetid27jgHg X/2ueGRc5rSi5MQLx9RnwE2tiX1J224ba38wH/hf5sqXW91RzA2Ci3/GR5Zkx5fx X/VYb3IoTnGr8+a5jJBjyOu6YN4JAZ3JNl0l2Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to:sender :list-id; s=arctest; t=1516969921; bh=kvG+vEpfb6DxcpnmPA26lLzcw6 qwoFcmh2p0gvTFunA=; b=IK4F0Dw8oCqVvdb9L/hsTjP5TvICVFuE2f57Lz6LUC t80YRmJXB2f4/3hQZpFuwvyTFZd0zWwx34EUPAZpZHv0KS3Bi+sADuMe4zpDgnFT e7Qprlqxxmip86OHV9OWe9tf5I0r2N7TVK3MA0oRY10mP0kNGqkTWKsE573UAuEk Lahe2CaQLuvZXIy7aH1uaLoYMENNYLnLsS8ZVkjR37o4U62daOwhL8euYXoCrA22 Y1lZs0kwFK2Zca+027SnhRyLdgQn51AJ/YVamILilo5SDsjpr2z3kA06EhUXXkvt q7hFex+dLGtZ10me/3w0FRCHtCTrKsSQms0RHYnLpRwQ== ARC-Authentication-Results: i=1; mx3.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=lst.de; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-api-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=lst.de header.result=pass header_is_org_domain=yes Authentication-Results: mx3.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=lst.de; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-api-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=lst.de header.result=pass header_is_org_domain=yes Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751995AbeAZMba (ORCPT ); Fri, 26 Jan 2018 07:31:30 -0500 Received: from verein.lst.de ([213.95.11.211]:42605 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbeAZMb0 (ORCPT ); Fri, 26 Jan 2018 07:31:26 -0500 Date: Fri, 26 Jan 2018 13:31:23 +0100 From: Christoph Hellwig To: Benjamin LaHaise Cc: Christoph Hellwig , viro@zeniv.linux.org.uk, Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: aio poll, io_pgetevents and a new in-kernel poll API V4 Message-ID: <20180126123123.GA6985@lst.de> References: <20180122201243.31610-1-hch@lst.de> <20180125201025.GN23664@kvack.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180125201025.GN23664@kvack.org> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-api-owner@vger.kernel.org X-Mailing-List: linux-api@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Thu, Jan 25, 2018 at 03:10:25PM -0500, Benjamin LaHaise wrote: > I implemented something similar back in December, but did so without > changing the in-kernel poll API. See below for the patch that implements > it. Is changing the in-kernel poll API really desirable given how many > drivers that will touch? I had various previous versions that did not touch the driver API, but there are a couple issues with that: (1) you cannot make the API race free. With the existing convoluted poll_table_struct-based API you can't check for pending items before adding yourself to the waitqueue in a race free manner. (2) you cannot make the submit non-blocking without deferring to a workqueue or similar and thus incurring another context switch (3) you cannot deliver events from the wakeup callback, incurring another context switch, this time in the wakeup path that actually matters for some applications (3) the in-kernel poll API really is broken to start with and needs to be fixed anyway. I'd rather rely on that instead of working around decades old cruft that has no reason to exist.