__get_free_pages problem, system then hangs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----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
~\-/~      [email protected]      ~\-/~
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-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux