From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6968DC48BCD for ; Wed, 9 Jun 2021 15:35:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E4D761354 for ; Wed, 9 Jun 2021 15:35:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234693AbhFIPhA (ORCPT ); Wed, 9 Jun 2021 11:37:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232861AbhFIPg7 (ORCPT ); Wed, 9 Jun 2021 11:36:59 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1ABCC061574 for ; Wed, 9 Jun 2021 08:35:04 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id l1so39126674ejb.6 for ; Wed, 09 Jun 2021 08:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:references:from:subject:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=c5/iYvlDXHOkhzybG+NWeDWFHKeJp7EHL9FL7L25/1o=; b=JM+OYEjtpG60fHwlfID+s+eruAc7KaE+z12eblq4tyEqm6Ncg6h/pA/UWJQ2cNty6M PFBU61y2Gcjfv2qShBern5E0PbAFYMaB8jWPSfInGVPUSEe8NmwSzEA6Jzvmyn5FWXlO LduYYrltLAi/fRln+kEdJnPed3aWcw3LJduJsxDlgcvKr9eIPj83PvEzou+7DOphZqrJ gI0quX+BuZ6PVmIg15gAJE5xw4FyFFPtWG6KIv/1ZYg2e4e53JyPZomDFBBiYQbKVM5u yi4tziefr9skMPCisbPcGPpzWymYrXfh6whp0y1ByNIwoD7Zztb8SfabzYBhhPVM3AGK r1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c5/iYvlDXHOkhzybG+NWeDWFHKeJp7EHL9FL7L25/1o=; b=oI0lkJVDymWnUN8tGHaOnVfba4BvIozbiFlUfsyK7hyIJeWFlcYCTMnxwaGERocUNE HShskxX+RGRBZHapu34QI2TmQ8cFoqngcORmdhznCMr3e0VeKe90ahQVEmhI8R80q9Hh ihDn1eAATi+9B2Ckq0OAgYjeib1xCELHHxISmDJ5ToHX5ubpnak9kgTbMGXsOMyMe+qw m4IjtUDaLhuY8So0C3x6SFdvfSEidVHBmQQq1qB9wGMlTB5PjCEoHgAGpfFdVVOD74/l 2Uso9+LlykV3Lk5I+oWz7yKmStwiuaa7DzVw8/BKeYERIP+QVI/N3zd40ISpLsKLgHqe VMhg== X-Gm-Message-State: AOAM5310sGOCFc9mlfs1dizoFPRRVPRUS6Uu9SskIhcU9chK40OSi29G 8qolZLa7SFnv0dqHMNAi6RlFp0OiAGEi5LVC X-Google-Smtp-Source: ABdhPJyGlYRSFQ68tkvkpDvkxYWLhgRuODpe8P9UUF8fKajfkZN8gJH4RrZOktMyuEgy4ae7V0wCGg== X-Received: by 2002:a17:906:f111:: with SMTP id gv17mr432394ejb.435.1623252901677; Wed, 09 Jun 2021 08:35:01 -0700 (PDT) Received: from ?IPv6:2620:10d:c096:310::2410? ([2620:10d:c092:600::2:44bc]) by smtp.gmail.com with ESMTPSA id f18sm26450ejz.119.2021.06.09.08.35.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 08:35:01 -0700 (PDT) To: Jens Axboe , io-uring@vger.kernel.org References: From: Pavel Begunkov Subject: Re: [PATCH] io_uring: fix blocking inline submission Message-ID: Date: Wed, 9 Jun 2021 16:34:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 6/9/21 4:07 PM, Jens Axboe wrote: > On 6/9/21 5:07 AM, Pavel Begunkov wrote: >> There is a complaint against sys_io_uring_enter() blocking if it submits >> stdin reads. The problem is in __io_file_supports_async(), which >> sees that it's a cdev and allows it to be processed inline. >> >> Punt char devices using generic rules of io_file_supports_async(), >> including checking for presence of *_iter() versions of rw callbacks. >> Apparently, it will affect most of cdevs with some exceptions like >> null and zero devices. > > I don't like this, we really should fix the file types, they are > broken if they don't honor IOCB_NOWAIT and have ->read_iter() (or > the write equiv). > > For cases where there is no iter variant of the read/write handlers, > then yes we should not return true from __io_file_supports_async(). I'm confused. The patch doesn't punt them unconditionally, but make it go through the generic path of __io_file_supports_async() including checks for read_iter/write_iter. So if a chrdev has *_iter() it should continue to work as before. It fixes the symptom that means the change punts it async, and so I assume tty doesn't have _iter()s for some reason. Will take a look at the tty driver soon to stop blind guessing. -- Pavel Begunkov