Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1002133rdb; Tue, 19 Sep 2023 17:48:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMVyD0ydN9NsOGuYawURIvMDr8xJ0gmaWP55HAQFq7tYgtLdSASG9Ewxio38jAMbMizHoZ X-Received: by 2002:a17:902:da88:b0:1c4:1195:6de4 with SMTP id j8-20020a170902da8800b001c411956de4mr5325457plx.9.1695170920947; Tue, 19 Sep 2023 17:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695170920; cv=none; d=google.com; s=arc-20160816; b=HB3BaXDlPb0ONFgzFxQeQtVU9Habh4CCXNWRCd2CnStfsPgb8xXfpzCSRU63zHraI7 U33CkU3w6Khj5s8cuDqqMr5eRobi0MaMmwPJDXtOI93XYsZyCQfrsFLICjZW9U3s9ixP SDYduRTlT73uQWKVf1Cc8MQLZ/0bB93BRM31dim4FQwUjlmQRfv8fs2g/YkKkzMevO25 jlXGxWhKYF1mW7XEXBCkiMImOTw37OIi9SGMKaSuGIXrtMT3Kz7T2I7MWyEpFNvlWHe8 ugywwdYJZwqXuY5h5gScyIsGy727mK+/Tlg8tdf+nl6784Z9wMamr1Llvadhm8mZi/NB nB+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VmZ2tPmtmZ2KchS172kus413p8d8pxhndwqPNypf7HM=; fh=ouFSDmhf+x6riCtkcjbnAxEtZtCjVXYina2XpfIDNO0=; b=0QYrYHAWjUO90znmxYIPxsHQBD8pCXWIFamehWie6dVjiurUOuoWHC79SuMbFMrqad CWuEHIpsPzS6O8UpMfM/vYa/176xs85GJ61X3ft7yG7j7fhIZzD6dbkyugL8YIRIoiko 5kLUfW6JjJj8LW29hSMnvhFh5PuBKZ8nNHKNy5KMBPZsfxPv1aPSy44L/eWvjMD/6I8K 7rp1Ml4FKbgNrdoFUuia2F8KkhORw/SMXoU5qpc39M1hrHxTJe/Dqi/ClOnqp9mML40+ RdUXwGbBIClddm97QQcV7kfrZMsSD/vorpbDaOGjieE/oIIdD/GKnOihZWsqLF1nXC/c KjXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="D/+bENO1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b11-20020a170902d50b00b001c1e1fe16cbsi6566660plg.255.2023.09.19.17.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="D/+bENO1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BDF998045BEF; Tue, 19 Sep 2023 17:47:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbjITArI (ORCPT + 99 others); Tue, 19 Sep 2023 20:47:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbjITArH (ORCPT ); Tue, 19 Sep 2023 20:47:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE16F83 for ; Tue, 19 Sep 2023 17:47:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 727C5C433C8; Wed, 20 Sep 2023 00:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695170821; bh=hIe7iSfzxlD1Ssky6t8tpNboP78N0LngZBkea2BN3Rk=; h=From:To:Cc:Subject:Date:From; b=D/+bENO1pwEuPTaRAaguImitaJz1Y0zXTJ8C+HrEyNgAQrd5QVA/RtTx2A1539PAy +lmO13z0FP6zQ/6XRni1I91F3+IWAPcDX6ByLfbHNeKjuV9XasIjZZ+mS7sPu4uHDc lA62UFazSBO1BFb4TbxND7gtfzhTSN7UpR9ZHV5ae+G4510Md4Z+dmYzkVxn/rxyYF jDc578zj+TQD477ASBCQeB0WYRHWF3UtUDM/aNc22i2eIEHU9WWqWEKQvlPE3Bu7Iz tWIkBXnGfV2s/Z3iSQdjCEKuOQjAA0xRB4/far3aKd4meEP2ehCgLbtFsQjgxQ9s8Y eV8PJq2+voe9A== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim , Eric Biggers Subject: [PATCH] f2fs: preload extent_cache for POSIX_FADV_WILLNEED Date: Tue, 19 Sep 2023 17:46:45 -0700 Message-ID: <20230920004645.1462354-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 17:47:08 -0700 (PDT) This patch tries to preload extent_cache given POSIX_FADV_WILLNEED, which is more useful for generic usecases. Suggested-by: Eric Biggers Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 09716127e107..df7703c1f7d7 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -4858,6 +4858,8 @@ static int f2fs_file_fadvise(struct file *filp, loff_t offset, loff_t len, filp->f_mode &= ~FMODE_RANDOM; spin_unlock(&filp->f_lock); return 0; + } else if (advice == POSIX_FADV_WILLNEED) { + f2fs_precache_extents(inode); } err = generic_fadvise(filp, offset, len, advice); -- 2.42.0.459.ge4e396fd5e-goog