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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 E818FC43461 for ; Fri, 11 Sep 2020 09:47:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 778FB21D92 for ; Fri, 11 Sep 2020 09:47:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="EJGNAKBU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 778FB21D92 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ACF026B005A; Fri, 11 Sep 2020 05:47:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A57976B005C; Fri, 11 Sep 2020 05:47:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F78C6B005D; Fri, 11 Sep 2020 05:47:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id 7650C6B005A for ; Fri, 11 Sep 2020 05:47:15 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 362CD180AD815 for ; Fri, 11 Sep 2020 09:47:15 +0000 (UTC) X-FDA: 77250302430.01.price14_401862a270ed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 0E5C01004FCDD for ; Fri, 11 Sep 2020 09:47:15 +0000 (UTC) X-HE-Tag: price14_401862a270ed X-Filterd-Recvd-Size: 2873 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Sep 2020 09:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L3X8xRwkx+bS9wefHd4PLR1ppf5H6eLchw4L2TMwyQA=; b=EJGNAKBUZsRB1/eNTBiS6GHF89 i7d/sB0L79tFvN/qw1F20qwktKYNnfU3hAJtUz3hHMKDbmrCIZnDK6xfh80ZXOipJSNQwiXAAczsZ ytlLq5W+TYJALVw7PtSccUiZ1czYzviuuWz7CmFm3NyQg+EPpanzeiUvsNLQA0l11Y9LCHsM8qtjK IRhyI8ipp96ycmM1jtWFtTnvp7HpN4IsFB/XpuBTrN9kYwX7l6anEFi4+YpWxnlw0uVs2s5AxP5HO 533SKecBTDOr8kE88HCxX8bWCeNN5wqkMi1g3+lvCQjFXvKwHhK26B8wPNuIy5xSO2WNA1H01o0P3 ByLJ3qUg==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfe9-0003yx-2r; Fri, 11 Sep 2020 09:47:09 +0000 Date: Fri, 11 Sep 2020 10:47:09 +0100 From: Christoph Hellwig To: Bean Huo Cc: Andrew Morton , Christoph Hellwig , linux-mm@kvack.org, linux-kernel@vger.kernel.org, beanhuo@micron.com, Richard Weinberger Subject: Re: [PATCH RFC] mm: Let readahead submit larger batches of pages in case of ra->ra_pages == 0 Message-ID: <20200911094709.GB14158@infradead.org> References: <20200904144807.31810-1-huobean@gmail.com> <20200904110938.d9a2cb53a58e67a15c960f47@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 0E5C01004FCDD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Fri, Sep 11, 2020 at 10:15:24AM +0200, Bean Huo wrote: > > What is special about ->ra_pages==0? Wouldn't this optimization > > still > > be valid if ->ra_pages==2? > > > > Doesn't this defeat the purpose of having ->ra_pages==0? > > > Hi Andrew > Sorry, I am still not quite understanding your above three questions. > > Based on my shallow understanding, ra_pages is associated with > read_ahead_kb. Seems ra_pages controls the maximum read-ahead window > size, but it doesn't work when the requested size exceeds ra_pages. > > If I set the read_ahead_kb to 0, also, as Christoph mentioned, MTD > forcibly sets ra_pages to 0. I think the intention is that only wants > to disable read-ahead, however, doesn't want > generic_file_buffered_read() to split the request and read data with > 4KB chunk size separately. They way I understood Richard this is intentional.