From: kanoj@google.engr.sgi.com (Kanoj Sarcar)
To: Manfred Spraul <manfreds@colorfullife.com>
Cc: torvalds@transmeta.com, sct@redhat.com, andrea@suse.de,
viro@math.psu.edu, linux-mm@kvack.org,
linux-kernel@vger.rutgers.edu
Subject: Re: [PATCH] kanoj-mm17-2.3.21 kswapd vma scanning protection
Date: Fri, 15 Oct 1999 14:13:36 -0700 (PDT) [thread overview]
Message-ID: <199910152113.OAA54020@google.engr.sgi.com> (raw)
In-Reply-To: <380792E9.7D1E5E1@colorfullife.com> from "Manfred Spraul" at Oct 15, 99 10:47:37 pm
>
> Kanoj Sarcar wrote:
> > Explain ... who are the readers, and who are the writers? I think if you
> > are talking about a semaphore lock being held thru out swapout() in the
> > try_to_swap_out path, you are reduced to the same deadlock I just pointed
> > out. I was talking more about a monitor like approach here.
>
> The lock is held thru out swapout(), but it is a shared lock: multiple
> swapper threads can own it. There should be no lock-up.
>
> reader: swapper. Reentrancy is not a problem because it is a read-lock,
> ie shared. The implementation must starve exclusive waiters (ie a reader
> is allowed to continue even if a writer is waiting).
>
> write: everyone who changes the vma list. These functions must not sleep
> while owning the ERESOURCE (IIRC the NT kernel name) exclusive.
>
> I hope I have not overlocked a detail,
> Manfred
>
With an eye partly towards this implementation, I had the page stealer
code grab vmlist_access_lock, while others get vmlist_modify_lock,
although in mm.h, both of these reduce to a down() operation.
The reason I am not very keen on this solution either is if you
consider process A holding vmlist_access_lock of B, going into swapout(),
where it tries to get a (sleeping) driver lock. Meanwhile, process B
has the driver lock, and is trying to grab the vmlist_update_lock on
itself, ie B, maybe to add/delete the vma. I do not think there is
such a driver currently though.
Kanoj
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/
next prev parent reply other threads:[~1999-10-15 21:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-15 0:06 Kanoj Sarcar
1999-10-15 11:58 ` Manfred Spraul
1999-10-15 16:38 ` Kanoj Sarcar
1999-10-15 18:26 ` Manfred Spraul
1999-10-15 18:43 ` Kanoj Sarcar
1999-10-15 20:47 ` Manfred Spraul
1999-10-15 21:13 ` Kanoj Sarcar [this message]
1999-10-15 21:24 ` Linus Torvalds
1999-10-15 21:39 ` Kanoj Sarcar
1999-10-15 22:04 ` Linus Torvalds
1999-10-15 22:32 ` Kanoj Sarcar
1999-10-15 23:16 ` Manfred Spraul
1999-10-16 0:44 ` Linus Torvalds
1999-10-18 19:45 ` Kanoj Sarcar
1999-10-18 20:02 ` Linus Torvalds
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=199910152113.OAA54020@google.engr.sgi.com \
--to=kanoj@google.engr.sgi.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=manfreds@colorfullife.com \
--cc=sct@redhat.com \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.edu \
/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