linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* system call for process information?
@ 2001-03-12 17:08 Guennadi Liakhovetski
  2001-03-12 18:27 ` Alexander Viro
  0 siblings, 1 reply; 36+ messages in thread
From: Guennadi Liakhovetski @ 2001-03-12 17:08 UTC (permalink / raw)
  To: linux-kernel

Hello

I asked this question on kernel-newbies - no reply, hope to be luckier
here:-)

I need to collect some info on processes. One way is to read /proc
tree. But isn't there a system call (ioctl) for this? And what are those
task[], task_struct, etc. about?

Thanks
Guennadi
___

Dr. Guennadi V. Liakhovetski
Department of Applied Mathematics
University of Sheffield, U.K.
email: G.Liakhovetski@sheffield.ac.uk


-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml


^ permalink raw reply	[flat|nested] 36+ messages in thread
* 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; 36+ 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] 36+ messages in thread
[parent not found: <Pine.LNX.4.33.0103181407520.1426-100000@mikeg.weiden.de>]
[parent not found: <200103181813.KAA22153@penguin.transmeta.com>]

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

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-12 17:08 system call for process information? Guennadi Liakhovetski
2001-03-12 18:27 ` Alexander Viro
2001-03-12 21:21   ` Guennadi Liakhovetski
2001-03-13  2:56     ` Nathan Paul Simons
2001-03-13  3:20       ` Alexander Viro
2001-03-13  9:55         ` Guennadi Liakhovetski
2001-03-13 21:05       ` Albert D. Cahalan
2001-03-13 22:02         ` Nathan Paul Simons
2001-03-13 22:50           ` Albert D. Cahalan
2001-03-13 22:52         ` Rik van Riel
2001-03-14  1:53           ` Martin Dalecki
2001-03-14  2:28             ` Rik van Riel
2001-03-14  8:24               ` george anzinger
2001-03-14 19:19                 ` Rik van Riel
2001-03-14 16:27                   ` george anzinger
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
2001-03-14  1:59           ` system call for process information? john slee
2001-03-14 19:53   ` Szabolcs Szakacsits
2001-03-14 19:55     ` Alexander Viro
2001-03-14 20:23       ` Szabolcs Szakacsits
2001-03-14 20:21         ` Alexander Viro
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] <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
     [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

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).