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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham 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 79CABC433B4 for ; Fri, 2 Apr 2021 08:52:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3366960FE7 for ; Fri, 2 Apr 2021 08:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233718AbhDBIwZ (ORCPT ); Fri, 2 Apr 2021 04:52:25 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:45351 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhDBIwU (ORCPT ); Fri, 2 Apr 2021 04:52:20 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=haoxu@linux.alibaba.com;NM=1;PH=DS;RN=2;SR=0;TI=SMTPD_---0UUEBL8T_1617353535; Received: from B-25KNML85-0107.local(mailfrom:haoxu@linux.alibaba.com fp:SMTPD_---0UUEBL8T_1617353535) by smtp.aliyun-inc.com(127.0.0.1); Fri, 02 Apr 2021 16:52:15 +0800 Subject: Re: [PATCH] io_uring: don't mark S_ISBLK async work as unbounded To: Jens Axboe , io-uring References: From: Hao Xu Message-ID: <48023516-ac7d-8393-f603-f9bf4faa722f@linux.alibaba.com> Date: Fri, 2 Apr 2021 16:52:15 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org 在 2021/4/1 下午10:57, Jens Axboe 写道: > S_ISBLK is marked as unbounded work for async preparation, because it > doesn't match S_ISREG. That is incorrect, as any read/write to a block > device is also a bounded operation. Fix it up and ensure that S_ISBLK > isn't marked unbounded. > > Signed-off-by: Jens Axboe > Hi Jens, I saw a (un)bounded work is for a (un)bounded worker to execute. What is the difference between bounded and unbounded? Thanks, Hao > --- > > diff --git a/fs/io_uring.c b/fs/io_uring.c > index 6d7a1b69712b..a16b7df934d1 100644 > --- a/fs/io_uring.c > +++ b/fs/io_uring.c > @@ -1213,7 +1213,7 @@ static void io_prep_async_work(struct io_kiocb *req) > if (req->flags & REQ_F_ISREG) { > if (def->hash_reg_file || (ctx->flags & IORING_SETUP_IOPOLL)) > io_wq_hash_work(&req->work, file_inode(req->file)); > - } else { > + } else if (!req->file || !S_ISBLK(file_inode(req->file)->i_mode)) { > if (def->unbound_nonreg_file) > req->work.flags |= IO_WQ_WORK_UNBOUND; > } >