linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: "Gioh Kim" <gioh.kim@lge.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	'김준수' <iamjoonsoo.kim@lge.com>,
	"Laura Abbott" <lauraa@codeaurora.org>,
	"Minchan Kim" <minchan@kernel.org>
Cc: "Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Mel Gorman" <mel@csn.ul.ie>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	이건호 <gunho.lee@lge.com>, "'Chanho Min'" <chanho.min@lge.com>
Subject: Re: [PATCH] CMA/HOTPLUG: clear buffer-head lru before page migration
Date: Sat, 19 Jul 2014 15:51:13 +0200	[thread overview]
Message-ID: <xa1tmwc578z2.fsf@mina86.com> (raw)
In-Reply-To: <53C8D970.4000908@lge.com>

>> On 2014-07-18 08:45, Gioh Kim wrote:
>>> From: Gioh Kim <gioh.kim@lge.com>
>>> Date: Fri, 18 Jul 2014 13:40:01 +0900
>>> Subject: [PATCH] CMA/HOTPLUG: clear buffer-head lru before page migration
>>>
>>> The bh must be free to migrate a page at which bh is mapped.
>>> The reference count of bh is increased when it is installed
>>> into lru so that the bh of lru must be freed before migrating the page.
>>>
>>> This frees every bh of lru. We could free only bh of migrating page.
>>> But searching lru costs more than invalidating entire lru.
>>>
>>> Signed-off-by: Gioh Kim <gioh.kim@lge.com>
>>> Acked-by: Laura Abbott <lauraa@codeaurora.org>

With the if removed:

Acked-by: Michal Nazarewicz <mina86@mina86.com>

>>> ---
>>>   mm/page_alloc.c |    3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>>> index b99643d4..3b474e0 100644
>>> --- a/mm/page_alloc.c
>>> +++ b/mm/page_alloc.c
>>> @@ -6369,6 +6369,9 @@ int alloc_contig_range(unsigned long start, unsigned long end,
>>>          if (ret)
>>>                  return ret;
>>>
>>> +       if (migratetype == MIGRATE_CMA || migratetype == MIGRATE_MOVABLE)

On Fri, Jul 18 2014, Gioh Kim <gioh.kim@lge.com> wrote:
> I agree. I cannot understand why alloc_contig_range has an argument of
> migratetype.  Can the alloc_contig_range is called for other migrate
> type than CMA/MOVABLE?

It has migratetype argument precisely because it can be CMA or MOVABLE.
If alloc_contig_range was called always with the same migrate type, the
argument would not be necessary, but because it isn't, it is.

> What do you think about removing the argument of migratetype and
> checking migratetype (if (migratetype == MIGRATE_CMA || migratetype ==
> MIGRATE_MOVABLE))?

If you remove the argument, the function would have to read migrate type
of the pageblock and that's just waste of time, since the migrate type
can be passed to the function from its caller, so the argument should
remain.

>>> +               invalidate_bh_lrus();
>>> +
>>>          ret = __alloc_contig_migrate_range(&cc, start, end);
>>>          if (ret)
>>>                  goto done;

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2014-07-19 13:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18  6:45 Gioh Kim
2014-07-18  7:50 ` Marek Szyprowski
2014-07-18  8:23   ` Gioh Kim
2014-07-18  9:30     ` Zhang Yanfei
2014-07-19 13:51     ` Michal Nazarewicz [this message]
2014-07-18 17:54 ` Laura Abbott
2014-07-21  2:50 ` Minchan Kim
2014-07-21  6:16   ` Gioh Kim
2014-07-21  7:36     ` Minchan Kim
2014-07-21  8:00       ` Minchan Kim
2014-07-21 13:01       ` Mel Gorman
2014-07-22  0:15         ` Minchan Kim
2014-07-22  1:04           ` Gioh Kim
2014-07-30  8:12             ` Gioh 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=xa1tmwc578z2.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=akpm@linux-foundation.org \
    --cc=chanho.min@lge.com \
    --cc=gioh.kim@lge.com \
    --cc=gunho.lee@lge.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=lauraa@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mel@csn.ul.ie \
    --cc=minchan@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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