Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3687542yba; Tue, 9 Apr 2019 02:38:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDlFS+T3haJzLZQclhg6tLJSoNfVAViD5JQjtaq3X2PWW+e15/2QywBNL1SA2lZ6A15HRa X-Received: by 2002:a62:3583:: with SMTP id c125mr34980513pfa.169.1554802707151; Tue, 09 Apr 2019 02:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554802707; cv=none; d=google.com; s=arc-20160816; b=rG3PfRtbqRCobZvY1Easipfsv09HhcgEM6qeaLjPF3fe/vd4OUkfajqUhZVG8HlrIj U9bWp0+fEAg4K0/AVm6eVE2sweAHUa491tbMFSyO17dBh0bCI07IhKi4DX8Pw8AqD5Cb 0mIVtLPfOzLskVHjRCsUDLb2SwD7NsJ5nxWHmHnUkxbmlszoA1qrQq9TjZ9SiLNZfwiS LeB9lvXAtq8Vk2gbSIyZrqdmm5PlmUsRKAUZmdw+fPwRCnPQ/4xsLrJWuPbZTEXTkSjP 7IBm5EJMgTnnFc5TIYptoGO9kysVfsC/Jib6qGFGcRiTtZJ1msHgAtMLB/pGHNqdwaJx 9rKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=op+L4NAIEip0r58yPjKmf3F8G9uO01A+HqsRyJmhuOk=; b=H1cf4YVaeEPzI97eF0QCOkZHfYYc5td9smGzt+QmDmOuiBq/tSuJVyRMHhY+hKA/fC C7Y4X6dF6bnWwy67uCmz0RmHGoNFtgGdtHNDuKiY6RM44hPuZ+aFpMcERiWJz9DCrsSu tDTVcubqCtX8YRxEXHKTgdYLQhTzpkjzptYaIrlUAwOe0XeFbfUP993ZPXCpZynH4c4g FpW1MB+h0MVza855FQH/Aaqzb3dEFgShfkdtU1N1fxxE09bY0wVuD/QZvXabNo6VxQDp rgXJ4M5Xdp78QWVtyp078fIPZwNDI0qe4aJXnAdgqHKjQP/LubshbAhv9jog1I5WhN9e tuBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fz6LU0al; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si16637283pfa.282.2019.04.09.02.38.11; Tue, 09 Apr 2019 02:38:27 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fz6LU0al; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbfDIJhb (ORCPT + 99 others); Tue, 9 Apr 2019 05:37:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40004 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfDIJha (ORCPT ); Tue, 9 Apr 2019 05:37:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=op+L4NAIEip0r58yPjKmf3F8G9uO01A+HqsRyJmhuOk=; b=fz6LU0alZO7FY5Utkhh712m5n vLFvh0i40N94cWI4HjYxVK/+7ojT8bU5W3w8N6fuG3SMebYzAEP8CdzYQ/8dJYIYBPA36ebrnOgmq I7++msO2QV+8run0z2TO4JhWkJiDtrRILoCrNazz8/Hg6nYvhTf38+YsYfcE2yo/aNrfnCrLT73AF qPaQoYs/jmxDFjMhHYU2dpYfeD50KjglonTDz4QKon9otNgJzqCNblJrzJd4vaTFkJpHIYgXdFW+d h9S0Jpjx5jzE0cwuztGXrJNlua26EPVpAIxASJW1l1O0x43RF7Ti18iPbLh9TT4rIV6eURgGN5Fy1 qplfJMChA==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDnBt-00046Y-Nt; Tue, 09 Apr 2019 09:37:17 +0000 Date: Tue, 9 Apr 2019 02:37:17 -0700 From: Christoph Hellwig To: Jianchao Wang Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] io_uring: introduce inline reqs for IORING_SETUP_IOPOLL Message-ID: <20190409093717.GA15391@infradead.org> References: <1554787314-27179-1-git-send-email-jianchao.w.wang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1554787314-27179-1-git-send-email-jianchao.w.wang@oracle.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 09, 2019 at 01:21:54PM +0800, Jianchao Wang wrote: > For the IORING_SETUP_IOPOLL case, all of the submission and > completion are handled under ctx->uring_lock or in SQ poll thread > context, so io_get_req and io_put_req has been serialized well. > The only exception is the asynchronous workqueue context where could > free the io_kiocb for error. To overcome this, we allocate a new > io_kiocb and free the previous inlined one. > > Based on this, we introduce the preallocated reqs list per ctx and > needn't to provide any lock to serialize the updating of list. The > performacne benefits from this. The test result of following fio > command I really don't like the idea of exposing this to userspace. Is there any good reason to not simply always allocate inline request up to a certain ring size?