linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Izik Eidus <ieidus@redhat.com>
To: Robin Holt <holt@sgi.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Chris Wright <chrisw@redhat.com>,
	linux-mm@kvack.org
Subject: Re: [Patch] mm/ksm.c is doing an unneeded _notify in write_protect_page.
Date: Thu, 11 Mar 2010 18:01:59 +0200	[thread overview]
Message-ID: <20100311180159.124ffecd@redhat.com> (raw)
In-Reply-To: <20100311155422.GB5685@sgi.com>

On Thu, 11 Mar 2010 09:54:22 -0600
Robin Holt <holt@sgi.com> wrote:

> 
> ksm.c's write_protect_page implements a lockless means of verifying a
> page does not have any users of the page which are not accounted for via
> other kernel tracking means.  It does this by removing the writable pte
> with TLB flushes, checking the page_count against the total known users,
> and then using set_pte_at_notify to make it a read-only entry.
> 
> An unneeded mmu_notifier callout is made in the case where the known
> users does not match the page_count.  In that event, we are inserting
> the identical pte and there is no need for the set_pte_at_notify, but
> rather the simpler set_pte_at suffices.
> 
> Signed-off-by: Robin Holt <holt@sgi.com>
> To: Izik Eidus <ieidus@redhat.com>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: Chris Wright <chrisw@redhat.com>
> Cc: linux-mm@kvack.org

Acked-by: Izik Eidus <ieidus@redhat.com>

> 
> ---
> 
>  mm/ksm.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: ksm_remove_notify/mm/ksm.c
> ===================================================================
> --- ksm_remove_notify.orig/mm/ksm.c	2010-03-11 09:24:30.000000000 -0600
> +++ ksm_remove_notify/mm/ksm.c	2010-03-11 09:35:18.000000000 -0600
> @@ -751,7 +751,7 @@ static int write_protect_page(struct vm_
>  		 * page
>  		 */
>  		if (page_mapcount(page) + 1 + swapped != page_count(page)) {
> -			set_pte_at_notify(mm, addr, ptep, entry);
> +			set_pte_at(mm, addr, ptep, entry);
>  			goto out_unlock;
>  		}
>  		entry = pte_wrprotect(entry);

--
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>

  reply	other threads:[~2010-03-11 16:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 19:18 mm/ksm.c seems to be doing an unneeded _notify Robin Holt
2010-03-10 20:19 ` Chris Wright
2010-03-10 20:19 ` Izik Eidus
2010-03-10 22:19   ` Andrea Arcangeli
2010-03-11  6:23     ` Hugh Dickins
2010-03-11 13:20       ` Izik Eidus
2010-03-11 15:54         ` [Patch] mm/ksm.c is doing an unneeded _notify in write_protect_page Robin Holt
2010-03-11 16:01           ` Izik Eidus [this message]
2010-03-11 16:06             ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2010-03-11 17:23 Robin Holt
2010-03-11 18:44 ` Hugh Dickins

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=20100311180159.124ffecd@redhat.com \
    --to=ieidus@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=chrisw@redhat.com \
    --cc=holt@sgi.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-mm@kvack.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).