linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Hugh Dickins <hughd@google.com>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Gerald Schaefer <gerald.schaefer@de.ibm.com>,
	Steve Capper <steve.capper@linaro.org>,
	Dann Frazier <dann.frazier@canonical.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [PATCH] thp, mm: remove comments on serializion of THP split vs. gup_fast
Date: Thu, 10 Mar 2016 18:04:06 +0100	[thread overview]
Message-ID: <20160310170406.GF30716@redhat.com> (raw)
In-Reply-To: <20160310163439.GS6356@twins.programming.kicks-ass.net>

On Thu, Mar 10, 2016 at 05:34:39PM +0100, Peter Zijlstra wrote:
> I'm not seeing that, the only point where this matters at all, is if the
> batch alloc fails, otherwise the RCU_TABLE_FREE stuff uses
> call_rcu_sched() and what you write above is true already.

Not on x86, only if HAVE_RCU_TABLE_FREE is selected, which is not the
case for x86:

arch/arm/Kconfig:       select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE)
arch/arm64/Kconfig:     select HAVE_RCU_TABLE_FREE
arch/powerpc/Kconfig:   select HAVE_RCU_TABLE_FREE if SMP
arch/sparc/Kconfig:     select HAVE_RCU_TABLE_FREE if SMP

> Normally, as already established by Martin, you should not actually ever
> encounter the sync_sched() call. Only under severe memory pressure, when
> the batch alloc in tlb_remove_table() fails is this ever an issue.

What I mean is that a large mmap/munmap loops may want to be
benchmarked to see if they end up stalling in the synchronize_sched
case through the memory pressure handler, in turn not restricting the
synchronize_sched to a real memory pressure situation but ending up in
the memory pressure just because of it. For example the normal load
running on ARM isn't as diverse as the one on x86 where RCU_TABLE_FREE
has never been exercised at large yet. I doubt anything like that
would ever materialize in light load, light munmap load certainly
would not be affected.

I doubt it'd be ok if munmap end up stalling in synchronize_sched. In
fact I'd feel safer if the srcu context can be added to the mm (but
that costs memory in the mm unless we're lucky with the slab hw
alignment), then I think synchronize_srcu may actually be preferable
than a full synchronize_sched that affects the entire system with
thousand of CPUs. A per-cpu inc wouldn't be a big deal and it would at
least avoid to stall for the whole system if a stall eventually has to
happen (unless every cpu is actually running gup_fast but that's ok in
such case).

About the IRQ safety of synchronize_sched, I was mistaken with sofitrq
which can block never mind sorry, of course local_irq_disable or
preempt_enable are both valid read barriers as schedule can't run.

--
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:[~2016-03-10 17:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 15:59 [PATCH] thp, mm: remove comments on serializion of THP split vs. gup_fast Kirill A. Shutemov
2016-02-24 17:50 ` Gerald Schaefer
2016-02-25 15:07   ` Kirill A. Shutemov
2016-02-26  6:50     ` Hugh Dickins
2016-02-26 11:06       ` Peter Zijlstra
2016-02-26 11:41         ` Martin Schwidefsky
2016-02-29  2:38           ` Hugh Dickins
2016-03-10 16:10       ` Andrea Arcangeli
2016-03-10 16:34         ` Peter Zijlstra
2016-03-10 16:40           ` Peter Zijlstra
2016-03-10 17:04           ` Andrea Arcangeli [this message]
2016-03-10 17:22             ` Andrea Arcangeli
2016-03-11  9:22               ` Peter Zijlstra

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=20160310170406.GF30716@redhat.com \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=dann.frazier@canonical.com \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=peterz@infradead.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=steve.capper@linaro.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).