linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sergey.senozhatsky.work@gmail.com (Sergey Senozhatsky)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/2] arm64: Implement vmalloc based thread_info allocator
Date: Wed, 27 May 2015 15:22:50 +0900	[thread overview]
Message-ID: <20150527062250.GD3928@swordfish> (raw)
In-Reply-To: <20150527041015.GB11609@blaptop>

On (05/27/15 13:10), Minchan Kim wrote:
> On Tue, May 26, 2015 at 08:29:59PM +0900, Jungseok Lee wrote:
> > On May 25, 2015, at 11:40 PM, Minchan Kim wrote:
> > > Hello Jungseok,
> > 
> > Hi, Minchan,
> > 
> > > On Mon, May 25, 2015 at 01:02:20AM +0900, Jungseok Lee wrote:
> > >> Fork-routine sometimes fails to get a physically contiguous region for
> > >> thread_info on 4KB page system although free memory is enough. That is,
> > >> a physically contiguous region, which is currently 16KB, is not available
> > >> since system memory is fragmented.
> > > 
> > > Order less than PAGE_ALLOC_COSTLY_ORDER should not fail in current
> > > mm implementation. If you saw the order-2,3 high-order allocation fail
> > > maybe your application received SIGKILL by someone. LMK?
> > 
> > Exactly right. The allocation is failed via the following path.
> > 
> > if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))
> > 	goto nopage;
> > 
> > IMHO, a reclaim operation would be not needed in this context if memory is
> > allocated from vmalloc space. It means there is no need to traverse shrinker list. 
> 
> For making fork successful with using vmalloc, it's bandaid.
> 
> > 
> > >> This patch tries to solve the problem as allocating thread_info memory
> > >> from vmalloc space, not 1:1 mapping one. The downside is one additional
> > >> page allocation in case of vmalloc. However, vmalloc space is large enough,
> > > 
> > > The size you want to allocate is 16KB in here but additional 4K?
> > > It increases 25% memory footprint, which is huge downside.
> > 
> > I agree with the point, and most people who try to use vmalloc might know the number.
> > However, an interoperation on the number depends on a point of view.
> > 
> > Vmalloc is large enough and not fully utilized in case of ARM64.
> > With the considerations, there is a room to do math as follows.
> > 
> > 4KB / 240GB = 1.5e-8 (4KB page + 3 level combo)
> > 
> > It would be not a huge downside if fork-routine is not damaged due to fragmentation.
> 
> Okay, address size point of view, it wouldn't be significant problem.
> Then, let's see it performance as point of view.
> 
> If we use vmalloc, it needs additional data structure for vmalloc
> management, several additional allocation request, page table hanlding
> and TLB flush.

plus a guard page. I don't see VM_NO_GUARD being passed.

	-ss

> 
> Normally, forking is very frequent operation so we shouldn't do
> make it slow and memory consumption bigger if there isn't big reason.
> 
> > 
> > However, this is one of reasons to add "RFC" prefix in the patch set. How is the
> > additional 4KB interpreted and considered?
> > 
> > Best Regards
> > Jungseok Lee
> 
> -- 
> Kind regards,
> Minchan Kim
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo at kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email at kvack.org </a>
> 

  reply	other threads:[~2015-05-27  6:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-24 16:02 [RFC PATCH 2/2] arm64: Implement vmalloc based thread_info allocator Jungseok Lee
2015-05-24 17:49 ` Arnd Bergmann
2015-05-25 10:01   ` Jungseok Lee
2015-05-25 14:58     ` Minchan Kim
2015-05-26 12:10       ` Jungseok Lee
2015-05-27  4:24         ` Minchan Kim
2015-05-27 16:00           ` Jungseok Lee
2015-05-25 16:47     ` Catalin Marinas
2015-05-25 20:29       ` Arnd Bergmann
2015-05-25 22:36         ` Catalin Marinas
2015-05-26  9:51           ` Arnd Bergmann
2015-05-26 13:02       ` Jungseok Lee
2015-05-25 21:20     ` Arnd Bergmann
2015-05-25 14:40 ` Minchan Kim
2015-05-26 11:29   ` Jungseok Lee
2015-05-27  4:10     ` Minchan Kim
2015-05-27  6:22       ` Sergey Senozhatsky [this message]
2015-05-27  7:31         ` Arnd Bergmann
2015-05-27 16:05           ` Jungseok Lee
2015-05-27 16:08       ` Jungseok Lee
2015-05-26  2:52 ` yalin wang
2015-05-26 12:21   ` Jungseok Lee

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=20150527062250.GD3928@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).