Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2073308ybg; Sun, 27 Oct 2019 10:29:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYvWQTTTXWgo0Pwcss7DLICYm0sSeOyESver0VstkqEUMpZdcafKLtAjblsnJZgZeeFMlD X-Received: by 2002:a17:906:7f06:: with SMTP id d6mr10664299ejr.323.1572197372284; Sun, 27 Oct 2019 10:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572197372; cv=none; d=google.com; s=arc-20160816; b=Tx2bKiWOXIgZJFG8HFJPX5naEac5bldX4gamNhpBbX9rs316WgxTsRGp0rcYKuwuxP uL1vWyokEhKvtv9bEwlmcaxxAt9djm8YviZGCXjHktoC9pyV2U93xTCA6eQHs4NQdQXn HAs9XvirgHF5CyxGe4GH4ow4lHSIPVA+EduUFtHL3+wq9IuwlJxvJcS7wF9CngKVnpP7 WUmLVn0ASx0D3axlHqnKwo+JPPWhpUzEip7e7iHTTZgMS7MGqqnjRTYVuPymlZ264Mv6 hPNE96L7Vq8FhroXCcAv2r+J3Lq7sBnU3Idha/Yq9Giq86uV+je16YeK8PfMznZfYSOg NDYg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:to:from:subject:dkim-signature; bh=WMklfu5SAQV6R0CPDuoC7Wh6fDlyi/L1KoUw5s6wFWk=; b=UWdA/oSKSYYLY1ShLodz+RLsB40uNT2yYppfop4ixAQGD1IccGxg5J+bMfIa7kt2iB LfEVx+8ao0cWxGOTSvZBm2c+k6dVpv9UhVwThMaFy8NrzHmyX4C2mWMImibjglkA2XOL ijeS8y5XPU3S9XK4jfWtRZlf/yg4SYEuWaxWck/Oj2G+X+aLzm/CoKMFgahPmHgitX99 H1XFDI0fQkiRlnXKxnNr96PW1q8gQjkSK5HsoPkJi+pDELycE09sRMC5rNtHL10KHwgn rXgkCF7pF1q1epWSjiyluoJ+zPiGMgXNMKvQ3UAHK+QlDIDJDC/CgWkZ1pOdFfSmJu2H XUyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=E15rO6N9; 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 p16si4625358ejj.360.2019.10.27.10.29.07; Sun, 27 Oct 2019 10:29:32 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=E15rO6N9; 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 S1727313AbfJ0Q4w (ORCPT + 99 others); Sun, 27 Oct 2019 12:56:52 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40089 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727237AbfJ0Q4w (ORCPT ); Sun, 27 Oct 2019 12:56:52 -0400 Received: by mail-pl1-f196.google.com with SMTP id d22so4118391pll.7 for ; Sun, 27 Oct 2019 09:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=WMklfu5SAQV6R0CPDuoC7Wh6fDlyi/L1KoUw5s6wFWk=; b=E15rO6N9GSrjCyUNUBa+ms4uSI5E1+gtIw4EMgfQzpaTXKaEtXyWk4/WJxndmJUEjJ p9S3G3K4R7tyyBcvsxLwAeDJG3/JcqEBBSGfol1EP2t1vnv7BKOxZEPLyGRTcEnwmm3B C3lXvqSdk9QrqMx/TSXUWsdu5qPDs23Gb8ZDu2nzZxmDL5Y88TVe/le+ODBWdsSInrnD IWQpv0ehoZQC1KqzqlMQzjC590gxmtCaxt91BKTOkUeHzdxqEUOocfeWlaFZ9WKC9Bxn bkfrz8TIJVTa6KTxNXl7mBMIpNXeERU6F2rR0Ebc9tqzFH8pb/RFREABGOw74FZ8XQ+9 cawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WMklfu5SAQV6R0CPDuoC7Wh6fDlyi/L1KoUw5s6wFWk=; b=rzY/TzVmDOszDp8th5MtRGePwyyHyRzHlremlCsw/U7VxZFgG15pnF6/1vvpMt4sru Ze0RO6iVq7GLLIwlQwjduWV+9lLZjjGqOeNmuTNsPNJaOHHa1Y48xZ6eS6+6zxgHoNgb OY4zo0KJtr3RUPH39RdC1CwVdHtoPoNkiVFB4eWVUqH6DE0IHzQ/1y2Bq4QyJMqiwVo8 JukgpYTuiutEnrtkE7+uuQ32t2b78gir73z7sFxZ15C8Nv2Mm+C5i7N1tBrronF7ek2N 51GD9J6HKlx9/PJ6JTbNErrT/HpQ2zWvN/YD8G7wOPfW8uHGz1JpYHxnGxlrHw6sJ8+T 0a5w== X-Gm-Message-State: APjAAAU4Mq9XhPWTIbt4ncVNTY0dTJhNb7kgCZUy1BztHfaMarwLFJsV /E8XtRXb9HFFE8EBUZxXcPH4EfBLiSw8iQ== X-Received: by 2002:a17:902:122:: with SMTP id 31mr15001368plb.257.1572195409808; Sun, 27 Oct 2019 09:56:49 -0700 (PDT) Received: from [192.168.1.188] ([66.219.217.79]) by smtp.gmail.com with ESMTPSA id j11sm5085244pfa.127.2019.10.27.09.56.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Oct 2019 09:56:48 -0700 (PDT) Subject: Re: [PATCH 0/2][for-next] cleanup submission path From: Jens Axboe To: Pavel Begunkov , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <666ed447-ba8f-29e7-237f-de8044aa63ea@kernel.dk> <5ec9bd14-d8f2-32e6-7f25-0ca7256c408a@gmail.com> Message-ID: Date: Sun, 27 Oct 2019 10:56:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/19 10:49 AM, Jens Axboe wrote: > On 10/27/19 10:44 AM, Pavel Begunkov wrote: >> On 27/10/2019 19:32, Jens Axboe wrote: >>> On 10/27/19 9:35 AM, Pavel Begunkov wrote: >>>> A small cleanup of very similar but diverged io_submit_sqes() and >>>> io_ring_submit() >>>> >>>> Pavel Begunkov (2): >>>> io_uring: handle mm_fault outside of submission >>>> io_uring: merge io_submit_sqes and io_ring_submit >>>> >>>> fs/io_uring.c | 116 ++++++++++++++------------------------------------ >>>> 1 file changed, 33 insertions(+), 83 deletions(-) >>> >>> I like the cleanups here, but one thing that seems off is the >>> assumption that io_sq_thread() always needs to grab the mm. If >>> the sqes processed are just READ/WRITE_FIXED, then it never needs >>> to grab the mm. >>> Yeah, we removed it to fix bugs. Personally, I think it would be >> clearer to do lazy grabbing conditionally, rather than have two >> functions. And in this case it's easier to do after merging. >> >> Do you prefer to return it back first? > > Ah I see, no I don't care about that. OK, looked at the post-patches state. It's still not correct. You are grabbing the mm from io_sq_thread() unconditionally. We should not do that, only if the sqes we need to submit need mm context. -- Jens Axboe