mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com,
	a.p.zijlstra@chello.nl, torvalds@linux-foundation.org,
	riel@redhat.com, akpm@linux-foundation.org, aarcange@redhat.com,
	mgorman@suse.de, tglx@linutronix.de
Cc: tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-tip-commits@vger.kernel.org, hpa@zytor.com,
	mingo@kernel.org, torvalds@linux-foundation.org, riel@redhat.com,
	aarcange@redhat.com, mgorman@suse.de, tglx@linutronix.de
Subject: Re: [tip:numa/core] mm: Count the number of pages affected in change_protection()
Date: Wed, 14 Nov 2012 09:26:45 -0800	[thread overview]
Message-ID: <20121114092645.95fce74b.akpm@linux-foundation.org> (raw)
In-Reply-To: <tip-a9463d90124af069b9b58a276acc46c00054d722@git.kernel.org>

On Wed, 14 Nov 2012 06:25:56 -0800 tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> mm: Count the number of pages affected in change_protection()
> 
> This will be used by three kinds of purposes:
> 
>  - to optimize mprotect()
> 
>  - to speed up working set scanning for working set areas that
>    have not been touched
> 
>  - to more accurately scan per real working set
> 
> No change in functionality from this patch.

Seems simple, cheap and useful.

A bit lacking in interface comments though.  In particular, does the
return value (which is in units of PAGE_SIZE pages) represent the
number of pages which were inspected, or the number of pages which
actually had their permissions modified?

>From a quick look, it seems the answer is both.  Or neither.  If a
page's protection was written to but unaltered, that counts as a "1". 
But if a pmd couldn't be locked via __pmd_trans_huge_lock(), that
counts as a "0".

Anyway, please have a think about it, and describe exactly what these
return values mean?


           reply	other threads:[~2012-11-14 17:26 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tip-a9463d90124af069b9b58a276acc46c00054d722@git.kernel.org>]

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=20121114092645.95fce74b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=aarcange@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mgorman@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome