linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ross Biro <rossb@google.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC/PATCH 2/2] MM: Make Page Tables Relocatable --relcoation code
Date: Fri, 09 May 2008 16:04:53 +0100	[thread overview]
Message-ID: <48246815.9070607@goop.org> (raw)
In-Reply-To: <20080509135107.28D11DCA63@localhost>

Ross Biro wrote:
> +void update_new_page_and_free(struct mm_struct *mm, struct page *old_page)
> +{
> +
> +	int type;
> +
> +	/* Currently we only worry about cpu bits in ptes. */
> +	if (old_page->page_table_type == PAGE_TABLE_PTE) {
> +		struct page *new_page = old_page->migrated_page;
> +		spinlock_t *ptl;
> +		pte_t *old;
> +		pte_t *new;
> +		int i;
> +#ifdef __pte_lockptr
> +		ptl = __pte_lockptr(new_page);
> +#else
> +		ptl = &mm->page_table_lock;
> +#endif
> +		spin_lock(ptl);
> +		old = (pte_t *)kmap_atomic(old_page, KM_PTE0);
> +		new = (pte_t *)kmap_atomic(new_page, KM_PTE1);
> +		for (i = 0; i < PTRS_PER_PTE; i++)
> +			arch_copy_cpu_bits_pte(old, new);
>   

old++, new++?

> +
> +		kunmap_atomic(new_page, KM_PTE1);
> +		kunmap_atomic(old_page, KM_PTE0);
> +		new_page->migrated_page = NULL;
> +		spin_unlock(ptl);
> +	}
> +
> +	old_page->migrated_page = NULL;
> +	type = old_page->page_table_type;
> +	reset_page_mapcount(old_page);
> +
> +	free_page_table_page(mm, old_page, type);
> +}

    J

--
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:[~2008-05-09 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09 13:51 Ross Biro
2008-05-09 15:04 ` Jeremy Fitzhardinge [this message]

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=48246815.9070607@goop.org \
    --to=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rossb@google.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