From: Linus Torvalds <torvalds@transmeta.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Rik van Riel <riel@conectiva.com.br>,
Mike Galbraith <mikeg@wen-online.de>,
linux-mm@kvack.org, Manfred Spraul <manfred@colorfullife.com>,
MOLNAR Ingo <mingo@chiara.elte.hu>
Subject: Re: 3rd version of R/W mmap_sem patch available
Date: Mon, 19 Mar 2001 23:03:02 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.31.0103192300570.1195-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.31.0103192233230.1056-100000@penguin.transmeta.com>
On Mon, 19 Mar 2001, Linus Torvalds wrote:
>
> Although I'd prefer to see somebody check out the other architectures,
> to do the (pretty trivial) changes to make them support properly
> threaded page faults. I'd hate to have two pre-patches without any
> input from other architectures..
These are the trivial fixes to make -pre5 be spinlock-debugging-clean and
fix the missing unlock in copy_page_range(). I'd really like to hear from
architecture maintainers if possible.
Linus
----
diff -u --recursive --new-file pre5/linux/arch/i386/mm/ioremap.c linux/arch/i386/mm/ioremap.c
--- pre5/linux/arch/i386/mm/ioremap.c Mon Mar 19 18:49:18 2001
+++ linux/arch/i386/mm/ioremap.c Mon Mar 19 21:25:16 2001
@@ -62,6 +62,7 @@
static int remap_area_pages(unsigned long address, unsigned long phys_addr,
unsigned long size, unsigned long flags)
{
+ int error;
pgd_t * dir;
unsigned long end = address + size;
@@ -70,17 +71,21 @@
flush_cache_all();
if (address >= end)
BUG();
+ spin_lock(&init_mm.page_table_lock);
do {
pmd_t *pmd;
pmd = pmd_alloc(&init_mm, dir, address);
+ error = -ENOMEM;
if (!pmd)
- return -ENOMEM;
+ break;
if (remap_area_pmd(pmd, address, end - address,
phys_addr + address, flags))
- return -ENOMEM;
+ break;
+ error = 0;
address = (address + PGDIR_SIZE) & PGDIR_MASK;
dir++;
} while (address && (address < end));
+ spin_unlock(&init_mm.page_table_lock);
flush_tlb_all();
return 0;
}
diff -u --recursive --new-file pre5/linux/mm/memory.c linux/mm/memory.c
--- pre5/linux/mm/memory.c Mon Mar 19 18:49:20 2001
+++ linux/mm/memory.c Mon Mar 19 22:49:39 2001
@@ -160,6 +160,7 @@
src_pgd = pgd_offset(src, address)-1;
dst_pgd = pgd_offset(dst, address)-1;
+ spin_lock(&dst->page_table_lock);
for (;;) {
pmd_t * src_pmd, * dst_pmd;
@@ -178,7 +179,6 @@
continue;
}
- spin_lock(&dst->page_table_lock);
src_pmd = pmd_offset(src_pgd, address);
dst_pmd = pmd_alloc(dst, dst_pgd, address);
if (!dst_pmd)
@@ -247,13 +247,10 @@
cont_copy_pmd_range: src_pmd++;
dst_pmd++;
} while ((unsigned long)src_pmd & PMD_TABLE_MASK);
- spin_unlock(&dst->page_table_lock);
}
-out:
- return 0;
-
out_unlock:
spin_unlock(&src->page_table_lock);
+out:
spin_unlock(&dst->page_table_lock);
return 0;
--
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.eu.org/Linux-MM/
next prev parent reply other threads:[~2001-03-20 7:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.33.0103191802330.2076-100000@mikeg.weiden.de>
2001-03-20 1:56 ` Rik van Riel
2001-03-19 22:46 ` Linus Torvalds
2001-03-20 2:46 ` Linus Torvalds
2001-03-20 4:15 ` Marcelo Tosatti
2001-03-20 6:07 ` Linus Torvalds
2001-03-20 4:29 ` Marcelo Tosatti
2001-03-20 6:36 ` Linus Torvalds
2001-03-20 7:03 ` Linus Torvalds [this message]
2001-03-20 8:19 ` Eric W. Biederman
2001-03-20 15:11 ` Andrew Morton
2001-03-20 15:15 ` Jeff Garzik
2001-03-20 15:16 ` Jeff Garzik
2001-03-20 15:31 ` Andrew Morton
2001-03-21 1:59 ` Eric W. Biederman
2001-03-20 16:08 ` Linus Torvalds
2001-03-20 16:33 ` Andi Kleen
2001-03-20 17:13 ` Linus Torvalds
2001-03-20 19:33 ` Rik van Riel
2001-03-20 22:51 ` Andrew Morton
2001-03-22 10:24 ` Andrew Morton
2001-03-25 14:53 ` [patch] pae-2.4.3-A4 Ingo Molnar
2001-03-25 16:33 ` Russell King
2001-03-25 18:07 ` Linus Torvalds
2001-03-25 18:51 ` Ingo Molnar
[not found] <3AB6C7C2.D1A49FEF@uow.edu.au>
[not found] ` <Pine.LNX.4.31.0103191932240.7210-100000@penguin.transmeta.com>
2001-03-20 12:38 ` 3rd version of R/W mmap_sem patch available Stephen C. Tweedie
2001-03-20 14:02 ` H. Peter Anvin
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=Pine.LNX.4.31.0103192300570.1195-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=linux-mm@kvack.org \
--cc=manfred@colorfullife.com \
--cc=marcelo@conectiva.com.br \
--cc=mikeg@wen-online.de \
--cc=mingo@chiara.elte.hu \
--cc=riel@conectiva.com.br \
/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