mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] fix CONFIG_DEBUG_HIGHMEM assert in copy_page_range()
Date: Tue, 28 Sep 2004 01:45:23 +0200	[thread overview]
Message-ID: <20040927234523.GA2889@elte.hu> (raw)


copy_page_range() triggers a CONFIG_DEBUG_HIGHMEM assert, because if a
preemption occurs right at a PMD_SIZE boundary the kmap/kunmap doesnt
match. This isnt a real problem because atomic_kunmap doesnt do anything
if CONFIG_DEBUG_HIGHMEM is not set and the atomic_map's are still
correct, but it's ugly nevertheless.

tested patch is against 2.6.9-rc2-mm4.

	Ingo

Signed-off-by: Ingo Molnar <mingo@elte.hu>

--- linux/mm/memory.c.orig	
+++ linux/mm/memory.c	
@@ -337,14 +337,6 @@ skip_copy_pte_range:
 				set_pte(dst_pte, pte);
 				page_dup_rmap(page);
 cont_copy_pte_range_noset:
-				address += PAGE_SIZE;
-				if (address >= end) {
-					pte_unmap_nested(src_pte);
-					pte_unmap(dst_pte);
-					goto out_unlock;
-				}
-				src_pte++;
-				dst_pte++;
 				/*
 				 * We are holding two locks at this point -
 				 * any of them could generate latencies in
@@ -364,6 +356,14 @@ cont_copy_pte_range_noset:
 					dst_pte = pte_offset_map(dst_pmd, address);
 					src_pte = pte_offset_map_nested(src_pmd, address);
 				}
+				address += PAGE_SIZE;
+				if (address >= end) {
+					pte_unmap_nested(src_pte);
+					pte_unmap(dst_pte);
+					goto out_unlock;
+				}
+				src_pte++;
+				dst_pte++;
 			} while ((unsigned long)src_pte & PTE_TABLE_MASK);
 			pte_unmap_nested(src_pte-1);
 			pte_unmap(dst_pte-1);

                 reply	other threads:[~2004-09-27 23:43 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=20040927234523.GA2889@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --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

all inboxes | Powered by JetHome®