linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave McCracken <dmccr@us.ibm.com>
To: Andrew Morton <akpm@digeo.com>
Cc: Ingo Molnar <mingo@elte.hu>, "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: install_page() lockup
Date: Wed, 23 Oct 2002 10:52:25 -0500	[thread overview]
Message-ID: <64680000.1035388345@baldur.austin.ibm.com> (raw)
In-Reply-To: <3DB63586.A3D4AC22@digeo.com>

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]


--On Tuesday, October 22, 2002 22:37:10 -0700 Andrew Morton
<akpm@digeo.com> wrote:

> 
> I'm getting lockups in install_page() with shared pagetables
> enabled.  I haven't really delved into it.  It happens under
> heavy memory pressure on SMP.
> 
> Ingo's new patch is using install_page much more than we
> used to (I don't think I've ever run it before), so we're
> running fairly untested codepaths here.

As Ingo said, he added install_page.

> I tried this:
> 
> (snip)
> 
> Because doing a pte_page_lock(ptepage) and then losing
> track of the page we just locked looks fishy.  Didn't
> help though.

The code was correct.  pte_unshare moves the lock to the new pte page if it
installs one.  I know that's not real clean, but it eliminates multiple
unlock/relock sequences.

> Dave could you please review the code in there?  It's probably
> something simple.

I found the problem.  In memory.c:do_file_page it unlocks the
page_table_lock.  In the new locking scheme, it's actually the
pte_page_lock that's held instead.

The patch to fix this is attached.

Dave McCracken

======================================================================
Dave McCracken          IBM Linux Base Kernel Team      1-512-838-3059
dmccr@us.ibm.com                                        T/L   678-3059

[-- Attachment #2: shpte-2.5.44-mm3-1.diff --]
[-- Type: text/plain, Size: 656 bytes --]

--- 2.5.44-mm3/mm/memory.c	2002-10-23 10:20:08.000000000 -0500
+++ 2.5.44-mm3-shsent/mm/memory.c	2002-10-23 10:42:56.000000000 -0500
@@ -1823,6 +1823,7 @@
 static int do_file_page(struct mm_struct * mm, struct vm_area_struct * vma,
 	unsigned long address, int write_access, pte_t *pte, pmd_t *pmd)
 {
+	struct page *ptepage = pmd_page(*pmd);
 	unsigned long pgoff;
 	int err;
 
@@ -1840,7 +1841,7 @@
 	pgoff = pte_to_pgoff(*pte);
 
 	pte_unmap(pte);
-	spin_unlock(&mm->page_table_lock);
+	pte_page_unlock(ptepage);
 
 	err = vma->vm_ops->populate(vma, address & PAGE_MASK, PAGE_SIZE, vma->vm_page_prot, pgoff, 0);
 	if (err == -ENOMEM)

      parent reply	other threads:[~2002-10-23 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-23  5:37 Andrew Morton
2002-10-23  6:49 ` Ingo Molnar
2002-10-23 15:55   ` Dave McCracken
2002-10-23 15:52 ` Dave McCracken [this message]

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=64680000.1035388345@baldur.austin.ibm.com \
    --to=dmccr@us.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    /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