From: Mel Gorman <mgorman@suse.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
Minchan Kim <minchan@kernel.org>,
Dave Hansen <dave.hansen@intel.com>,
Andi Kleen <andi@firstfloor.org>, H Peter Anvin <hpa@zytor.com>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 0/3] TLB flush multiple pages per IPI v5
Date: Wed, 10 Jun 2015 11:15:29 +0100 [thread overview]
Message-ID: <20150610101529.GE26425@suse.de> (raw)
In-Reply-To: <20150610090813.GA30359@gmail.com>
On Wed, Jun 10, 2015 at 11:08:13AM +0200, Ingo Molnar wrote:
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
> > Stop this crap.
> >
> > I made a really clear and unambiguous chain of arguments:
> >
> > - I'm unconvinced about the benefits of INVLPG in general, and your patches adds
> > a whole new bunch of them. [...]
>
> ... and note that your claim that 'we were doing them before, this is just an
> equivalent transformation' is utter bullsh*t technically: what we were doing
> previously was a hideously expensive IPI combined with an INVLPG.
>
And replacing it with an INVLPG without excessive IPI transmission is
changing one major variable. Going straight to a full TLB flush is changing
two major variables. I thought the refill cost was high, parially based
on the estimate of 22,000 cycles in https://lkml.org/lkml/2014/7/31/825.
I've been told in these discussions that I'm wrong and the cost is not
high. As it'll always be variable, we can never be sure which is why
I do not see a value to building a complex test around it that will be
invalidated the instant we use a different CPU. When/if a workload shows
up that really cares about those refill costs then there will be a stable
test case to work from.
> The behavior was dominated by the huge overhead of the remote flushing IPI, which
> does not prove or disprove either your or my opinion!
>
> Preserving that old INVLPG logic without measuring its benefits _again_ would be
> cargo cult programming.
>
> So I think this should be measured, and I don't mind worst-case TLB trashing
> measurements, which would be relatively straightforward to construct and the
> results should be unambiguous.
>
> The batching limit (which you set to 32) should then be tuned by comparing it to a
> working full-flushing batching logic, not by comparing it to the previous single
> IPI per single flush approach!
>
We can decrease it easily but increasing it means we also have to change
SWAP_CLUSTER_MAX because otherwise enough pages are not unmapped for
flushes and it is a requirement that we flush before freeing the pages. That
changes another complex variable because at the very least, it alters LRU
lock hold times.
> ... and if the benefits of a complex algorithm are not measurable and if there are
> doubts about the cost/benefit tradeoff then frankly it should not exist in the
> kernel in the first place. It's not like the Linux TLB flushing code is too boring
> due to overwhelming simplicity.
>
> and yes, it's my job as a maintainer to request measurements justifying complexity
> and your ad hominem attacks against me are disgusting - you should know better.
>
It was not intended as an ad hominem attack and my apologies for that.
I wanted to express my frustration that a series that adjusted one variable
with known benefit will be rejected for a series that adjusts two major
variables instead with the second variable being very sensitive to
workload and CPU.
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@suse.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
Minchan Kim <minchan@kernel.org>,
Dave Hansen <dave.hansen@intel.com>,
Andi Kleen <andi@firstfloor.org>, H Peter Anvin <hpa@zytor.com>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 0/3] TLB flush multiple pages per IPI v5
Date: Wed, 10 Jun 2015 11:15:29 +0100 [thread overview]
Message-ID: <20150610101529.GE26425@suse.de> (raw)
In-Reply-To: <20150610090813.GA30359@gmail.com>
On Wed, Jun 10, 2015 at 11:08:13AM +0200, Ingo Molnar wrote:
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
> > Stop this crap.
> >
> > I made a really clear and unambiguous chain of arguments:
> >
> > - I'm unconvinced about the benefits of INVLPG in general, and your patches adds
> > a whole new bunch of them. [...]
>
> ... and note that your claim that 'we were doing them before, this is just an
> equivalent transformation' is utter bullsh*t technically: what we were doing
> previously was a hideously expensive IPI combined with an INVLPG.
>
And replacing it with an INVLPG without excessive IPI transmission is
changing one major variable. Going straight to a full TLB flush is changing
two major variables. I thought the refill cost was high, parially based
on the estimate of 22,000 cycles in https://lkml.org/lkml/2014/7/31/825.
I've been told in these discussions that I'm wrong and the cost is not
high. As it'll always be variable, we can never be sure which is why
I do not see a value to building a complex test around it that will be
invalidated the instant we use a different CPU. When/if a workload shows
up that really cares about those refill costs then there will be a stable
test case to work from.
> The behavior was dominated by the huge overhead of the remote flushing IPI, which
> does not prove or disprove either your or my opinion!
>
> Preserving that old INVLPG logic without measuring its benefits _again_ would be
> cargo cult programming.
>
> So I think this should be measured, and I don't mind worst-case TLB trashing
> measurements, which would be relatively straightforward to construct and the
> results should be unambiguous.
>
> The batching limit (which you set to 32) should then be tuned by comparing it to a
> working full-flushing batching logic, not by comparing it to the previous single
> IPI per single flush approach!
>
We can decrease it easily but increasing it means we also have to change
SWAP_CLUSTER_MAX because otherwise enough pages are not unmapped for
flushes and it is a requirement that we flush before freeing the pages. That
changes another complex variable because at the very least, it alters LRU
lock hold times.
> ... and if the benefits of a complex algorithm are not measurable and if there are
> doubts about the cost/benefit tradeoff then frankly it should not exist in the
> kernel in the first place. It's not like the Linux TLB flushing code is too boring
> due to overwhelming simplicity.
>
> and yes, it's my job as a maintainer to request measurements justifying complexity
> and your ad hominem attacks against me are disgusting - you should know better.
>
It was not intended as an ad hominem attack and my apologies for that.
I wanted to express my frustration that a series that adjusted one variable
with known benefit will be rejected for a series that adjusts two major
variables instead with the second variable being very sensitive to
workload and CPU.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2015-06-10 10:15 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 12:50 [PATCH 0/3] TLB flush multiple pages per IPI v5 Mel Gorman
2015-06-08 12:50 ` Mel Gorman
2015-06-08 12:50 ` [PATCH 1/3] x86, mm: Trace when an IPI is about to be sent Mel Gorman
2015-06-08 12:50 ` Mel Gorman
2015-06-08 12:50 ` [PATCH 2/3] mm: Send one IPI per CPU to TLB flush multiple pages that were recently unmapped Mel Gorman
2015-06-08 12:50 ` Mel Gorman
2015-06-08 22:38 ` Andrew Morton
2015-06-08 22:38 ` Andrew Morton
2015-06-09 11:07 ` Mel Gorman
2015-06-09 11:07 ` Mel Gorman
2015-06-08 12:50 ` [PATCH 3/3] mm: Defer flush of writable TLB entries Mel Gorman
2015-06-08 12:50 ` Mel Gorman
2015-06-08 17:45 ` [PATCH 0/3] TLB flush multiple pages per IPI v5 Ingo Molnar
2015-06-08 17:45 ` Ingo Molnar
2015-06-08 18:21 ` Dave Hansen
2015-06-08 18:21 ` Dave Hansen
2015-06-08 19:52 ` Ingo Molnar
2015-06-08 19:52 ` Ingo Molnar
2015-06-08 20:03 ` Ingo Molnar
2015-06-08 20:03 ` Ingo Molnar
2015-06-08 21:07 ` Dave Hansen
2015-06-08 21:07 ` Dave Hansen
2015-06-08 21:50 ` Ingo Molnar
2015-06-08 21:50 ` Ingo Molnar
2015-06-09 8:47 ` Mel Gorman
2015-06-09 8:47 ` Mel Gorman
2015-06-09 10:32 ` Ingo Molnar
2015-06-09 10:32 ` Ingo Molnar
2015-06-09 11:20 ` Mel Gorman
2015-06-09 11:20 ` Mel Gorman
2015-06-09 12:43 ` Ingo Molnar
2015-06-09 12:43 ` Ingo Molnar
2015-06-09 13:05 ` Mel Gorman
2015-06-09 13:05 ` Mel Gorman
2015-06-10 8:51 ` Ingo Molnar
2015-06-10 8:51 ` Ingo Molnar
2015-06-10 9:08 ` Ingo Molnar
2015-06-10 9:08 ` Ingo Molnar
2015-06-10 10:15 ` Mel Gorman [this message]
2015-06-10 10:15 ` Mel Gorman
2015-06-11 15:26 ` Ingo Molnar
2015-06-11 15:26 ` Ingo Molnar
2015-06-10 9:19 ` Mel Gorman
2015-06-10 9:19 ` Mel Gorman
2015-06-09 15:34 ` Dave Hansen
2015-06-09 15:34 ` Dave Hansen
2015-06-09 16:49 ` Dave Hansen
2015-06-09 16:49 ` Dave Hansen
2015-06-09 21:14 ` Dave Hansen
2015-06-09 21:14 ` Dave Hansen
2015-06-09 21:54 ` Linus Torvalds
2015-06-09 21:54 ` Linus Torvalds
2015-06-09 22:32 ` Mel Gorman
2015-06-09 22:32 ` Mel Gorman
2015-06-09 22:35 ` Mel Gorman
2015-06-09 22:35 ` Mel Gorman
2015-06-10 13:13 ` Andi Kleen
2015-06-10 13:13 ` Andi Kleen
2015-06-10 16:17 ` Linus Torvalds
2015-06-10 16:17 ` Linus Torvalds
2015-06-10 16:42 ` Linus Torvalds
2015-06-10 16:42 ` Linus Torvalds
2015-06-10 17:24 ` Mel Gorman
2015-06-10 17:24 ` Mel Gorman
2015-06-10 17:31 ` Linus Torvalds
2015-06-10 17:31 ` Linus Torvalds
2015-06-10 18:08 ` Josh Boyer
2015-06-10 18:08 ` Josh Boyer
2015-06-10 17:07 ` Mel Gorman
2015-06-10 17:07 ` Mel Gorman
2015-06-21 20:22 ` Kirill A. Shutemov
2015-06-21 20:22 ` Kirill A. Shutemov
2015-06-25 11:48 ` Ingo Molnar
2015-06-25 11:48 ` Ingo Molnar
2015-06-25 18:36 ` Linus Torvalds
2015-06-25 19:15 ` Vlastimil Babka
2015-06-25 19:15 ` Vlastimil Babka
2015-06-25 22:04 ` Linus Torvalds
2015-06-25 22:04 ` Linus Torvalds
2015-06-25 18:46 ` Dave Hansen
2015-06-25 18:46 ` Dave Hansen
2015-06-26 9:08 ` Ingo Molnar
2015-06-26 9:08 ` Ingo Molnar
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=20150610101529.GE26425@suse.de \
--to=mgorman@suse.de \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
--cc=riel@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 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.