Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp61455pxa; Thu, 13 Aug 2020 19:34:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwen/CX7qa7ADRkGWhrvvHbsWkAC/GAxHYZNsbM380ycCg3e86ZHrCwIC8PiWO2MthNt2x3 X-Received: by 2002:a17:907:20f5:: with SMTP id rh21mr419337ejb.194.1597372446739; Thu, 13 Aug 2020 19:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597372446; cv=none; d=google.com; s=arc-20160816; b=ancZm3xdjsvlHF5RLZrduEF8FqZpgzjAPIHaNW5yOguzYRjq0XXMMSSr/V3saETceR YpCB/KfV42AoNGdwEVnIIo4CtJYwHGv+xHIkfAAFgDttBBAjCHLGKvq9z2SVuTIe6dUQ C5b7a18geLKpwvlw/m4JLNicVepzqZU+9zQgILoa4fy0Mu5si0kLkUl/Xw+DxMMNcgKl d3DdA57NjVzFQuHd9+fhaj6G75+0LdQI0ucNkKK7cjsVP4s87jC6FckVI/I7WdijXc8L EVa65sMNF1YcmF3iP+kEVwoAmYmroTs2eWM9Y7WhVVpT7fl7d7lNMuKDPDNx+PubCiGz c2DA== 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=1Ox16uoz56iRpNNmrHLVdorDlsngwDtbNSjDHVTS/d4=; b=PmFEJGMM6D10l06XN6wlaZBMDD5eckk/+PpwVU6Ahrevwf4fTXbT4iQW0UVsa8+R+5 pbePocwjwFHZ1/rOWhn1hbjqpdRflx9C17oD0ER5CarqsLOjiBFAxMdTOiFZ2lZys9Mn r6UYkEFSn58lzWcdG6Gpi5quABlm9mjfE/xSIZh47YGzmA4GssUPZp9lqTVip/VU6158 M4dAEFShhor0x3liTZvC9kp1dfO2C55V6XkpqU80UDe6mmG6FVp43sUFLuC431GZeDsX 1a/ORpYD51RMa4dJ7PnDtY1OW0vi3pR/j80YtpxlmWVSb240iPnFMbARvT1r4J2r/kzB HxRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=eQ8hdHb0; 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 q8si4611495edn.409.2020.08.13.19.33.43; Thu, 13 Aug 2020 19:34:06 -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=eQ8hdHb0; 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 S1726680AbgHNCcI (ORCPT + 99 others); Thu, 13 Aug 2020 22:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbgHNCcI (ORCPT ); Thu, 13 Aug 2020 22:32:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E00CEC061757 for ; Thu, 13 Aug 2020 19:32:07 -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=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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.