Changeset 9a9c805 in mainline


Ignore:
Timestamp:
2012-11-07T10:50:20Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5892ec1
Parents:
1107050
Message:

Reserve memory for NORESERVE areas pagefaults when the page fault
happens.

  • This way, NORESERVE areas should not contribute to an overcommit situation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/backend_anon.c

    r1107050 r9a9c805  
    236236                 */
    237237
    238                 unsigned int flags;
    239 
    240238                if (area->flags & AS_AREA_NORESERVE) {
    241239                        /*
    242                          * This is a NORESERVE area, which means that no
    243                          * physical memory has been reserved beforehands.
    244                          * We therefore need to make an atomic and reserving
    245                          * allocation.
     240                         * Reserve the memory for this page now.
    246241                         */
    247                         flags = FRAME_ATOMIC;
    248                 } else {
    249                         /*
    250                          * The physical memory has already been reserved
    251                          * when this part of the area was created. Avoid
    252                          * double reservation by using the appropriate flag.
    253                          */
    254                         flags = FRAME_NO_RESERVE;
     242                        if (!reserve_try_alloc(1))
     243                                return AS_PF_FAULT;
    255244                }
    256245
    257                 kpage = km_temporary_page_get(&frame, flags);
    258                 if (!kpage)
    259                         return AS_PF_FAULT;
     246                kpage = km_temporary_page_get(&frame, FRAME_NO_RESERVE);
    260247                memsetb((void *) kpage, PAGE_SIZE, 0);
    261248                km_temporary_page_put(kpage);
Note: See TracChangeset for help on using the changeset viewer.