public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: changing mm->mmap_sem  (was: Re: system call for process information?)
@ 2001-03-18  9:34 Manfred Spraul
  2001-03-18 10:56 ` Rik van Riel
  2001-03-19 12:54 ` Stephen C. Tweedie
  0 siblings, 2 replies; 16+ messages in thread
From: Manfred Spraul @ 2001-03-18  9:34 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-kernel, Stephen C. Tweedie

>
> The problem is that mmap_sem seems to be protecting the list
> of VMAs, so taking _only_ the page_table_lock could let a VMA
> change under us while a page fault is underway ...

No, that can't happen.
VMA changes only happen if both the mmap_sem and the page table lock is
acquired. (check insert_vm() at the end of mm/mmap.c)
The page fault path uses the map_sem, kswaps uses page_table_lock.

<< from your patch:
--- linux-2.4.2-ac20-vm/mm/vmscan.c.orig	Sat Mar 17 11:30:49 2001
+++ linux-2.4.2-ac20-vm/mm/vmscan.c	Sat Mar 17 20:53:10 2001
@@ -231,6 +231,7 @@
 	 * Find the proper vm-area after freezing the vma chain
 	 * and ptes.
 	 */
+	down_read(&mm->mmap_sem);
                spin_lock(&mm->page_table_lock);
 >>>>

Why do you acquire the mmap semaphore in swapout_mm()? The old rule was
that kswapd should never sleep on the mmap semaphore. Isn't there a
deadlock if mmap sem is already acquired? I don't remember the details.

>
> The problem is that mmap_sem seems to be protecting the list
> of VMAs, so taking _only_ the page_table_lock could let a VMA
> change under us while a page fault is underway ...

I remember that the pmd_alloc() and pte_alloc() functions need
additional locking.

--
    Manfred


^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <200103181813.KAA22153@penguin.transmeta.com>]
[parent not found: <Pine.LNX.4.33.0103181407520.1426-100000@mikeg.weiden.de>]
* Re: system call for process information?
@ 2001-03-14 19:19 Rik van Riel
  2001-03-15 12:24 ` changing mm->mmap_sem (was: Re: system call for process information?) Rik van Riel
  0 siblings, 1 reply; 16+ messages in thread
From: Rik van Riel @ 2001-03-14 19:19 UTC (permalink / raw)
  To: george anzinger
  Cc: Martin Dalecki, Albert D. Cahalan, npsimons,
	Guennadi Liakhovetski, Alexander Viro, linux-kernel

On Wed, 14 Mar 2001, george anzinger wrote:

> Is it REALLY necessary to prevent them from seeing an
> inconsistent state?  Seems to me that in the total picture (i.e.
> system wide) they will never see a consistent state, so why be
> concerned with a small corner of the system.

You're right. All we need to make sure of is that the address
space we want to print info about doesn't go away while we're
reading the stats ...

(I think ... but we'll need to look at the procfs code in more
detail)

regards,

Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml

Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com/


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

end of thread, other threads:[~2001-03-19 12:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-18  9:34 changing mm->mmap_sem (was: Re: system call for process information?) Manfred Spraul
2001-03-18 10:56 ` Rik van Riel
2001-03-19 12:54 ` Stephen C. Tweedie
     [not found] <200103181813.KAA22153@penguin.transmeta.com>
2001-03-18 20:59 ` Rik van Riel
2001-03-19  1:21   ` Linus Torvalds
2001-03-19  2:59     ` Rik van Riel
     [not found] <Pine.LNX.4.33.0103181407520.1426-100000@mikeg.weiden.de>
2001-03-18 14:43 ` Rik van Riel
2001-03-18 18:13   ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2001-03-14 19:19 system call for process information? Rik van Riel
2001-03-15 12:24 ` changing mm->mmap_sem (was: Re: system call for process information?) Rik van Riel
2001-03-16  9:49   ` Stephen C. Tweedie
2001-03-16 11:50     ` Rik van Riel
2001-03-16 12:53       ` Stephen C. Tweedie
2001-03-18  7:23         ` Rik van Riel
2001-03-18  9:56           ` Mike Galbraith
2001-03-18 10:46             ` Rik van Riel
2001-03-18 12:33               ` Mike Galbraith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox