Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp142060pxk; Fri, 11 Sep 2020 02:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwreQEqpNSgt1nocM+jk/BHfbr/hPnosTfRf0xwbzfP5QpKvqjL2CqlYzqVsuVK0U7g/I6K X-Received: by 2002:aa7:c1c3:: with SMTP id d3mr1123324edp.228.1599817720908; Fri, 11 Sep 2020 02:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599817720; cv=none; d=google.com; s=arc-20160816; b=AgYFw79LldkAhmbp9fpe09CuFgLD/OTsz9TYWhQ/nhE7AuFAxdKcjCiDQb3OhiTprh cfESwXfABCrwhy3h38juHg4x4B+bP1oGJszsQwkT9zA/6epl7pzhM4haWNTbSNpI/ej2 ur/kQvpOuruVj/KdCucuHCZ26vdjL4v1hV9/6gegKeavvK4x7aJ50DS0U7adEpaEy/QP hMjSLkzMSzTlMLdJ+jxLWBq9phDHv08uhXRKQv2gpyCq0Pfw3abKqWts79gChWZQpsOs Ygj48M6+3xjpjpDvKHY/MB4xGBxfY5+gxNmkFcdgFklwz9N1BQC+qGOidvU70RqsbwPj SKPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L3X8xRwkx+bS9wefHd4PLR1ppf5H6eLchw4L2TMwyQA=; b=mwshE1XgQMOBONlMjTPkesZh8kua5N2ss3dCmxDfw/+8LMrIsI4u+KDfXxsKhXaDwO doGJXmct12mCT9nhHoRymZxJI+FDgs3KNoZEIdD3sqLBxOqx9DwP1ZEncgTtKT4XdDZK 70tQiOb4HmN9xOrvJZ+m6dFK5Q9SxgwMqhj52/RNaZJklCkXDgtWs/2PvMsOMDJHGJAG If1can/XL165Iqr90KqG0nFTq3Hqkr9cyGlcQESifOsdLe4/INnMOoQBv5pR3p8taxH7 cGK+FcGzlLCX4vUDSakxZxvjUbQ2Uo2TLLtQZ1f8QmoTXF7TcEN7HmINiGAJEMf+9idU iumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=EJGNAKBU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v15si1027482edj.197.2020.09.11.02.48.16; Fri, 11 Sep 2020 02:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=EJGNAKBU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725810AbgIKJrN (ORCPT + 99 others); Fri, 11 Sep 2020 05:47:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgIKJrM (ORCPT ); Fri, 11 Sep 2020 05:47:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD122C061573 for ; Fri, 11 Sep 2020 02:47:11 -0700 (PDT) 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.