All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonsoo Kim <js1304@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Rik van Riel <riel@surriel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-team@fb.com, Roman Gushchin <guro@fb.com>,
	Qian Cai <cai@lca.pw>, Mel Gorman <mgorman@techsingularity.net>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH] mm,page_alloc,cma: conditionally prefer cma pageblocks for movable allocations
Date: Wed, 11 Mar 2020 19:13:38 +0900	[thread overview]
Message-ID: <CAAmzW4P6+3O_RLvgy_QOKD4iXw+Hk3HE7Toc4Ky7kvQbCozCeA@mail.gmail.com> (raw)
In-Reply-To: <8e67d88f-3ec8-4795-35dc-47e3735e530e@suse.cz>

2020년 3월 11일 (수) 오후 5:51, Vlastimil Babka <vbabka@suse.cz>님이 작성:
>
> On 3/6/20 9:01 PM, Rik van Riel wrote:
> > Posting this one for Roman so I can deal with any upstream feedback and
> > create a v2 if needed, while scratching my head over the next piece of
> > this puzzle :)
> >
> > ---8<---
> >
> > From: Roman Gushchin <guro@fb.com>
> >
> > Currently a cma area is barely used by the page allocator because
> > it's used only as a fallback from movable, however kswapd tries
> > hard to make sure that the fallback path isn't used.
>
> Few years ago Joonsoo wanted to fix these kinds of weird MIGRATE_CMA corner
> cases by using ZONE_MOVABLE instead [1]. Unfortunately it was reverted due to
> unresolved bugs. Perhaps the idea could be resurrected now?
>
> [1]
> https://lore.kernel.org/linux-mm/1512114786-5085-1-git-send-email-iamjoonsoo.kim@lge.com/

Thanks for ccing, Vlastimil.

Recently, I'm working for resurrecting this idea.
I will send the preparation patches in this or next week.

Unresolved bugs of my patchset comes from the fact that ZONE_MOVABLE
which is used for
serving CMA memory in my patchset could have both lowmem(direct mapped) and
highmem(no direct mapped) pages on CONFIG_HIGHMEM enabled system.

For someone to use this memory, PageHighMem() should be called to
check if there is direct
mapping or not. Current PageHighMem() implementation is:

#define PageHighMem(__p) is_highmem_idx(page_zonenum(__p))

Since ZONE_MOVABLE has both typed pages, ZONE_MOVABLE should be considered
as highmem zone. In this case, PageHighMem() always returns TRUE for
all pages on
ZONE_MOVABLE and lowmem pages on ZONE_MOVABLE could make some troubles.

My plan to fix this problem is to change the PageHighMem() implementation.

#define PageHighMem(__p) (page_to_pfn(__p) >= max_low_pfn)

In fact, PageHighMem() is used to check whether direct mapping exists or not.
With this new implementation, regardless of the zone type of the page, we can
correctly check if the page is direct mapped or not. Changing the
name, PageHighMem(),
to !PageDirectMapped() is also planned but it will be done after
everything have settle down.

Unfortunately, before changing the implementation, I should check the
all call-sites
of PageHighMem() since there is some callers who use PageHighMem() to check
the zone type.

What my preparation patch will does is to correct this PageHighMem() usage.
After fixing it, I will try to merge the patchset [1].

Thanks.

  reply	other threads:[~2020-03-11 10:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 20:01 [PATCH] mm,page_alloc,cma: conditionally prefer cma pageblocks for movable allocations Rik van Riel
2020-03-07 22:38 ` Andrew Morton
2020-03-08 13:23   ` Rik van Riel
2020-03-08 13:23     ` Rik van Riel
2020-03-11 17:58     ` Vlastimil Babka
2020-03-11 22:58       ` Roman Gushchin
2020-03-11 23:03         ` Vlastimil Babka
2020-03-11 23:21           ` Roman Gushchin
2020-03-11  8:51 ` Vlastimil Babka
2020-03-11 10:13   ` Joonsoo Kim [this message]
2020-03-11 10:13     ` Joonsoo Kim
2020-03-11 17:41     ` Vlastimil Babka
2020-03-11 17:35   ` Roman Gushchin
2020-03-12  1:41     ` Joonsoo Kim
2020-03-12  1:41       ` Joonsoo Kim
2020-03-12  2:39       ` Roman Gushchin
2020-03-12  8:56         ` Joonsoo Kim
2020-03-12  8:56           ` Joonsoo Kim
2020-03-12 17:07           ` Roman Gushchin
2020-03-13  7:44             ` Joonsoo Kim
2020-03-13  7:44               ` Joonsoo Kim
2020-04-02  2:13       ` Andrew Morton
2020-04-02  2:53         ` Roman Gushchin
2020-04-02  5:43           ` Joonsoo Kim
2020-04-02  5:43             ` Joonsoo Kim
2020-04-02 19:42             ` Roman Gushchin
2020-04-03  4:34               ` Joonsoo Kim
2020-04-03  4:34                 ` Joonsoo Kim
2020-04-03 17:50                 ` Roman Gushchin
2020-04-02  3:05         ` Roman Gushchin
2020-03-21  0:49 ` Minchan Kim

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=CAAmzW4P6+3O_RLvgy_QOKD4iXw+Hk3HE7Toc4Ky7kvQbCozCeA@mail.gmail.com \
    --to=js1304@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=cai@lca.pw \
    --cc=guro@fb.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    /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.