linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	 Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	 Muchun Song <muchun.song@linux.dev>,
	Hugh Dickins <hughd@google.com>,
	 Yosry Ahmed <yosryahmed@google.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	 linux-doc@vger.kernel.org,
	Meta kernel team <kernel-team@meta.com>
Subject: Re: [PATCH v1 5/6] memcg-v1: no need for memcg locking for MGLRU
Date: Fri, 25 Oct 2024 21:55:38 -0600	[thread overview]
Message-ID: <CAOUHufYCPkUH0ysujoXZaw3PSrPvaw356-Pb97=LPGVRu_7FNQ@mail.gmail.com> (raw)
In-Reply-To: <20241025012304.2473312-6-shakeel.butt@linux.dev>

On Thu, Oct 24, 2024 at 7:23 PM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>
> While updating the generation of the folios, MGLRU requires that the
> folio's memcg association remains stable. With the charge migration
> deprecated, there is no need for MGLRU to acquire locks to keep the
> folio and memcg association stable.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
> ---
>  mm/vmscan.c | 11 -----------
>  1 file changed, 11 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 29c098790b01..fd7171658b63 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -3662,10 +3662,6 @@ static void walk_mm(struct mm_struct *mm, struct lru_gen_mm_walk *walk)
>                 if (walk->seq != max_seq)
>                         break;

Please remove the lingering `struct mem_cgroup *memcg` as well as
folio_memcg_rcu(). Otherwise it causes both build and lockdep
warnings.

> -               /* folio_update_gen() requires stable folio_memcg() */
> -               if (!mem_cgroup_trylock_pages(memcg))
> -                       break;
> -
>                 /* the caller might be holding the lock for write */
>                 if (mmap_read_trylock(mm)) {
>                         err = walk_page_range(mm, walk->next_addr, ULONG_MAX, &mm_walk_ops, walk);
> @@ -3673,8 +3669,6 @@ static void walk_mm(struct mm_struct *mm, struct lru_gen_mm_walk *walk)
>                         mmap_read_unlock(mm);
>                 }
>
> -               mem_cgroup_unlock_pages();
> -
>                 if (walk->batched) {
>                         spin_lock_irq(&lruvec->lru_lock);
>                         reset_batch_size(walk);
> @@ -4096,10 +4090,6 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
>                 }
>         }
>
> -       /* folio_update_gen() requires stable folio_memcg() */
> -       if (!mem_cgroup_trylock_pages(memcg))
> -               return true;
> -
>         arch_enter_lazy_mmu_mode();
>
>         pte -= (addr - start) / PAGE_SIZE;
> @@ -4144,7 +4134,6 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
>         }
>
>         arch_leave_lazy_mmu_mode();
> -       mem_cgroup_unlock_pages();
>
>         /* feedback from rmap walkers to page table walkers */
>         if (mm_state && suitable_to_scan(i, young))
> --
> 2.43.5
>
>


  parent reply	other threads:[~2024-10-26  3:56 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25  1:22 [PATCH v1 0/6] memcg-v1: fully deprecate charge moving Shakeel Butt
2024-10-24  6:57 ` [RFC PATCH 0/3] " Shakeel Butt
2024-10-24  6:57   ` [RFC PATCH 1/3] memcg-v1: fully deprecate move_charge_at_immigrate Shakeel Butt
2024-10-24  9:14     ` Michal Hocko
2024-10-24 16:51       ` Roman Gushchin
2024-10-24 17:16         ` Shakeel Butt
2024-10-24 16:49     ` Roman Gushchin
2024-10-24  6:57   ` [RFC PATCH 2/3] memcg-v1: remove charge move code Shakeel Butt
2024-10-24  9:14     ` Michal Hocko
2024-10-24 16:50     ` Roman Gushchin
2024-10-24  6:57   ` [RFC PATCH 3/3] memcg-v1: remove memcg move locking code Shakeel Butt
2024-10-24  9:16     ` Michal Hocko
2024-10-24 17:23       ` Shakeel Butt
2024-10-24 18:54         ` Roman Gushchin
2024-10-24 19:38           ` Shakeel Butt
2024-10-24 16:50     ` Roman Gushchin
2024-10-24 17:26       ` Shakeel Butt
2024-10-24 19:45         ` Michal Hocko
2024-10-24 20:32           ` Yosry Ahmed
2024-10-24 21:08             ` Michal Hocko
2024-10-25  1:23     ` Shakeel Butt
2024-10-25  1:22 ` [PATCH v1 1/6] memcg-v1: fully deprecate move_charge_at_immigrate Shakeel Butt
2024-10-25  6:54   ` Michal Hocko
2024-10-28 13:53   ` Johannes Weiner
2024-10-25  1:22 ` [PATCH v1 2/6] memcg-v1: remove charge move code Shakeel Butt
2024-10-28 10:22   ` David Hildenbrand
2024-10-28 10:40     ` David Hildenbrand
2024-10-28 13:54   ` Johannes Weiner
2024-10-25  1:23 ` [PATCH v1 3/6] memcg-v1: no need for memcg locking for dirty tracking Shakeel Butt
2024-10-25  6:56   ` Michal Hocko
2024-10-25 16:22     ` Shakeel Butt
2024-10-25 17:40   ` Roman Gushchin
2024-10-28 14:00   ` Johannes Weiner
2024-10-25  1:23 ` [PATCH v1 4/6] memcg-v1: no need for memcg locking for writeback tracking Shakeel Butt
2024-10-25  6:57   ` Michal Hocko
2024-10-25 17:40   ` Roman Gushchin
2024-10-28 14:00   ` Johannes Weiner
2024-10-25  1:23 ` [PATCH v1 5/6] memcg-v1: no need for memcg locking for MGLRU Shakeel Butt
2024-10-25 17:41   ` Roman Gushchin
2024-10-26  3:55   ` Yu Zhao [this message]
2024-10-26  6:20     ` Shakeel Butt
2024-10-26  6:34   ` Shakeel Butt
2024-10-26 15:26     ` Yu Zhao
2024-11-04 17:30       ` Yu Zhao
2024-11-04 21:38         ` Andrew Morton
2024-11-04 22:04           ` Shakeel Butt
2024-11-04 22:04           ` Yu Zhao
2024-11-04 22:08             ` Yu Zhao
2024-11-04 22:18               ` Andrew Morton
2024-10-25  1:23 ` [PATCH v1 6/6] memcg-v1: remove memcg move locking code Shakeel Butt
2024-10-25  6:59   ` Michal Hocko
2024-10-25 17:42   ` Roman Gushchin
2024-10-26  3:58   ` Yu Zhao
2024-10-26  6:26     ` Shakeel Butt
2024-10-28 14:02   ` Johannes Weiner
2024-10-25  1:33 ` [PATCH v1 0/6] memcg-v1: fully deprecate charge moving Shakeel Butt

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='CAOUHufYCPkUH0ysujoXZaw3PSrPvaw356-Pb97=LPGVRu_7FNQ@mail.gmail.com' \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kernel-team@meta.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=yosryahmed@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox