Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp59603pxa; Thu, 13 Aug 2020 19:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnJPEiM8Jo08rq1pPnw00fxR5VNBjpyrznZT5BuJ2ov+pPGHX3u3bjh/yc1KSXUPtLPuUJ X-Received: by 2002:a17:906:e251:: with SMTP id gq17mr368164ejb.445.1597372174514; Thu, 13 Aug 2020 19:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597372174; cv=none; d=google.com; s=arc-20160816; b=Yd4vJe/4N1mnlKJxMIj8oVPDxRQOVfqpA5xL9e0hTPgyWaUvMHKXUoyJ6tWI7AwBBe glaH5Bne9VmZCdV6VGQn30IOIQ9/kyaThFJH15OzArCg1pHaGe6Qd0R8mYFt3EcA5Tq8 tgNu2Ik9Vx6Uk6WkFKBbdEMPPzwQJyTbVKAxYAXQR+s34okCESV3XYqk570931A8PLb5 lkr5h48po1NSN2rG9gnHM12GfRBOHCHC1sZIa1EWCx1YiBp7x9r9EHYFudfke6l4hOK4 aQY3dcnfoeZo+CKwwHTQY1DRiNSDuRkbKGubqOHWPJNlaDIkPSLU9pa1SXL0GbMQrKdC 6zjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=cHegjZcU0XOaLxA3426H5gnc8atFuiYj+6kFdWj5ljE=; b=I/fq5JCm5e42WKkRc45SRXxPZbOId7rjBl70VE/hoi0CiJKclvf0X2KCmMxsJk8VOv 3ntH9pLh0wdSefRnzJPo6v07/EjtHzD1ylPXxANfJmFev6AJVkAAB3XLn/V5njK6KoX5 LqtH/dlp0bFbx9glNjQoWSX430Akmk2MEe/mwwuaTkaiC2apceNxk1YzoVY9Q+SjbVES GCLQdyaGiOX564c8YZ3NgMUlMEMKZ8Fd9UzdJLE5foHF853c+n1FJEwRKmfWSKUuZxlr uqgLnux2cltXFuJzsE8KxBPXfz1IGGBncDUduLN4kbCK60Xo+Ogs3tYucplO0gNUbGjH waRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oUAvIzwf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si4766334edp.120.2020.08.13.19.29.11; Thu, 13 Aug 2020 19:29:34 -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=@gmail.com header.s=20161025 header.b=oUAvIzwf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbgHNC0f (ORCPT + 99 others); Thu, 13 Aug 2020 22:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbgHNC0f (ORCPT ); Thu, 13 Aug 2020 22:26:35 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48847C061757 for ; Thu, 13 Aug 2020 19:26:35 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id z17so7251852ill.6 for ; Thu, 13 Aug 2020 19:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cHegjZcU0XOaLxA3426H5gnc8atFuiYj+6kFdWj5ljE=; b=oUAvIzwfnyXhMrJXp9A1vBkMDzpBeKwIYiT7rg6agknOuVfhVMJP0WmQblYydOyP+b 1IRkiAOB0rQ4pQzNUisgFR1hKz7Zc+hyJhyKG5tC/FXKkQN2GmcVbGwa1VomkiJIMxvs YhPvJgcLkgQRgawrhNj6YVc5JN6kSN3vZQ29JHPKzYL3F42gyW8RgLALkytlLfSRGTnu Ih5DH3tkN9u5X000+VwM1UJ8vVesRQpuHqEzgvR+/tLzU3931gw5zlIV9CmjGnvWtHQu 2LSo2uOWbTiXtcsFsvsz2Zk3j+Ey6qWwtwtIQrkr/iZUt4v/KphL7F3OdzripTaL4A1S GlbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cHegjZcU0XOaLxA3426H5gnc8atFuiYj+6kFdWj5ljE=; b=Bwpn6hRFcAQOI9Dy6prtRe273PdJ19JKzUtQoZHqHCnTFoUpCiRxX3csAbogRAZ0UO 5zqWSUN7fo3MEbOopg7RFdlpa99ylTS0uBRlacGQ6gJUUDhRKZFu57uwYOaiSBwLOo10 MjRNql4pXyGDDsbWFhUrI0dFCaNk9Sxwr88tSnEqmld2rF0d6ivQcn4fGWyNPdawH/Fw lXYKvwh5Ur4IL4BM1ipZrOJ6gCnum/FH2M/MPlBgjetDAY6ZLX7vBiRDuz9Tmcpq3C4V 14CR+GGGJJMK3j7nvuWySLrd4bNxzDEYbtGl+yYrPNkDs4ENHPlJUaOnxikyCMjwp0OJ 5ogQ== X-Gm-Message-State: AOAM533LAeo+U3bwKBiQr+qn7q0JOQ+ZOKIKmeS26Gz8RbgowdSEz88z KXWDT4punUXMCK6ZDcAqmsyk81+8vrhKBHMPsdg= X-Received: by 2002:a92:6904:: with SMTP id e4mr702536ilc.83.1597371994666; Thu, 13 Aug 2020 19:26:34 -0700 (PDT) MIME-Version: 1.0 References: <1597368611-7631-1-git-send-email-zhaoyang.huang@unisoc.com> <20200814014355.GS17456@casper.infradead.org> <20200814020700.GT17456@casper.infradead.org> In-Reply-To: From: Zhaoyang Huang Date: Fri, 14 Aug 2020 10:26:23 +0800 Message-ID: Subject: Re: [PATCH] mm : update ra->ra_pages if it's NOT equal to bdi->ra_pages To: Matthew Wilcox Cc: Roman Gushchin , Andrew Morton , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Content-Type: text/plain; charset="UTF-8" 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: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? > > > > You haven't said what problem you're facing, so I really can't be more > > helpful.