All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: __get_free_pages problem, system then hangs
Date: Thu, 30 Mar 2006 19:49:09 +0200	[thread overview]
Message-ID: <442C1A15.7040503@gmail.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I am trying to get pages as memory place with code like this one:

        mem = __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(size));
        if (mem == 0ul)
                goto end;

        page = virt_to_page(mem);

        for (i = 0; i < (1 << get_order(size)); i++, page++) {
                get_page(page);
                SetPageReserved(page);
                SetPageLocked(page);
        }

What's wrong with `for' loop? When I am trying to mark them as reserved or
whatever you see there, the system hangs in few moments (some oopses with memory
allocation, obviously).

The problem disappears if:
a) get pages is called with __GFP_COMP flag and then it's sufficient to mark
only the first page (the rest is "bounded" to that one), but even if I mark all,
the problem doesn't appear,
b) I mark only the first page -- it's not what I want, I suppose

Size is 11k i. e. order is 2 (actually, 3 pages are needed) on my i386 system.

Could somebody tell me what am I still missing?

thanks,
- --
Jiri Slaby         www.fi.muni.cz/~xslaby
~\-/~      jirislaby@gmail.com      ~\-/~
B67499670407CE62ACC8 22A032CC55C339D47A7E

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFELBoVMsxVwznUen4RAoV+AJ0cPRrb7dLyIUPN0RkSpGVhD8LQmQCfelAJ
XDbNydUdRGHHJcN48A0Eib4=
=8vx7
-----END PGP SIGNATURE-----

                 reply	other threads:[~2006-03-30 17:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=442C1A15.7040503@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.