linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Ben LaHaise <bcrl@redhat.com>, Christoph Rohland <cr@sap.com>
Subject: Re: [PATCH] Fix races in 2.4.2-ac22 SysV shared memory
Date: Fri, 23 Mar 2001 14:27:12 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.31.0103231424230.766-100000@penguin.transmeta.com> (raw)
In-Reply-To: <E14gZuj-0005YN-00@the-village.bc.nu>


On Fri, 23 Mar 2001, Alan Cox wrote:
> >
> > 	+       spin_lock (&info->lock);
> > 	+
> > 	+       /* The shmem_swp_entry() call may have blocked, and
> > 	+        * shmem_writepage may have been moving a page between the page
> > 	+        * cache and swap cache.  We need to recheck the page cache
> > 	+        * under the protection of the info->lock spinlock. */
> > 	+
> > 	+       page = find_lock_page(mapping, idx);
> >
> > Ehh.. Sleeping with the spin-lock held? Sounds like a truly bad idea.
>
> Umm find_lock_page doesnt sleep does it ?

Sure it does. Note the "lock" in find_lock_page(). It will lock the page,
which implies sleeping if somebody is accessing it at the same time.

If you don't want to sleep, you need to use one of the wrappers for
"__find_page_nolock()". Something like "find_get_page()", which only
"gets" the page.

The naming actually does make sense in this area.

		Linus

--
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/

  parent reply	other threads:[~2001-03-23 22:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-23  1:13 Stephen C. Tweedie
2001-03-23 19:58 ` Linus Torvalds
2001-03-23 22:20   ` Alan Cox
2001-03-23 22:23     ` Alexander Viro
2001-03-23 22:29       ` Alan Cox
2001-03-23 22:27     ` Linus Torvalds [this message]
2001-03-23 22:35       ` Alan Cox
2001-03-23 22:37         ` Linus Torvalds
2001-03-23 22:31     ` David S. Miller
2001-03-25  0:13   ` Stephen C. Tweedie
2001-03-25  1:05     ` Rik van Riel
2001-03-25 16:50       ` Stephen C. Tweedie
2001-03-28  9:18 ` Christoph Rohland

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.0103231424230.766-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bcrl@redhat.com \
    --cc=cr@sap.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.com \
    /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