From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-1684034-1522355618-2-9153937537796235086 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.249, 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='CN', FromHeader='de', MailFrom='org' X-Spam-charsets: 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=fm2; t= 1522355618; b=dLcS0pLJpYnTIPNPzZRf7jgMEKxgR5Ql1VQzJuo73GpOMEvNe7 V47JCphR+S4m1Q8ORk3cRz/TTPDUD55PkIPL4XVHFjF/LG/FkUDmeoRm72oyOWTz O4mXnildyjdr2yO9F4vLbLUIZdCKImFhE5qbX3HVCWuOPxipoztIqBL/1JkNIP68 QGix/Qil3smRLyzoH+Zar1cDDVFOd9P/NHgYQFlmku5ff5rmdmeSQLPmyh69PIkL WQ+yAgJ2r3KJhSfAm4HNx14+2A/JUvS5hq7k5nVf9VaW4zJjkdOwyPRFo3n79nLh daeMpHPjNvAv6FVJ2K965ECObK3p3exBZdRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:date:message-id:sender :list-id; s=fm2; t=1522355618; bh=cOIJa9zQIm9UhJ+144e0Y0Q8umsyJU vzTl3ATyzCDvE=; b=uL0yBW0Nkb1a7vUqlHs4E0wcOiBf+/3N2T1HID3Yk7PYjT M0EPpGCUAob7EfjzaKLhY33gs3ePmnPrSvifHJWe92sdwk7LHgh9i+qPGSzJEouk 06Q6YjHPeSvU9OWtjswYs3r9GWlQqkP1cmuIdu46V5jzRsoh9Kl4CDwOTAPOjDeA MWtk19VnffJXO0gKMDlSEkt36hTarWi9VsjgcUrYj8JLGrV8n8bJNWA+Jj3jwpPb HkAev3uRN3TVPHNYP1PioKjSa7i8f82E1Qwf6cuZCe+n1iaqFq3/stTagcsnklzy mCh2MkwUAmNZhLcaLV7nMEemliim+bUW/1eIXgAg== ARC-Authentication-Results: i=1; mx5.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered, 2048-bit rsa key sha256) header.d=infradead.org header.i=@infradead.org header.b=UUn92fuA x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=bombadil.20170209; 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-cm=none score=0; 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; x-vs=clean score=0 state=0 Authentication-Results: mx5.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered, 2048-bit rsa key sha256) header.d=infradead.org header.i=@infradead.org header.b=UUn92fuA x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=bombadil.20170209; 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-cm=none score=0; 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; x-vs=clean score=0 state=0 X-ME-VSCategory: clean X-CM-Envelope: MS4wfGgbnzq5V2tmKmu2vXQY1mUytQ5QJyUTq7s9LR5KSLKqOTs6g97gy6Zb/7UdSmaTJ8bi3eoRWjuqJvz5QvcTKA80nq6Q+IFGISgKE+TmMzbJzCLpN7x3 dgi+osKI/WPWXAxQ91HKkp8wkaMeRXsXZLWmI02cRW/r2gpUdfi0puAxa97r3yACGSOCyjwRGNTwVbhRCBQNwbgBI/MjbiO4gDZQjuYMCe4Sqf9+fr2VPJ+0 X-CM-Analysis: v=2.3 cv=NPP7BXyg c=1 sm=1 tr=0 a=UK1r566ZdBxH71SXbqIOeA==:117 a=UK1r566ZdBxH71SXbqIOeA==:17 a=v2DPQv5-lfwA:10 a=JfrnYn6hAAAA:8 a=lViJMyulAAAA:8 a=NEAV23lmAAAA:8 a=VwQbUJbxAAAA:8 a=UMseduhay6ZSubcRlz4A:9 a=x8gzFH9gYPwA:10 a=1CNFftbPRP8L7MoqJWF3:22 a=gb9IC-u5QvZuJU0a8fSk:22 a=AjGcO6oz07-iQ99wixmX:22 X-ME-CMScore: 0 X-ME-CMCategory: none Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbeC2Udf (ORCPT ); Thu, 29 Mar 2018 16:33:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53450 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbeC2Ude (ORCPT ); Thu, 29 Mar 2018 16:33:34 -0400 From: Christoph Hellwig To: viro@zeniv.linux.org.uk Cc: 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: aio poll and a new in-kernel poll API V8 Date: Thu, 29 Mar 2018 22:32:58 +0200 Message-Id: <20180329203328.3248-1-hch@lst.de> X-Mailer: git-send-email 2.14.2 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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: Hi all, this series adds support for the IOCB_CMD_POLL operation to poll for the readyness of file descriptors using the aio subsystem. The API is based on patches that existed in RHAS2.1 and RHEL3, which means it already is supported by libaio. To implement the poll support efficiently new methods to poll are introduced in struct file_operations: get_poll_head and poll_mask. The first one returns a wait_queue_head to wait on (lifetime is bound by the file), and the second does a non-blocking check for the POLL* events. This allows aio poll to work without any additional context switches, unlike epoll. This series sits on top of the aio-fsync series that also includes support for io_pgetevents. The changes were sponsored by Scylladb, and improve performance of the seastar framework up to 10%, while also removing the need for a privileged SCHED_FIFO epoll listener thread. git://git.infradead.org/users/hch/vfs.git aio-poll.8 Gitweb: http://git.infradead.org/users/hch/vfs.git/shortlog/refs/heads/aio-poll.8 Libaio changes: https://pagure.io/libaio.git io-poll Seastar changes (not updated for the new io_pgetevens ABI yet): https://github.com/avikivity/seastar/commits/aio Changes since V8: - make delayed cancellation safe and unconditional Changes since V7: - reworked cancellation Changes since V6: - small changelog updates - rebased on top of the aio-fsync changes Changes since V4: - rebased ontop of Linux 4.16-rc4 Changes since V3: - remove the pre-sleep ->poll_mask call in vfs_poll, allow ->get_poll_head to return POLL* values. Changes since V2: - removed a double initialization - new vfs_get_poll_head helper - document that ->get_poll_head can return NULL - call ->poll_mask before sleeping - various ACKs - add conversion of random to ->poll_mask - add conversion of af_alg to ->poll_mask - lacking ->poll_mask support now returns -EINVAL for IOCB_CMD_POLL - reshuffled the series so that prep patches and everything not requiring the new in-kernel poll API is in the beginning Changes since V1: - handle the NULL ->poll case in vfs_poll - dropped the file argument to the ->poll_mask socket operation - replace the ->pre_poll socket operation with ->get_poll_head as in the file operations From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: aio poll and a new in-kernel poll API V8 Date: Thu, 29 Mar 2018 22:32:58 +0200 Message-ID: <20180329203328.3248-1-hch@lst.de> Cc: 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 To: viro@zeniv.linux.org.uk Return-path: Sender: owner-linux-aio@kvack.org List-Id: netdev.vger.kernel.org Hi all, this series adds support for the IOCB_CMD_POLL operation to poll for the readyness of file descriptors using the aio subsystem. The API is based on patches that existed in RHAS2.1 and RHEL3, which means it already is supported by libaio. To implement the poll support efficiently new methods to poll are introduced in struct file_operations: get_poll_head and poll_mask. The first one returns a wait_queue_head to wait on (lifetime is bound by the file), and the second does a non-blocking check for the POLL* events. This allows aio poll to work without any additional context switches, unlike epoll. This series sits on top of the aio-fsync series that also includes support for io_pgetevents. The changes were sponsored by Scylladb, and improve performance of the seastar framework up to 10%, while also removing the need for a privileged SCHED_FIFO epoll listener thread. git://git.infradead.org/users/hch/vfs.git aio-poll.8 Gitweb: http://git.infradead.org/users/hch/vfs.git/shortlog/refs/heads/aio-poll.8 Libaio changes: https://pagure.io/libaio.git io-poll Seastar changes (not updated for the new io_pgetevens ABI yet): https://github.com/avikivity/seastar/commits/aio Changes since V8: - make delayed cancellation safe and unconditional Changes since V7: - reworked cancellation Changes since V6: - small changelog updates - rebased on top of the aio-fsync changes Changes since V4: - rebased ontop of Linux 4.16-rc4 Changes since V3: - remove the pre-sleep ->poll_mask call in vfs_poll, allow ->get_poll_head to return POLL* values. Changes since V2: - removed a double initialization - new vfs_get_poll_head helper - document that ->get_poll_head can return NULL - call ->poll_mask before sleeping - various ACKs - add conversion of random to ->poll_mask - add conversion of af_alg to ->poll_mask - lacking ->poll_mask support now returns -EINVAL for IOCB_CMD_POLL - reshuffled the series so that prep patches and everything not requiring the new in-kernel poll API is in the beginning Changes since V1: - handle the NULL ->poll case in vfs_poll - dropped the file argument to the ->poll_mask socket operation - replace the ->pre_poll socket operation with ->get_poll_head as in the file operations -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: aart@kvack.org