linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible
@ 2023-08-09  8:05 Charan Teja Kalla
  2023-08-09 14:00 ` David Hildenbrand
  0 siblings, 1 reply; 5+ messages in thread
From: Charan Teja Kalla @ 2023-08-09  8:05 UTC (permalink / raw)
  To: akpm, zhaoyang.huang, yuzhao, surenb, kaleshsingh, david
  Cc: linux-mm, linux-kernel, Charan Teja Kalla

This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when
they are not available") which skips cma pages reclaim when they are not
eligible for the current allocation context. In mglru, such pages are
added to the tail of the immediate generation to maintain better LRU
order, which is unlike the case of conventional LRU where such pages are
directly added to the head of the LRU list(akin to adding to head of the
youngest generation in mglru).

No observable issue without this patch on MGLRU, but logically it make
sense to skip the CMA page reclaim when those pages can't be satisfied
for the current allocation context.

Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b4329f9..6cbe921 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4943,7 +4943,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
 	}
 
 	/* ineligible */
-	if (zone > sc->reclaim_idx) {
+	if (zone > sc->reclaim_idx || skip_cma(folio, sc)) {
 		gen = folio_inc_gen(lruvec, folio, false);
 		list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]);
 		return true;
-- 
2.7.4



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

* Re: [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible
  2023-08-09  8:05 [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible Charan Teja Kalla
@ 2023-08-09 14:00 ` David Hildenbrand
  2023-08-09 15:54   ` Kalesh Singh
  0 siblings, 1 reply; 5+ messages in thread
From: David Hildenbrand @ 2023-08-09 14:00 UTC (permalink / raw)
  To: Charan Teja Kalla, akpm, zhaoyang.huang, yuzhao, surenb, kaleshsingh
  Cc: linux-mm, linux-kernel

On 09.08.23 10:05, Charan Teja Kalla wrote:
> This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when
> they are not available") which skips cma pages reclaim when they are not
> eligible for the current allocation context. In mglru, such pages are
> added to the tail of the immediate generation to maintain better LRU
> order, which is unlike the case of conventional LRU where such pages are
> directly added to the head of the LRU list(akin to adding to head of the
> youngest generation in mglru).
> 
> No observable issue without this patch on MGLRU, but logically it make
> sense to skip the CMA page reclaim when those pages can't be satisfied
> for the current allocation context.
> 
> Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
> ---
>   mm/vmscan.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index b4329f9..6cbe921 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4943,7 +4943,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
>   	}
>   
>   	/* ineligible */
> -	if (zone > sc->reclaim_idx) {
> +	if (zone > sc->reclaim_idx || skip_cma(folio, sc)) {
>   		gen = folio_inc_gen(lruvec, folio, false);
>   		list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]);
>   		return true;

Makes sense to me.

-- 
Cheers,

David / dhildenb



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

* Re: [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible
  2023-08-09 14:00 ` David Hildenbrand
@ 2023-08-09 15:54   ` Kalesh Singh
  2023-08-09 17:09     ` Yu Zhao
  0 siblings, 1 reply; 5+ messages in thread
From: Kalesh Singh @ 2023-08-09 15:54 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Charan Teja Kalla, akpm, zhaoyang.huang, yuzhao, surenb,
	linux-mm, linux-kernel

On Wed, Aug 9, 2023 at 7:00 AM David Hildenbrand <david@redhat.com> wrote:
>
> On 09.08.23 10:05, Charan Teja Kalla wrote:
> > This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when
> > they are not available") which skips cma pages reclaim when they are not
> > eligible for the current allocation context. In mglru, such pages are
> > added to the tail of the immediate generation to maintain better LRU
> > order, which is unlike the case of conventional LRU where such pages are
> > directly added to the head of the LRU list(akin to adding to head of the
> > youngest generation in mglru).
> >
> > No observable issue without this patch on MGLRU, but logically it make
> > sense to skip the CMA page reclaim when those pages can't be satisfied
> > for the current allocation context.
> >
> > Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>

Reviewed-by: Kalesh Singh <kaleshsingh@google.com>

Thanks,
Kalesh

