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.8 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 C4E93C433E1 for ; Fri, 14 Aug 2020 02:32:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8442D206DA for ; Fri, 14 Aug 2020 02:32:07 +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="eQ8hdHb0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8442D206DA 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 2F86F6B0007; Thu, 13 Aug 2020 22:32:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 25B316B000C; Thu, 13 Aug 2020 22:32:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 173ED6B000D; Thu, 13 Aug 2020 22:32:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id 0307D6B0007 for ; Thu, 13 Aug 2020 22:32:06 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BE3968248068 for ; Fri, 14 Aug 2020 02:32:06 +0000 (UTC) X-FDA: 77147599452.14.boys95_400e30b26ff9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 918D918229818 for ; Fri, 14 Aug 2020 02:32:06 +0000 (UTC) X-HE-Tag: boys95_400e30b26ff9 X-Filterd-Recvd-Size: 3622 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Aug 2020 02:32:06 +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=1Ox16uoz56iRpNNmrHLVdorDlsngwDtbNSjDHVTS/d4=; b=eQ8hdHb09rNm971hs2RNIMGwb+ 2mDzvLNKMzGSYZf4E7xmYQJ6qw0bQd9KELKQDf61OdCMP706HXYeTzN0QE9jveIhmZj/yWwMglCki xyd8/VRrrGaIPwPOJG3Ido8al1GNQSMvk7jgK6xZ9VA9/XwRuu3Q5tpoTA2H1nXm+8MUH2E9+yxuX tuqU1zTsXLHsSNKe9EJlKDRCv7xPfKXpv6WeZU6VT4EA2MH0QybWJ28HgmgvqVZ6fQqxWBvujaQwM y9h/rQZyGnbDrjfy3Jt+YxsFYlFPMAows2sHKaA6/Wj1otYTXXIFpQEg6odOpjAjra1K7uz0pSHNd 58FtSJIw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6PVc-0002Et-0e; Fri, 14 Aug 2020 02:31:56 +0000 Date: Fri, 14 Aug 2020 03:31:55 +0100 From: Matthew Wilcox To: Zhaoyang Huang Cc: Roman Gushchin , Andrew Morton , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Subject: Re: [PATCH] mm : update ra->ra_pages if it's NOT equal to bdi->ra_pages Message-ID: <20200814023155.GU17456@casper.infradead.org> References: <1597368611-7631-1-git-send-email-zhaoyang.huang@unisoc.com> <20200814014355.GS17456@casper.infradead.org> <20200814020700.GT17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 918D918229818 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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, Aug 14, 2020 at 10:26:23AM +0800, Zhaoyang Huang wrote: > On Fri, Aug 14, 2020 at 10:20 AM Zhaoyang Huang wrote: > > > > On Fri, Aug 14, 2020 at 10:07 AM Matthew Wilcox wrote: > > > > > > On Fri, Aug 14, 2020 at 02:43:55AM +0100, Matthew Wilcox wrote: > > > > On Fri, Aug 14, 2020 at 09:30:11AM +0800, Zhaoyang Huang wrote: > > > > > file->f_ra->ra_pages will remain the initialized value since it opend, which may > > > > > be NOT equal to bdi->ra_pages as the latter one is updated somehow(etc, > > > > > echo xxx > /sys/block/dm/queue/read_ahead_kb).So sync ra->ra_pages to the > > > > > updated value when sync read. > > > > > > > > It still ignores the work done by shrink_readahead_size_eio() > > > > and fadvise(POSIX_FADV_SEQUENTIAL). > > > > > > ... by the way, if you're trying to update one particular file's readahead > > > state, you can just call fadvise(POSIX_FADV_NORMAL) on it. > > > > > > If you want to update every open file's ra_pages by writing to sysfs, > > > then just no. We don't do that. > > No, What I want to fix is the file within one process's context keeps > > using the initialized value when it is opened and not sync with new > > value when bdi->ra_pages changes. > So you mean it is just the desired behavior as having the opened file > use the initialized value even if bdi->ra_pages changed via sysfs? That's right. If that's not the behaviour you want, call fadvise(POSIX_FADV_NORMAL). > > > > > > You haven't said what problem you're facing, so I really can't be more > > > helpful.