mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: architecture bootup changes..
       [not found] <Pine.LNX.4.10.9910201813380.836-100000@penguin.transmeta.com>
@ 1999-10-21  2:33 ` Paul Mackerras
  1999-10-21  3:35   ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 1999-10-21  2:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

On Thu, 21 Oct 1999, Linus Torvalds wrote:

> And some
> things are more "struct page *" based than based on virtual kernel
> addresses, as the high memory support got cleaned up and better integrated
> in the memory management.

There's a problem that doesn't show up on intel, and that is that
flush_page_to_ram() is called with inconsistent arguments.  Sometimes it's
a struct page * (mm/filemap.c and mm/memory.c), in other cases it's a
kernel virtual address (e.g. kernel/ptrace.c, include/linux/highmem.h).

I'm inclined to think it should be a kernel virtual address.  Comments?

Regards,
Paul.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: architecture bootup changes..
  1999-10-21  2:33 ` architecture bootup changes Paul Mackerras
@ 1999-10-21  3:35   ` Linus Torvalds
  1999-10-21  4:25     ` Paul Mackerras
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 1999-10-21  3:35 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linux-kernel



On Thu, 21 Oct 1999, Paul Mackerras wrote:
> 
> There's a problem that doesn't show up on intel, and that is that
> flush_page_to_ram() is called with inconsistent arguments.  Sometimes it's
> a struct page * (mm/filemap.c and mm/memory.c), in other cases it's a
> kernel virtual address (e.g. kernel/ptrace.c, include/linux/highmem.h).
> 
> I'm inclined to think it should be a kernel virtual address.  Comments?

Ho humm.. I would almost prefer the "struct page" because in theory you
might want to do it without mapping the page at all. But this is
definitely a case where most of the time it's only needed with virtual
caches, so at the same time a virtual address is not necessarily wrong
either.

So my preference would be a "struct page", but if you have a stronger
opinion you can override me with a little argumentation for show, ok?

		Linus


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: architecture bootup changes..
  1999-10-21  3:35   ` Linus Torvalds
@ 1999-10-21  4:25     ` Paul Mackerras
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 1999-10-21  4:25 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

On Thu, 21 Oct 1999, Linus Torvalds wrote:

> Ho humm.. I would almost prefer the "struct page" because in theory you
> might want to do it without mapping the page at all. But this is
> definitely a case where most of the time it's only needed with virtual
> caches, so at the same time a virtual address is not necessarily wrong
> either.
> 
> So my preference would be a "struct page", but if you have a stronger
> opinion you can override me with a little argumentation for show, ok?

I don't have a strong opinion about it, I'm quite happy with the struct
page option.  Here is a patch which fixes the places where pre-2.3.23-5
calls flush_page_to_ram with a virtual address (in the generic code; I
haven't tried to fix the places under arch/), plus a thinko in
mm/memory.c.

I have pre-2.3.23-5 running on my PPC (an Apple G3 powerbook) but it
crashes as soon as it starts to use swap, with a kernel bug at
include/linux/pagemap.h:105, in kswapd.  The stack trace is:

add_page_to_inode_queue (inline in add_to_page_cache)
add_to_page_cache
add_to_swap_cache
try_to_swap_out
swap_out_vma
swap_out_mm
swap_out
do_try_to_free_pages
kswapd

Have others seen this problem, or is it a PPC-specific stuff-up of mine? 
:-)

Paul.

diff -urN official/fs/exec.c linux/fs/exec.c
--- official/fs/exec.c	Thu Oct 21 11:57:36 1999
+++ linux/fs/exec.c	Thu Oct 21 13:46:02 1999
@@ -246,7 +246,7 @@
 					memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len);
 			}
 			err = copy_from_user(kaddr + offset, str, bytes_to_copy);
-			flush_page_to_ram(kaddr);
+			flush_page_to_ram(page);
 			kunmap((unsigned long)kaddr, KM_WRITE);
 
 			if (err)
diff -urN official/include/linux/highmem.h linux/include/linux/highmem.h
--- official/include/linux/highmem.h	Thu Oct 21 11:57:38 1999
+++ linux/include/linux/highmem.h	Thu Oct 21 14:01:23 1999
@@ -59,7 +59,7 @@
 		BUG();
 	kaddr = kmap(page, KM_WRITE);
 	memset((void *)(kaddr + offset), 0, size);
-	flush_page_to_ram(kaddr);
+	flush_page_to_ram(page);
 	kunmap(kaddr, KM_WRITE);
 }
 
diff -urN official/kernel/ptrace.c linux/kernel/ptrace.c
--- official/kernel/ptrace.c	Thu Oct 21 11:57:38 1999
+++ linux/kernel/ptrace.c	Thu Oct 21 14:01:22 1999
@@ -52,12 +52,12 @@
 	if (write) {
 		maddr = kmap(page, KM_WRITE);
 		memcpy((char *)maddr + (addr & ~PAGE_MASK), buf, len);
-		flush_page_to_ram(maddr);
+		flush_page_to_ram(page);
 		kunmap(maddr, KM_WRITE);
 	} else {
 		maddr = kmap(page, KM_READ);
 		memcpy(buf, (char *)maddr + (addr & ~PAGE_MASK), len);
-		flush_page_to_ram(maddr);
+		flush_page_to_ram(page);
 		kunmap(maddr, KM_READ);
 	}
 	return len;
diff -urN official/mm/memory.c linux/mm/memory.c
--- official/mm/memory.c	Thu Oct 21 11:57:38 1999
+++ linux/mm/memory.c	Thu Oct 21 14:01:21 1999
@@ -742,7 +742,7 @@
 		__free_page(page);
 		return 0;
 	}
-	flush_page_to_ram(pte_page(page));
+	flush_page_to_ram(page);
 	set_pte(pte, pte_mkwrite(page_pte_prot(page, PAGE_COPY)));
 /* no need for flush_tlb */
 	return page;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-10-21  4:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.10.9910201813380.836-100000@penguin.transmeta.com>
1999-10-21  2:33 ` architecture bootup changes Paul Mackerras
1999-10-21  3:35   ` Linus Torvalds
1999-10-21  4:25     ` Paul Mackerras

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®