> > ---
> >   mm/vmscan.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index b4329f9..6cbe921 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -4943,7 +4943,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
> >       }
> >
> >       /* ineligible */
> > -     if (zone > sc->reclaim_idx) {
> > +     if (zone > sc->reclaim_idx || skip_cma(folio, sc)) {
> >               gen = folio_inc_gen(lruvec, folio, false);
> >               list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]);
> >               return true;
>
> Makes sense to me.
>
> --
> Cheers,
>
> David / dhildenb
>


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

* Re: [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible
  2023-08-09 15:54   ` Kalesh Singh
@ 2023-08-09 17:09     ` Yu Zhao
  2023-08-12  5:09       ` Charan Teja Kalla
  0 siblings, 1 reply; 5+ messages in thread
From: Yu Zhao @ 2023-08-09 17:09 UTC (permalink / raw)
  To: Charan Teja Kalla
  Cc: David Hildenbrand, akpm, zhaoyang.huang, surenb, linux-mm,
	linux-kernel, Kalesh Singh

On Wed, Aug 9, 2023 at 9:54 AM Kalesh Singh <kaleshsingh@google.com> wrote:
>
> On Wed, Aug 9, 2023 at 7:00 AM David Hildenbrand <david@redhat.com> wrote:
> >
> > On 09.08.23 10:05, Charan Teja Kalla wrote:
> > > This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when
> > > they are not available") which skips cma pages reclaim when they are not
> > > eligible for the current allocation context. In mglru, such pages are
> > > added to the tail of the immediate generation to maintain better LRU
> > > order, which is unlike the case of conventional LRU where such pages are
> > > directly added to the head of the LRU list(akin to adding to head of the
> > > youngest generation in mglru).
> > >
> > > No observable issue without this patch on MGLRU, but logically it make
> > > sense to skip the CMA page reclaim when those pages can't be satisfied
> > > for the current allocation context.
> > >
> > > Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
>
> Reviewed-by: Kalesh Singh <kaleshsingh@google.com>

Thanks, Charan! Do we need a "Fixes" tag?

> > > ---
> > >   mm/vmscan.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > > index b4329f9..6cbe921 100644
> > > --- a/mm/vmscan.c
> > > +++ b/mm/vmscan.c
> > > @@ -4943,7 +4943,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
> > >       }
> > >
> > >       /* ineligible */
> > > -     if (zone > sc->reclaim_idx) {
> > > +     if (zone > sc->reclaim_idx || skip_cma(folio, sc)) {
> > >               gen = folio_inc_gen(lruvec, folio, false);
> > >               list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]);
> > >               return true;
> >
> > Makes sense to me.


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

* Re: [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible
  2023-08-09 17:09     ` Yu Zhao
@ 2023-08-12  5:09       ` Charan Teja Kalla
  0 siblings, 0 replies; 5+ messages in thread
From: Charan Teja Kalla @ 2023-08-12  5:09 UTC (permalink / raw)
  To: Yu Zhao
  Cc: David Hildenbrand, akpm, zhaoyang.huang, surenb, linux-mm,
	linux-kernel, Kalesh Singh

On 8/9/2023 10:39 PM, Yu Zhao wrote:
>> On Wed, Aug 9, 2023 at 7:00 AM David Hildenbrand <david@redhat.com> wrote:
>>> On 09.08.23 10:05, Charan Teja Kalla wrote:
>>>> This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when
>>>> they are not available") which skips cma pages reclaim when they are not
>>>> eligible for the current allocation context. In mglru, such pages are
>>>> added to the tail of the immediate generation to maintain better LRU
>>>> order, which is unlike the case of conventional LRU where such pages are
>>>> directly added to the head of the LRU list(akin to adding to head of the
>>>> youngest generation in mglru).
>>>>
>>>> No observable issue without this patch on MGLRU, but logically it make
>>>> sense to skip the CMA page reclaim when those pages can't be satisfied
>>>> for the current allocation context.
>>>>
>>>> Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
>> Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
> Thanks, Charan! Do we need a "Fixes" tag?
I think the below tag matches.

Fixes: ac35a4902374 ("mm: multi-gen LRU: minimal implementation")
> 


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

end of thread, other threads:[~2023-08-12  5:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09  8:05 [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible Charan Teja Kalla
2023-08-09 14:00 ` David Hildenbrand
2023-08-09 15:54   ` Kalesh Singh
2023-08-09 17:09     ` Yu Zhao
2023-08-12  5:09       ` Charan Teja Kalla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox