linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Re: [f2fs-dev] [PATCH v3 1/2] libfs: reduce the number of memory allocations in generic_ci_match
@ 2025-07-08  6:52 ywen.chen
  0 siblings, 0 replies; 5+ messages in thread
From: ywen.chen @ 2025-07-08  6:52 UTC (permalink / raw)
  To: Christoph Hellwig, Eric Biggers
  Cc: brauner, tytso, linux-kernel, linux-f2fs-devel, Christoph Hellwig,
	adilger.kernel, viro, linux-fsdevel, jaegeuk, linux-ext4

> But I wonder why generic_ci_match is even called that often.  Both ext4
> and f2fs support hashed lookups, so you should usually only see it called
> for the main match, plus the occasional hash false positive, which should
> be rate if the hash works.


At present, in the latest version of Linux, in some scenarios,
f2fs still uses linear search.


The logic of linear search was introduced by Commit 91b587ba79e1
(f2fs: Introduce linear search for dentries). Commit 91b587ba79e1
was designed to solve the problem of inconsistent hashes before
and after the rollback of Commit 5c26d2f1d3f5
("unicode: Don't special case ignorable code points"),
which led to files being inaccessible.


In order to reduce the impact of linear search, in relatively new
versions, the logic of turning off linear search has also been
introduced. However, the triggering conditions for this
turn - off logic on f2fs are rather strict:


1. Use the latest version of the fsck.f2fs tool to correct
the file system.
2. Use a relatively new version of the kernel. (For example,
linear search cannot be turned off in v6.6)


The performance gain of this commit is very obvious in scenarios
where linear search is not turned off. In scenarios where linear
search is turned off, no performance problems will be introduced
either.<br>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: improve the performance of f2fs_lookup
@ 2025-07-03  8:56 Christoph Hellwig
  2025-07-04  2:43 ` [f2fs-dev] [PATCH v3 1/2] libfs: reduce the number of memory allocations in generic_ci_match Yuwen Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2025-07-03  8:56 UTC (permalink / raw)
  To: Yuwen Chen
  Cc: brauner, tytso, linux-kernel, linux-f2fs-devel, adilger.kernel,
	viro, linux-fsdevel, jaegeuk, linux-ext4

On Thu, Jul 03, 2025 at 04:21:30PM +0800, Yuwen Chen wrote:
> On the Android system, the file creation operation will call
> the f2fs_lookup function. When there are too many files in a
> directory, the generic_ci_match operation will be called
> repeatedly in large quantities. In extreme cases, the file
> creation speed will drop to three times per second.

This files to explain what you are changing in detail, and why
(except for the very highlevel problem statement here).

> 
> Signed-off-by: Yuwen Chen <ywen.chen@foxmail.com>
> ---
>  fs/ext4/namei.c    |  2 +-
>  fs/f2fs/dir.c      | 24 +++++++++++++++++-------
>  fs/f2fs/f2fs.h     |  3 ++-
>  fs/f2fs/inline.c   |  3 ++-
>  fs/libfs.c         | 32 +++++++++++++++++++++++++++++---
>  include/linux/fs.h |  8 +++++++-

Also please split generic infrastructure changes from f2fs ones.



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-08  7:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08  6:52 [f2fs-dev] [PATCH v3 1/2] libfs: reduce the number of memory allocations in generic_ci_match ywen.chen
  -- strict thread matches above, loose matches on Subject: below --
2025-07-03  8:56 [f2fs-dev] [PATCH] f2fs: improve the performance of f2fs_lookup Christoph Hellwig
2025-07-04  2:43 ` [f2fs-dev] [PATCH v3 1/2] libfs: reduce the number of memory allocations in generic_ci_match Yuwen Chen
2025-07-04  6:02   ` Eric Biggers via Linux-f2fs-devel
2025-07-07  5:27     ` Christoph Hellwig
2025-07-08  7:11       ` Yuwen Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).