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.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,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 0A763C388F9 for ; Thu, 22 Oct 2020 14:55:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6898B24630 for ; Thu, 22 Oct 2020 14:55:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6898B24630 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DCF1E6B0073; Thu, 22 Oct 2020 10:55:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D58E06B0074; Thu, 22 Oct 2020 10:55:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C48AB6B0075; Thu, 22 Oct 2020 10:55:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id 917526B0073 for ; Thu, 22 Oct 2020 10:55:47 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E08DD3629 for ; Thu, 22 Oct 2020 14:55:46 +0000 (UTC) X-FDA: 77399860692.17.pin45_5e1377827251 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id B4C9C180D0180 for ; Thu, 22 Oct 2020 14:55:46 +0000 (UTC) X-HE-Tag: pin45_5e1377827251 X-Filterd-Recvd-Size: 2142 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Thu, 22 Oct 2020 14:55:45 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=haoxu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UCr-fjM_1603378536; Received: from B-25KNML85-0107.local(mailfrom:haoxu@linux.alibaba.com fp:SMTPD_---0UCr-fjM_1603378536) by smtp.aliyun-inc.com(127.0.0.1); Thu, 22 Oct 2020 22:55:37 +0800 Subject: Re: [PATCH RFC] mm: fix the sync buffered read to the old way To: Matthew Wilcox Cc: Jens Axboe , io-uring@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Andrew Morton References: <1603375114-58419-1-git-send-email-haoxu@linux.alibaba.com> <20201022141037.GS20115@casper.infradead.org> From: Hao_Xu Message-ID: Date: Thu, 22 Oct 2020 22:55:36 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201022141037.GS20115@casper.infradead.org> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: quoted-printable 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: =D4=DA 2020/10/22 =CF=C2=CE=E710:10, Matthew Wilcox =D0=B4=B5=C0: > On Thu, Oct 22, 2020 at 09:58:34PM +0800, Hao Xu wrote: >> The commit 324bcf54c449 changed the code path of async buffered reads >> to go with the page_cache_sync_readahead() way when readahead is >> disabled, meanwhile the sync buffered reads are forced to do IO in the >> above way as well, which makes it go to a more complex code path. >=20 > But ->readpage is (increasingly) synchronous while readahead should be > used to start async I/Os. I'm pretty sure Jens meant to do exactly wha= t > he did. Yes, we should start async I/Os with readahead, but why should we do the=20 sync I/O like syscall read() in this way too when ra->ra_pages is 0? >=20