linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jc-nospam@jr-pizarro.jazztel.es
To: linux-kernel@vger.kernel.org
Subject: patch-2.4.26.bz2, it wastes unnecessary 2 TIMES get_one_pte(mm, old_addr);
Date: Wed, 14 Apr 2004 23:14:36 +0200 (CEST)	[thread overview]
Message-ID: <1081977275.407da9bc023e4@webmail.jazznet.es> (raw)

Hi ;)

>From mm/mremap.c of patch-2.4.26.bz2: "It wastes unnecessary 2 TIMES
get_one_pte(mm, old_addr);"

diff -urN linux-2.4.25/mm/mremap.c linux-2.4.26/mm/mremap.c
--- linux-2.4.25/mm/mremap.c	2004-02-18 05:36:32.000000000 -0800
+++ linux-2.4.26/mm/mremap.c	2004-04-14 06:05:41.000000000 -0700
@@ -77,12 +77,16 @@
 static int move_one_page(struct mm_struct *mm, unsigned long old_addr, unsigned
long new_addr)
 {
 	int error = 0;
-	pte_t * src;
+	pte_t * src, * dst;
 
 	spin_lock(&mm->page_table_lock);
 	src = get_one_pte(mm, old_addr);
-	if (src)
-		error = copy_one_pte(mm, src, alloc_one_pte(mm, new_addr));
+	if (src) {
+		dst = alloc_one_pte(mm, new_addr);
+		src = get_one_pte(mm, old_addr);
+		if (src) 
+			error = copy_one_pte(mm, src, dst);
+	}
 	spin_unlock(&mm->page_table_lock);
 	return error;
 }


                 reply	other threads:[~2004-04-14 21:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1081977275.407da9bc023e4@webmail.jazznet.es \
    --to=jc-nospam@jr-pizarro.jazztel.es \
    --cc=linux-kernel@vger.kernel.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).