From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-3333851-1521618041-2-14504866328059041401 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.25, 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=arctest; t=1521618041; b=wxYgvPRIijRxmyUcZ2VTT17LeWCIAZTWxoHZ6MQuh9NLko3 7ikBTijaP7hpQIN4PjhD4JHqAFcQEevBADfkWDPOZbafSDdERQchjJjsiq4WQ/V5 CjftL6UsS0ZLQF0vg97bQ8EyL/MEW1/piFPVHBvIJOZ/zXfx2sEuGtRanTGs8aM5 HBB7pnaxMiLb0xMy9B/8wdxPHhRSFNd4yDMLKMOeEjG2LJDa6bjzkn1Etbb99u51 6DIIWF08UUH+3RY3WQy7JVO57Zxdr1rUf3ALdssp3Op7uHJt5V58uXTvGY/dAsG5 e9uh0Ei6rzr3vee0LBTJe+zNZ0SnVblvkjOPSQA== 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=arctest; t=1521618041; bh=wJMagPkr3s5VJh8wTkIdozmdUk hv2tyUcILBl9k/A+s=; b=WwMK4SHda9t8nKJUrF5ohG2/+uAwM0YiRrItC1VaUl ICtKKbqkH+ePyb4oW/EDNMgfMJa5B7jGzptoJHdB5z8uGikVZDGF2qCmkTbkl2WQ mw1x2nEa45v9YyFlPlLknhz4fbIuSkjNtU/Wr/FmBnjBxAFAk26dY6d+LkzsVIRH yDhH9yAA2ekEdkFOYp4GBOh0EDrT8zbV1Ko5TGVX6HzRBLc8z1USgvB1sfYu3Chf QK/BjwdlmF+CoNVp8eT+pgdTE7lX8lS9SRYkqsFnEe8DmQA7AsT29/8ydkgD8Hsx x8U9is8XArKBkXu94UmVTK+pnbinaGnsmEhkSTAiL2zw== ARC-Authentication-Results: i=1; mx3.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=LjLxpcAS 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-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: mx3.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=LjLxpcAS 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-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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751502AbeCUHki (ORCPT ); Wed, 21 Mar 2018 03:40:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47668 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbeCUHkh (ORCPT ); Wed, 21 Mar 2018 03:40:37 -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 V6 Date: Wed, 21 Mar 2018 08:40:04 +0100 Message-Id: <20180321074032.14211-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.6 Gitweb: http://git.infradead.org/users/hch/vfs.git/shortlog/refs/heads/aio-poll.6 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 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