From: Michal Hocko <mhocko@suse.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
linux-mm@kvack.org, akpm@linux-foundation.org,
kirill@shutemov.name, kirill.shutemov@linux.intel.com,
vbabka@suse.cz, will.deacon@arm.com, dave.hansen@intel.com
Subject: Re: [RFC 0/4] mm: Introduce lazy exec permission setting on a page
Date: Fri, 15 Feb 2019 10:27:46 +0100 [thread overview]
Message-ID: <20190215092746.GU4525@dhcp22.suse.cz> (raw)
In-Reply-To: <d2646840-f2f0-3618-889a-54cfef6cb455@arm.com>
On Fri 15-02-19 14:15:58, Anshuman Khandual wrote:
> On 02/14/2019 05:58 PM, Michal Hocko wrote:
> > It is hard to assume any further access for migrated pages here. Then we
> > have an explicit move_pages syscall and I would expect this to be
> > somewhere in the middle. One would expect that the caller knows why the
> > memory is migrated and it will be used but again, we cannot really
> > assume anything.
>
> What if the caller knows that it wont be used ever again or in near future
> and hence trying to migrate to a different node which has less expensive and
> slower memory. Kernel should not assume either way on it but can decide to
> be conservative in spending time in preparing for future exec faults.
>
> But being conservative during migration risks additional exec faults which
> would have been avoided if exec permission should have stayed on followed
> by an I-cache invalidation. Deferral of the I-cache invalidation requires
> removing the exec permission completely (unless there is some magic which
> I am not aware about) i.e unmapping page for exec permission and risking
> an exec fault next time around.
>
> This problem gets particularly amplified for mixed permission (WRITE | EXEC)
> user space mappings where things like NUMA migration, compaction etc probably
> gets triggered by write faults and additional exec permission there never
> really gets used.
Please quantify that and provide us with some _data_
> > This would suggest that this depends on the migration reason quite a
> > lot. So I would really like to see a more comprehensive analysis of
> > different workloads to see whether this is really worth it.
>
> Sure. Could you please give some more details on how to go about this and
> what specifically you are looking for ?
You are proposing an optimization without actually providing any
justification. The overhead is not removed it is just shifted from one
path to another. So you should have some pretty convincing arguments
to back that shift as a general win. You can go an test on wider range
of workloads and isolate the worst/best case behavior. I fully realize
that this is tedious. Another option would be to define conditions when
the optimization is going to be a huge win and have some convincing
arguments that many/most workloads are falling into that category while
pathological ones are not suffering much.
This is no different from any other optimizations/heuristics we have.
Btw. have you considered to have this optimization conditional based on
the migration reason or vma flags?
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-02-15 9:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 8:06 Anshuman Khandual
2019-02-13 8:06 ` [RFC 1/4] " Anshuman Khandual
2019-02-13 13:17 ` Matthew Wilcox
2019-02-13 13:53 ` Anshuman Khandual
2019-02-14 9:06 ` Mike Rapoport
2019-02-15 8:11 ` Anshuman Khandual
2019-02-15 9:49 ` Catalin Marinas
2019-02-13 8:06 ` [RFC 2/4] arm64/mm: Identify user level instruction faults Anshuman Khandual
2019-02-13 8:06 ` [RFC 3/4] arm64/mm: Allow non-exec to exec transition in ptep_set_access_flags() Anshuman Khandual
2019-02-13 8:06 ` [RFC 4/4] arm64/mm: Enable ARCH_SUPPORTS_LAZY_EXEC Anshuman Khandual
2019-02-13 11:21 ` [RFC 0/4] mm: Introduce lazy exec permission setting on a page Catalin Marinas
2019-02-13 15:38 ` Michal Hocko
2019-02-14 6:04 ` Anshuman Khandual
2019-02-14 8:38 ` Michal Hocko
2019-02-14 10:19 ` Catalin Marinas
2019-02-14 12:28 ` Michal Hocko
2019-02-15 8:45 ` Anshuman Khandual
2019-02-15 9:27 ` Michal Hocko [this message]
2019-02-18 3:07 ` Anshuman Khandual
2019-02-14 15:38 ` Dave Hansen
2019-02-18 3:19 ` Anshuman Khandual
2019-02-13 15:44 ` Dave Hansen
2019-02-14 4:12 ` Anshuman Khandual
2019-02-14 16:55 ` Dave Hansen
2019-02-18 8:31 ` Anshuman Khandual
2019-02-18 9:04 ` Catalin Marinas
2019-02-18 9:16 ` Anshuman Khandual
2019-02-18 18:20 ` Dave Hansen
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=20190215092746.GU4525@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=linux-mm@kvack.org \
--cc=vbabka@suse.cz \
--cc=will.deacon@arm.com \
/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