linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@intel.com>,
	linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org,
	kirill@shutemov.name, kirill.shutemov@linux.intel.com,
	vbabka@suse.cz, will.deacon@arm.com
Subject: Re: [RFC 0/4] mm: Introduce lazy exec permission setting on a page
Date: Mon, 18 Feb 2019 14:46:24 +0530	[thread overview]
Message-ID: <b1a09e8b-7975-3f5c-8fd3-76b3a3447371@arm.com> (raw)
In-Reply-To: <20190218090433.bxtty3rrgo4ln6hp@mbp>



On 02/18/2019 02:34 PM, Catalin Marinas wrote:
> On Mon, Feb 18, 2019 at 02:01:55PM +0530, Anshuman Khandual wrote:
>> On 02/14/2019 10:25 PM, Dave Hansen wrote:
>>> On 2/13/19 8:12 PM, Anshuman Khandual wrote:
>>>> On 02/13/2019 09:14 PM, Dave Hansen wrote:
>>>>> On 2/13/19 12:06 AM, Anshuman Khandual wrote:
>>>>>> Setting an exec permission on a page normally triggers I-cache invalidation
>>>>>> which might be expensive. I-cache invalidation is not mandatory on a given
>>>>>> page if there is no immediate exec access on it. Non-fault modification of
>>>>>> user page table from generic memory paths like migration can be improved if
>>>>>> setting of the exec permission on the page can be deferred till actual use.
>>>>>> There was a performance report [1] which highlighted the problem.
>>>>>
>>>>> How does this happen?  If the page was not executed, then it'll
>>>>> (presumably) be non-present which won't require icache invalidation.
>>>>> So, this would only be for pages that have been executed (and won't
>>>>> again before the next migration), *or* for pages that were mapped
>>>>> executable but never executed.
>>>> I-cache invalidation happens while migrating a 'mapped and executable' page
>>>> irrespective whether that page was really executed for being mapped there
>>>> in the first place.
>>>
>>> Ahh, got it.  I also assume that the Accessed bit on these platforms is
>>> also managed similar to how we do it on x86 such that it can't be used
>>> to drive invalidation decisions?
>>
>> Drive I-cache invalidation ? Could you please elaborate on this. Is not that
>> the access bit mechanism is to identify dirty pages after write faults when
>> it is SW updated or write accesses when HW updated. In SW updated method, given
>> PTE goes through pte_young() during page fault. Then how to differentiate exec
>> fault/access from an write fault/access and decide to invalidate the I-cache.
>> Just being curious.
> 
> The access flag is used to identify young/old pages only (the dirty bit
> is used to track writes to a page). Depending on the Arm implementation,
> the access bit/flag could be managed by hardware transparently, so no
> fault taken to the kernel on accessing through an 'old' pte.

Then there is no way to identify an exec fault with either of the facilities of
access/reference bit or dirty bit whether managed by SW or HW. Still wondering about
previous comment where Dave mentioned how it can be used for I-cache invalidation.


  reply	other threads:[~2019-02-18  9:16 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
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 [this message]
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=b1a09e8b-7975-3f5c-8fd3-76b3a3447371@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --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=mhocko@kernel.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