From: Eric Biggers <ebiggers@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use
Date: Fri, 10 Mar 2023 14:23:38 -0800 [thread overview]
Message-ID: <ZAut6jcnytFJAen9@sol.localdomain> (raw)
In-Reply-To: <20230310210454.2350881-1-jaegeuk@kernel.org>
On Fri, Mar 10, 2023 at 01:04:52PM -0800, Jaegeuk Kim wrote:
> Let's reduce the complexity of mixed use of rb_tree in victim_entry from
> extent_cache and discard_cmd.
>
> This should fix arm32 memory alignment issue caused by shared rb_entry.
>
> [struct victim_entry] [struct rb_entry]
> [0] struct rb_node rb_node; [0] struct rb_node rb_node;
> union {
> struct {
> unsigned int ofs;
> unsigned int len;
> };
> [16] unsigned long long mtime; [12] unsigned long long key;
> } __packed;
>
> Cc: <stable@vger.kernel.org>
> Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection")
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Thanks for fixing this properly. It looks much better than the weird type
punning that was being done before...
> +static struct rb_node **f2fs_lookup_rb_tree_ext(struct f2fs_sb_info *sbi,
> + struct rb_root_cached *root,
> + struct rb_node **parent,
> + unsigned long long mtime, bool *leftmost)
Call this f2fs_lookup_victim_entry()?
> +static bool f2fs_check_victim_tree(struct f2fs_sb_info *sbi,
> + struct rb_root_cached *root)
> +{
> +#ifdef CONFIG_F2FS_CHECK_FS
> + struct rb_node *cur = rb_first_cached(root), *next;
> + struct victim_entry *cur_ve, *next_ve;
> +
> + if (!cur)
> + return true;
> +
> + while (cur) {
The !cur check is redundant.
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, stable@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use
Date: Fri, 10 Mar 2023 14:23:38 -0800 [thread overview]
Message-ID: <ZAut6jcnytFJAen9@sol.localdomain> (raw)
In-Reply-To: <20230310210454.2350881-1-jaegeuk@kernel.org>
On Fri, Mar 10, 2023 at 01:04:52PM -0800, Jaegeuk Kim wrote:
> Let's reduce the complexity of mixed use of rb_tree in victim_entry from
> extent_cache and discard_cmd.
>
> This should fix arm32 memory alignment issue caused by shared rb_entry.
>
> [struct victim_entry] [struct rb_entry]
> [0] struct rb_node rb_node; [0] struct rb_node rb_node;
> union {
> struct {
> unsigned int ofs;
> unsigned int len;
> };
> [16] unsigned long long mtime; [12] unsigned long long key;
> } __packed;
>
> Cc: <stable@vger.kernel.org>
> Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection")
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Thanks for fixing this properly. It looks much better than the weird type
punning that was being done before...
> +static struct rb_node **f2fs_lookup_rb_tree_ext(struct f2fs_sb_info *sbi,
> + struct rb_root_cached *root,
> + struct rb_node **parent,
> + unsigned long long mtime, bool *leftmost)
Call this f2fs_lookup_victim_entry()?
> +static bool f2fs_check_victim_tree(struct f2fs_sb_info *sbi,
> + struct rb_root_cached *root)
> +{
> +#ifdef CONFIG_F2FS_CHECK_FS
> + struct rb_node *cur = rb_first_cached(root), *next;
> + struct victim_entry *cur_ve, *next_ve;
> +
> + if (!cur)
> + return true;
> +
> + while (cur) {
The !cur check is redundant.
- Eric
next prev parent reply other threads:[~2023-03-10 22:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 21:04 [f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use Jaegeuk Kim
2023-03-10 21:04 ` Jaegeuk Kim
2023-03-10 21:04 ` [f2fs-dev] [PATCH 2/3] f2fs: factor out discard_cmd " Jaegeuk Kim
2023-03-10 21:04 ` Jaegeuk Kim
2023-03-10 22:24 ` [f2fs-dev] " Eric Biggers
2023-03-10 22:24 ` Eric Biggers
2023-03-10 21:04 ` [f2fs-dev] [PATCH 3/3] f2fs: remove entire rb_entry sharing Jaegeuk Kim
2023-03-10 21:04 ` Jaegeuk Kim
2023-03-10 22:23 ` Eric Biggers [this message]
2023-03-10 22:23 ` [f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use Eric Biggers
2023-03-21 16:40 ` patchwork-bot+f2fs
2023-03-21 16:40 ` patchwork-bot+f2fs
-- strict thread matches above, loose matches on Subject: below --
2023-03-13 20:12 [f2fs-dev] [PATCH 0/3] remove shared memory structures Jaegeuk Kim
2023-03-13 20:12 ` [f2fs-dev] [PATCH 1/3] f2fs: factor out victim_entry usage from general rb_tree use Jaegeuk Kim
2023-03-23 14:22 ` Chao Yu
2023-03-23 14:22 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZAut6jcnytFJAen9@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.