Changeset c0697c4c in mainline


Ignore:
Timestamp:
2007-12-16T18:45:48Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2a3db79
Parents:
cb08279
Message:

Fix a bug in anonymous address space area sharing. Call the backend's share
function only if the source area is not already shared. Otherwise increment the
sh_info refcount. Without this fix, the kernel will try to recreate the pagemap
if three and more address space areas attempt to share the same data.

Location:
kernel/generic/src/mm
Files:
2 edited

Legend:

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

    rcb08279 rc0697c4c  
    641641 */
    642642int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size,
    643                   as_t *dst_as, uintptr_t dst_base, int dst_flags_mask)
     643    as_t *dst_as, uintptr_t dst_base, int dst_flags_mask)
    644644{
    645645        ipl_t ipl;
     
    703703                btree_create(&sh_info->pagemap);
    704704                src_area->sh_info = sh_info;
     705                /*
     706                 * Call the backend to setup sharing.
     707                 */
     708                src_area->backend->share(src_area);
    705709        } else {
    706710                mutex_lock(&sh_info->lock);
     
    708712                mutex_unlock(&sh_info->lock);
    709713        }
    710 
    711         src_area->backend->share(src_area);
    712714
    713715        mutex_unlock(&src_area->lock);
  • kernel/generic/src/mm/backend_elf.c

    rcb08279 rc0697c4c  
    305305                         */
    306306                        if (!(area->flags & AS_AREA_WRITE))
    307                                 if (base + count*PAGE_SIZE <= start_anon)
     307                                if (base + count * PAGE_SIZE <= start_anon)
    308308                                        continue;
    309309                       
Note: See TracChangeset for help on using the changeset viewer.