linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: mremap() pte allocation atomicity error
Date: Fri, 27 Sep 2002 22:54:54 -0700	[thread overview]
Message-ID: <3D95442E.C0959F4A@digeo.com> (raw)
In-Reply-To: <20020928052813.GY22942@holomorphy.com>

William Lee Irwin III wrote:
> 
> I'm working on something else atm.
> 
>  [<c01187b3>]__might_sleep+0x43/0x47
>  [<c013b6d4>]__alloc_pages+0x24/0x20c
>  [<c0133650>]file_read_actor+0x0/0x1b0
>  [<c01131ed>]pte_alloc_one+0x41/0x104
>  [<c012d05d>]pte_alloc_map+0x4d/0x210
>  [<c013bc73>]get_page_cache_size+0xf/0x18
>  [<c0135f38>]move_one_page+0xe8/0x328
>  [<c0136061>]move_one_page+0x211/0x328
>  [<c0130644>]vm_enough_memory+0x34/0xc0
>  [<c01361a9>]move_page_tables+0x31/0x7c
>  [<c0136860>]do_mremap+0x66c/0x7ec
>  [<c0136a30>]sys_mremap+0x50/0x73
>  [<c010748f>]syscall_call+0x7/0xb
> 

ooh, oww, ouch.   Look at move_one_page():

        src = get_one_pte_map_nested(mm, old_addr);
        if (src) {
                dst = alloc_one_pte_map(mm, new_addr);
                error = copy_one_pte(mm, src, dst);


get_one_pte_map_nested() does a kmap_atomic(), and then we go and
call alloc_one_pte_map->pte_alloc_map->pte_alloc_one->alloc_pages()
inside that kmap_atomic().

I guess that has been there since day one.

A simple fix would be to drop the atomic kmap of the source pte
and take it again after the alloc_one_pte_map() call.

Can you think of a more efficient way?
--
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-mm.org/

  reply	other threads:[~2002-09-28  5:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-28  5:28 William Lee Irwin III
2002-09-28  5:54 ` Andrew Morton [this message]
2002-09-28  6:04   ` William Lee Irwin III
2002-09-28  6:10     ` Andrew Morton

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=3D95442E.C0959F4A@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=wli@holomorphy.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