Re: [PATCH 06/28] mm, swap: rearrange swap cluster definition and helpers
From: Kairui Song
Date: Mon May 19 2025 - 23:50:57 EST
On Mon, May 19, 2025 at 2:26 PM Barry Song <21cnbao@xxxxxxxxx> wrote:
>
> > From: Kairui Song <kasong@xxxxxxxxxxx>
>
> > @@ -889,10 +849,8 @@ static unsigned long cluster_alloc_swap_entry(struct swap_info_struct *si, int o
> > /* Serialize HDD SWAP allocation for each device. */
> > spin_lock(&si->global_cluster_lock);
> > offset = si->global_cluster->next[order];
> > - if (offset == SWAP_ENTRY_INVALID)
> > - goto new_cluster;
>
> We are implicitly dropping this. Does it mean the current code is wrong?
> Do we need some clarification about this?
Sorry, my bad, this change has nothing to do with this commit, I'll
drop this change in the next version.
>
> >
> > - ci = lock_cluster(si, offset);
> > + ci = swap_lock_cluster(si, offset);
> > /* Cluster could have been used by another order */
> > if (cluster_is_usable(ci, order)) {
> > if (cluster_is_empty(ci))
>
> Thanks
> Barry