linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan.kim@gmail.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Andy Isaacson <adi@hexapodia.org>,
	Johannes Weiner <jweiner@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: Do not stall in synchronous compaction for THP allocations
Date: Fri, 11 Nov 2011 00:12:01 +0900	[thread overview]
Message-ID: <CAEwNFnCRCxrru5rBk7FpypqeL8nD=SY5W3-TaA7Ap5o4CgDSbg@mail.gmail.com> (raw)
In-Reply-To: <20111110142202.GE3083@suse.de>

Hi Mel,

You should have Cced with me because __GFP_NORETRY is issued by me.

On Thu, Nov 10, 2011 at 11:22 PM, Mel Gorman <mgorman@suse.de> wrote:
> On Thu, Nov 10, 2011 at 10:06:16AM +0000, Mel Gorman wrote:
>> than stall. It was suggested that __GFP_NORETRY be used instead of
>> __GFP_NO_KSWAPD. This would look less like a special case but would
>> still cause compaction to run at least once with sync compaction.
>>
>
> This comment is bogus - __GFP_NORETRY would have caught THP allocations
> and would not call sync compaction. The issue was that it would also
> have caught any hypothetical high-order GFP_THISNODE allocations that
> end up calling compaction here

In fact, the I support patch concept so I would like to give

Acked-by: Minchan Kim <minchan.kim@gmail.com>
But it is still doubt about code.

__GFP_NORETRY: The VM implementation must not retry indefinitely

What could people think if they look at above comment?
At least, I can imagine two

First, it is related on *latency*.
Second, "I can handle if VM fails allocation"

I am biased toward latter.
Then, __GFP_NO_KSWAPD is okay? It means "let's avoid sync compaction
or long latency"?
It's rather awkward name. Already someone started to use
__GFP_NO_KSWAPD as such purpose.
See mtd_kmalloc_up_to. He mentioned in comment of function as follows,

 * the system page size. This attempts to make sure it does not adversely
 * impact system performance, so when allocating more than one page, we
 * ask the memory allocator to avoid re-trying, swapping, writing back
 * or performing I/O.

That thing was what I concerned.
In future, new users of __GFP_NO_KSWAPD is coming and we can't prevent
them under our sight.
So I hope we can change the flag name or fix above code and comment
out __GFP_NO_KSWAPD

/*
 * __GFP_NO_KSWAPD is very VM internal flag so Please don't use it
without allowing mm guys
 *
#define __GFP_NO_KSWAPD xxxx

>
>                /*
>                 * High-order allocations do not necessarily loop after
>                 * direct reclaim and reclaim/compaction depends on
>                 * compaction being called after reclaim so call directly if
>                 * necessary
>                 */
>                page = __alloc_pages_direct_compact(gfp_mask, order,
>                                        zonelist, high_zoneidx,
>                                        nodemask,
>                                        alloc_flags, preferred_zone,
>                                        migratetype, &did_some_progress,
>                                        sync_migration);
>
> __GFP_NORETRY is used in a bunch of places and while the most
> of them are not high-order, some of them potentially are like in
> sound/core/memalloc.c. Using __GFP_NO_KSWAPD as the flag allows
> these callers to continue using sync compaction.  It could be argued

Okay. If I was biased first, I have opposed this comment because they
might think __GFP_NORETRY is very latency sensitive.
So they wanted allocation is very fast without any writeback/retrial.
In view point, __GFP_NORETRY isn't bad, I think.

Having said that, I was biased latter, as I said earlier.

> that they would prefer __GFP_NORETRY but the potential side-effects
> should be taken should be taken into account and the comment updated

Considering side-effect, your patch is okay.
But I can't understand you mentioned "the comment updated if that
happens" sentence. :(

> if that happens.
>
> --
> Mel Gorman
> SUSE Labs
>
> --
> 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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>



-- 
Kind regards,
Minchan Kim

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-11-10 15:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 10:06 Mel Gorman
2011-11-10 10:38 ` Johannes Weiner
2011-11-10 10:51 ` Alan Cox
2011-11-10 12:06   ` Johannes Weiner
2011-11-10 14:00 ` Andrea Arcangeli
2011-11-10 14:22 ` Mel Gorman
2011-11-10 15:12   ` Minchan Kim [this message]
2011-11-10 16:13     ` Mel Gorman
2011-11-10 16:30       ` Minchan Kim
2011-11-10 16:48         ` Mel Gorman
2011-11-10 23:12       ` Andrew Morton
2011-11-10 23:37         ` David Rientjes
2011-11-11 10:14           ` Mel Gorman
2011-11-11 10:39             ` David Rientjes
2011-11-11 11:17               ` Mel Gorman
2011-11-11 14:21               ` Andrea Arcangeli
2011-11-14 23:44             ` Andrew Morton
2011-11-15 13:25               ` Mel Gorman
2011-11-15 21:07                 ` David Rientjes
2011-11-15 23:48                   ` Mel Gorman
2011-11-16  0:07                     ` David Rientjes
2011-11-16  4:13                       ` Andrea Arcangeli
2011-11-16 13:30                         ` Andrea Arcangeli
2011-11-16 15:07                           ` Mel Gorman
2011-11-18 17:59                           ` Andrea Arcangeli
2011-11-16 14:14                         ` Mel Gorman
2011-11-11 10:01         ` Mel Gorman
2011-11-15  0:03           ` Andrew Morton
2011-11-15  2:00             ` Andrea Arcangeli
2011-11-15  2:08               ` Andrea Arcangeli
2011-11-15 15:01                 ` Mel Gorman
2011-11-15 15:00               ` Mel Gorman
2011-11-15 13:07             ` Mel Gorman
2011-11-15 15:47               ` Andrea Arcangeli

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='CAEwNFnCRCxrru5rBk7FpypqeL8nD=SY5W3-TaA7Ap5o4CgDSbg@mail.gmail.com' \
    --to=minchan.kim@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=adi@hexapodia.org \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=jweiner@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /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