Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp61751pxa; Thu, 13 Aug 2020 19:34:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwodDugUtK0RRuAZKYegnaeGU1fss6VK1/gkK0yTPHPFCxGDuyowep7+FA7ONlQ/BtrEiQk X-Received: by 2002:aa7:d410:: with SMTP id z16mr267198edq.287.1597372485317; Thu, 13 Aug 2020 19:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597372485; cv=none; d=google.com; s=arc-20160816; b=sSUAcqq5uGZmBpIHrX6wGnwnyvuu7pOVAFWerTnbI6PWwTSlvFWIoC2gRbJBBdyVmK /PUDU1He1uq14Fv3wwghZsotgjbDWEPMFfE3xrfNInSkg2Oqc3iLz3fE6KlG8m8CKs8a T2YW4AjGeVOQ21XQja/wgElDoGSJy72xvWR5uLwakb8zgM8rpi3nd4X/byQChdQGlEW/ tzFCfDSJuT4qK7npFJQrxbv0cY/h0cmbMb2rs2rLSlB+mbzV4pb3iXmz0hC3eZ6yJC2C o5bRAWOvmu5wl855p8pict4UivWWrVlw6B3b8uG1Otxb7iwCfwYaJn0JB/TUWFgxWJhj ypng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=nyYKMDI74ETWUdXaXdZ56M5D+5IOJjn9U7PKDBxQ268=; b=yF8D4cw488/ctJgysqpjTuBfYoKhp2fmwajJxU3F14BuTsp9vNQ9CSWFN64PKBq7HI o1UXkAauzCb1BmtpGZZh7OsBa9TJofoJufO9k8EYLnBtUTOu+GIS3499+JA0csCXjfTY a2FruyqswciS4bAR45pfU2KyMvZ+5EiM+2xJNyA5g4UDiNvWEBVU21ilgpu30yOuaFXt 8A3qFW1BbxBYd2oEkbLzqyyHtc3AJB+Hu5Mg6V5U/UAMK51ZN9KL2UkUECIOoIdouIxV 06a90feDfIwUQawcPMeHn6I5O6iYWYodyoV1/taG8KGpSoC/5pVMojR9pjPoYpvQRr/u pYeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NGJsz+9Z; 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 b5si4582258edf.85.2020.08.13.19.34.22; Thu, 13 Aug 2020 19:34:45 -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=pass header.i=@kernel.org header.s=default header.b=NGJsz+9Z; 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 S1726597AbgHNCdK (ORCPT + 99 others); Thu, 13 Aug 2020 22:33:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:54640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726570AbgHNCdJ (ORCPT ); Thu, 13 Aug 2020 22:33:09 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44E5C206DA; Fri, 14 Aug 2020 02:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597372388; bh=FxQK/+6mDIN7VUxi1zSpDTNLnEzooa/yyKmtwqiTbpM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NGJsz+9ZX8vAjjWWcMA51rVwnrE+eFQ8Tg14gUTMbBw3s1ZZVe/1gSYPuwej2dS/4 N2UNHgwmlRf44N7p5JwnJVDyV/ARy7/U6vYyy/t/JTJ0tf70/IgZxcAZ+fXnVBImQq c8c8iOd/k41SSxwSKVbsc7s7fnXoK5WvFDJNa6e8= Date: Thu, 13 Aug 2020 19:33:07 -0700 From: Andrew Morton To: Zhaoyang Huang Cc: Matthew Wilcox , Roman Gushchin , 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: <20200813193307.d5597367b7964d95f63e4580@linux-foundation.org> In-Reply-To: References: <1597368611-7631-1-git-send-email-zhaoyang.huang@unisoc.com> <20200814014355.GS17456@casper.infradead.org> <20200814020700.GT17456@casper.infradead.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Aug 2020 10:20:11 +0800 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're saying that echo xxx > /sys/block/dm/queue/read_ahead_kb does not affect presently-open files, and you believe that it should do so? I guess that could be a reasonable thing to want - it's reasonable for a user to expect that writing to a global tunable will take immediate global effect. I guess. But as Matthew says, it would help if you were to explain why this is needed. In full detail. What operational problems is the present implementation causing?