Re: [PATCH 06/12] mempolicy trivia: use pgoff_t in shared mempolicy tree

From: Matthew Wilcox
Date: Mon Sep 25 2023 - 18:32:00 EST


On Mon, Sep 25, 2023 at 01:28:14AM -0700, Hugh Dickins wrote:
> Prefer the more explicit "pgoff_t" to "unsigned long" when dealing with
> a shared mempolicy tree. Delete confusing comment about pseudo mm vmas.

Yes, with three quibbles

> struct sp_node {
> struct rb_node nd;
> - unsigned long start, end;
> + pgoff_t start, end;
> struct mempolicy *policy;
> };
> -
> struct shared_policy {

Did you intend to delete the blank line between these two structs?
That's not our normal style.

> +++ b/mm/mempolicy.c
> @@ -2444,7 +2444,7 @@ bool __mpol_equal(struct mempolicy *a, struct mempolicy *b)
> * reading or for writing
> */
> static struct sp_node *
> -sp_lookup(struct shared_policy *sp, unsigned long start, unsigned long end)
> +sp_lookup(struct shared_policy *sp, pgoff_t start, pgoff_t end)

While you're reformatting anyway, mind joining these two lines?

> @@ -2499,7 +2499,7 @@ static void sp_insert(struct shared_policy *sp, struct sp_node *new)
>
> /* Find shared policy intersecting idx */
> struct mempolicy *
> -mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
> +mpol_shared_policy_lookup(struct shared_policy *sp, pgoff_t idx)

Ditto