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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 1A10FC4741F for ; Tue, 29 Sep 2020 13:52:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3BFB7207C4 for ; Tue, 29 Sep 2020 13:52:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="RwnVJiqj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BFB7207C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9D9D3900002; Tue, 29 Sep 2020 09:51:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98B2E8E0001; Tue, 29 Sep 2020 09:51:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87B11900002; Tue, 29 Sep 2020 09:51:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id 6EEC78E0001 for ; Tue, 29 Sep 2020 09:51:59 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 328DC2496 for ; Tue, 29 Sep 2020 13:51:59 +0000 (UTC) X-FDA: 77316237558.22.board80_3e089d32718a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 0FECC18038E68 for ; Tue, 29 Sep 2020 13:51:59 +0000 (UTC) X-HE-Tag: board80_3e089d32718a X-Filterd-Recvd-Size: 4148 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Sep 2020 13:51:58 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id z25so4841232iol.10 for ; Tue, 29 Sep 2020 06:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WMGmtQa6ClPKTk9I0Qe27ZlY0TWICUs47q8H5rtasZQ=; b=RwnVJiqjR7A6uB4vz9E0Hl3Uaz7PqUw5pEA7JYBDirM1jpuHZbHGShYEFxeHRu+luw TrDMOzXRcVmK4fSozUu+g00fZLSkZUZg+6p6OWiag+ZAHNS09Ct2cihob+vv5vxw8QEa MZY9sXpiiW+j5Szb7SHNFsE8S0voiaWXCihESKgxepWPNadISVOG6Sx/7sEKMbdBP8MP rpLjg7PotTz6X8wYxofaTnSaIBtYQsKp5MwLCzpHBKQrTw+i064emrMKygCM9U3PN9O4 1ydL651S90YYK9gy+9GvD/pmM36QTCEEPwpa2Fh0tOkbfl+6RBWYjOGRTVjPocDXNRan BOJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WMGmtQa6ClPKTk9I0Qe27ZlY0TWICUs47q8H5rtasZQ=; b=ALum1xOBK7b9TsK84UZs0y0OFqobTDz7ar+2fGi9UrYNGzxg11jzu6xjBFiB1NTOBF fdKJxHrTzlFJghhgBAP9fXBSJSmxx1BInlCzeblq/s2oD7fMi0FFlaoFdtzWnhkLOR6t Sn0A/fglMT857aiv0gM8DJO08cCRGzJJolpoRxYDnBAxuhyB7RX6vYZbe1EiQFyjpgdF GT6PFQo7VS7UY7G1MDhdtAYyIw6kqjJTrRO5LQywwKr7bk2AKrwT0ftyn5maE3tAqi2O gUPpeuZpYkX/rqRXw3BkXDbxkeEsCQc6c6hufxXoZrz83daUmUtLDoyiJ5LRrwA0DPQ7 2rxw== X-Gm-Message-State: AOAM533eYIbLAd+IAdjUyEnRIRiRoTBY1Nbi9S9uwsG2Ow/BCJCqiLkn I6vkYcFBsPUcbPT/WaRtcY4udMPfdt5FnA== X-Google-Smtp-Source: ABdhPJwBipjRGAd/WYNkjmrd5zb834hQvg99Ll5t5VuQ66gayLCoS3zLN+dUWPhlE4wQ+qZsUOSlfA== X-Received: by 2002:a02:8782:: with SMTP id t2mr2973143jai.56.1601387517454; Tue, 29 Sep 2020 06:51:57 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id f2sm2441545ilk.38.2020.09.29.06.51.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Sep 2020 06:51:56 -0700 (PDT) Subject: Re: [PATCH] io_uring: support async buffered reads when readahead is disabled To: Hao Xu , io-uring@vger.kernel.org Cc: viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <1601380845-206925-1-git-send-email-haoxu@linux.alibaba.com> From: Jens Axboe Message-ID: <6ef7da28-f6a6-827e-4881-dd78a4b92bf5@kernel.dk> Date: Tue, 29 Sep 2020 07:51:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1601380845-206925-1-git-send-email-haoxu@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/29/20 6:00 AM, Hao Xu wrote: > The async buffered reads feature is not working when readahead is > turned off. There are two things to concern: > > - when doing retry in io_read, not only the IOCB_WAITQ flag but also > the IOCB_NOWAIT flag is still set, which makes it goes to would_block > phase in generic_file_buffered_read() and then return -EAGAIN. After > that, the io-wq thread work is queued, and later doing the async > reads in the old way. > > - even if we remove IOCB_NOWAIT when doing retry, the feature is still > not running properly, since in generic_file_buffered_read() it goes to > lock_page_killable() after calling mapping->a_ops->readpage() to do > IO, and thus causing process to sleep. Thanks, this looks great, and avoids cases of io-wq punt where we don't need it. I'm going to run this through full testing, but I think this looks good to me. -- Jens Axboe