Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp177234rdh; Mon, 30 Oct 2023 18:56:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlFPnDXMWQL4Yzcws3RSMZr3e+0AjsCPvGrrjRoaYdln483ICxWN+mdc0b+HXi+Npz4cn0 X-Received: by 2002:a05:6358:7e07:b0:169:845b:3414 with SMTP id o7-20020a0563587e0700b00169845b3414mr1438222rwm.20.1698717410664; Mon, 30 Oct 2023 18:56:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698717410; cv=pass; d=google.com; s=arc-20160816; b=qwxpdUC4Iz5Fh0Jxx9rm0UIRhWwC1ZwJ53FmJD9m1I2Vn7uT5hUykQ3nW/+QunF+4p aWCUUBJRbxPF2NU1F9dvslvYtUXkMO8pjyMsN070E+lR9p0Tc1fcYYIshYlxHFofzNaF eTzSleR+13mMW7Wrq2iodVP58Cee/cpEwzVq5PFQiwf8gwo1JTOdzLPhgi8hgFcChgMa NP8gUMjFpo7Lb2hHDwLXBR1bOmyt3ZXMnkn7yJRbAs438mtbiB5Mfeskk+kLIzq/ApsP RY7ooYBPQMyjooc2gTaoSzowYuD+UPMZE+qOxhzaiqJ/kjMnDOZhWOxHom1nDl0WFPdj 6D1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature; bh=k1cKIt4YTjl+JgtpYfp+qBWwMmlTfYpok9wlLMu/M4Y=; fh=XxNYVX0I2YF6Nx36Hw1Uq2JsYFj0K8CAgTF4RM+5OyA=; b=Qr6ZFW4TRjIJ7Z8FQPsvlpckTmyHgWRCnKptv3Mjlr35RIZsoArrKWXOx9GZDfRde3 MuvJeftxLlF24NoS63QXNhV6DXUsq3NaLV7+5AEeGjKjQWx1HPhuk1LfY76BoBYJF+Px O91nlNDeYD4eL5fL8tE8L0vR7lAVU/zaSdTLYafgIYXHaJMwSl5W7Mrx73CZPu7+maUk +ZTU9q1oMLHfPeez1xXeUkngP/48J/7GuPDotnFbvNTEVk4EBrSqZTp9cmsyWDFf3/H0 UnRE4mZj6kr/6WClRYeak8dx2v3roVis23OwEDy75fOprkSknwFOndIfnlHpi2dO5v6B k2qQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=rELrATAD; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n190-20020a6327c7000000b005b982b4f5a9si290465pgn.429.2023.10.30.18.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 18:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=rELrATAD; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D937480A2837; Mon, 30 Oct 2023 18:56:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbjJaB4l (ORCPT + 99 others); Mon, 30 Oct 2023 21:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjJaB4k (ORCPT ); Mon, 30 Oct 2023 21:56:40 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2106.outbound.protection.outlook.com [40.92.23.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60D7CE6; Mon, 30 Oct 2023 18:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EcV5V6FC6EulIzNRc50kBa6XC88bu25hbMjGeN3GkFMaF4/BcydS8+ciAnNgw3wf24zA+p+Zw8P/jabCHNGF7BWEQd9MxdWpOGmKxiLEHDmDcbX8bcqOPgx+Li+KHyTzvDepYNC00xLI9MHGNdB1+JDmrj5JCvoGO0olmKD/X6/ZnJmf/6iAyzADcj/oF1JQceGARV9eGBVR4iFkwk2C0EDKxAtAefiCuH3ZCfV+DKZEPsV8uvjVUkZBJOOGgu2t9K0KASZuqe0G3uQWNIaclA6BzYwIYsh56Mf5ZRmuYFIP9C1x5wzwGoHFT9r5PbvIpaFry2b449eZ0Fp9gFQYpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=k1cKIt4YTjl+JgtpYfp+qBWwMmlTfYpok9wlLMu/M4Y=; b=R00Szw7gNJJM2DTqNHRiB6PCXNPJ0Zwe8IMLb3ybOYcO8fGn8t1We1PDP4CA869QUYsTeJod/u2AmEqkb/0ItzR+PgesUtefY81WskIvX1dp+Q3vbUhmZvvYK+DiH30C0jsy88/dC1Xh5VefRJSQlI3NDJjCUeJ27H8UCC/Ps0zXPOBT/7v8E7eQdl7JZZYXwJ56UmU7cx7gY6BC8TiLfTou1BsZxwbE8gg3Ya4qLmTivVSftaRLGBJFCl+P0qOQUEEG7g/0s8nC4hyKMH1qt5cmTQWH0hBzbbOtavzzggCJ6gMvKLs04mltEL+egooRcdSaC6jO90PJV1KRRdxn5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k1cKIt4YTjl+JgtpYfp+qBWwMmlTfYpok9wlLMu/M4Y=; b=rELrATADzmmdzC0cwQbWhGSW2FXkBNVu5V77TqPvEG15xAZEEGi1b48NsK8fvvQ641uy1pfOh45YgQnlmGzGjw0WNPvMjhgs3BHy5YYRZPTvcXOuH/HtbjvFIEArb4sP5ynIx65r7J2elLK3OQHsiPyY9xj9wjnCdZ9C4eBd2CpxOhfFFV/615+Lsl3WW47JbcERjsSc9L3ULMngbY2FLI3l6lY3mkyp1ep8iJIWRZfHQF+bFaiNggC+3npktOLuNs9rndcqlx/Ied1lUfZY8DtX3Rv278AIqBRAx6u6/f3ojtdqrNyWeTUPTgfsDFzFFUqFfi1imxmQNuJZO0yWkw== Received: from MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1e1::10) by DS0PR84MB3626.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:1bd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Tue, 31 Oct 2023 01:56:35 +0000 Received: from MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM ([fe80::6761:2623:329a:27d6]) by MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM ([fe80::6761:2623:329a:27d6%3]) with mapi id 15.20.6933.027; Tue, 31 Oct 2023 01:56:34 +0000 Subject: Re: [PATCH] readahead: Update the file_ra_state.ra_pages with each readahead operation To: Matthew Wilcox Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, tangyouling@kylinos.cn References: From: Youling Tang Message-ID: Date: Tue, 31 Oct 2023 09:56:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TMN: [0uJCwnfJvWWNhEPOzfmNh9bv4r58Nz0A] X-ClientProxiedBy: TY2PR04CA0017.apcprd04.prod.outlook.com (2603:1096:404:f6::29) To MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1e1::10) X-Microsoft-Original-Message-ID: <68aef890-5239-df10-5819-753f144e724c@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR84MB3145:EE_|DS0PR84MB3626:EE_ X-MS-Office365-Filtering-Correlation-Id: ed52238f-2062-4e31-5b21-08dbd9b49c66 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P6VW6ITg9Kdoy4x8FZoY3hU+vfQXudakX7PLzyGDrNs/H/Do1zxJOGwqwglbk2JEFDs1nZwBJrqG2uXxb4g8Tm/spGTtuM4x6UKjKA1yJ1rN8o7w0rVloAspna3y35ywwttFJVAlnZT9M8JIs18kOqZFEssU0HP98nI2+QkJ0Bl/oH0hguzUyJlTPk4qw36xzQADYY+ivPLPFJ3y2t7xDMRarjaVBHlAURrN8eRaJ/eVawXoVsfvZ8XGRVAQjOjXWgQnOiNMAoA3tFTizT0td2gOnWdFTsFjusnGwjFFoAtywGut1lfa3Vo3wxurjowxGSQvtbVNT0NpcJ/9h3he2zvUhB2O77Zw1H+PD7pPh3p2dQJ4pZWbnazn7K6MSfKa4hSkMB1BCrxbuzKl2pmQB5d5iN9g3uN6+NqZVLjV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ktQR0d0b1Jh?= =?utf-8?Q?yI1skrjNQiou7TH65mxFtXVvd6Q7n0xco4PqHYY4WpRg=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed52238f-2062-4e31-5b21-08dbd9b49c66 X-MS-Exchange-CrossTenant-AuthSource: MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2023 01:56:34.8056 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR84MB3626 X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FORGED_MUA_MOZILLA,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 30 Oct 2023 18:56:48 -0700 (PDT) Hi, Matthew On 2023/10/31 上午12:47, Matthew Wilcox wrote: > On Mon, Oct 30, 2023 at 03:41:30PM +0800, Youling Tang wrote: >> From: Youling Tang >> >> Changing the read_ahead_kb value midway through a sequential read of a >> large file found that the ra->ra_pages value remained unchanged (new >> ra_pages can only be detected the next time the file is opened). Because >> file_ra_state_init() is only called once in do_dentry_open() in most >> cases. >> >> In ondemand_readahead(), update bdi->ra_pages to ra->ra_pages to ensure >> that the maximum pages that can be allocated by the readahead algorithm >> are the same as (read_ahead_kb * 1024) / PAGE_SIZE after read_ahead_kb >> is modified. > Explain to me why this is the correct behaviour. Because I initially expected to immediately improve the current read performance by modifying read_ahead_kb when reading large files sequentially. > Many things are only initialised at open() time and are not updated until > the next open(). This is longstanding behaviour that some apps expect. Thanks for your explanation. I will discard this change if the next open update is in line with the apps expectation. Thanks, Youling.