Ignore:
Timestamp:
Apr 10, 2019, 10:09:39 AM (5 years ago)
Author:
alain
Message:

Fix a bug in the vmm_remove_vseg() function: the physical pages
associated to an user DATA vseg were released to the kernel when
the target process descriptor was in the reference cluster.
This physical pages release should be done only when the page
forks counter value is zero.
All other modifications are cosmetic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_mutex.c

    r624 r625  
    22 * sys_mutex.c - Access a POSIX mutex.
    33 *
    4  * Author    Alain Greiner (2016,2017,2018)
     4 * Author    Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    2424#include <hal_kernel_types.h>
    2525#include <hal_special.h>
     26#include <hal_vmm.h>
    2627#include <errno.h>
    2728#include <thread.h>
     
    5657    process_t * process = this->process;
    5758
     59#if (DEBUG_SYS_MUTEX || CONFIG_INSTRUMENTATION_SYSCALLS)
     60uint64_t     tm_start = hal_get_cycles();
     61#endif
     62
    5863#if DEBUG_SYS_MUTEX
    59 uint64_t    tm_start;
    60 uint64_t    tm_end;
    61 tm_start = hal_get_cycles();
    6264if( DEBUG_SYS_MUTEX < tm_start )
    63 printk("\n[DBG] %s : thread %x in process %x enter for %s / cycle %d\n",
     65printk("\n[%s] thread[%x,%x] enter for %s / cycle %d\n",
    6466__FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), (uint32_t)tm_start );
    6567#endif
     
    221223    hal_fence();
    222224
     225#if (DEBUG_SYS_MUTEX || CONFIG_INSTRUMENTATION_SYSCALLS)
     226uint64_t     tm_end = hal_get_cycles();
     227#endif
     228
    223229#if DEBUG_SYS_MUTEX
    224 tm_end = hal_get_cycles();
    225 if( DEBUG_SYS_MUTEX < tm_start )
    226 printk("\n[DBG] %s : thread %x in process %x exit for %s / cost %d / cycle %d\n",
    227 __FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ),
    228 (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );
     230if( DEBUG_SYS_MUTEX < tm_end )
     231printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n",
     232__FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), (uint32_t)tm_end );
     233#endif
     234
     235#if CONFIG_INSTRUMENTATION_SYSCALLS
     236hal_atomic_add( &syscalls_cumul_cost[SYS_MUTEX] , tm_end - tm_start );
     237hal_atomic_add( &syscalls_occurences[SYS_MUTEX] , 1 );
    229238#endif
    230239
Note: See TracChangeset for help on using the changeset viewer.