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_barrier.c

    r624 r625  
    22 * sys_barrier.c - Access a POSIX barrier.
    33 *
    4  * authors       Alain Greiner (2016,2017,2018)
     4 * authors       Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    2525#include <hal_special.h>
    2626#include <hal_uspace.h>
     27#include <hal_vmm.h>
    2728#include <errno.h>
    2829#include <thread.h>
     
    5657    process_t * process = this->process;
    5758
     59#if (DEBUG_SYS_BARRIER || CONFIG_INSTRUMENTATION_SYSCALLS)
     60uint64_t     tm_start = hal_get_cycles();
     61#endif
     62
    5863#if DEBUG_SYS_BARRIER
    59 uint64_t   tm_start;
    60 uint64_t   tm_end;
    61 tm_start = hal_get_cycles();
    6264if( DEBUG_SYS_BARRIER < tm_start )
    6365printk("\n[%s] thread[%x,%x] enters for %s / count %d / cycle %d\n",
     
    184186        }  // end switch
    185187
     188    hal_fence();
     189
     190#if (DEBUG_SYS_BARRIER || CONFIG_INSTRUMENTATION_SYSCALLS)
     191uint64_t     tm_end = hal_get_cycles();
     192#endif
     193
    186194#if DEBUG_SYS_BARRIER
    187 tm_end = hal_get_cycles();
    188195if( DEBUG_SYS_BARRIER < tm_end )
    189 printk("\n[%s] thread[%x,%x] exit for %s / cost %d / cycle %d\n",
    190 __FUNCTION__, process->pid, this->trdid, sys_barrier_op_str(operation),
    191 (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );
     196printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n",
     197__FUNCTION__, process->pid, this->trdid, sys_barrier_op_str(operation), (uint32_t)tm_end );
     198#endif
     199
     200#if CONFIG_INSTRUMENTATION_SYSCALLS
     201hal_atomic_add( &syscalls_cumul_cost[SYS_BARRIER] , tm_end - tm_start );
     202hal_atomic_add( &syscalls_occurences[SYS_BARRIER] , 1 );
    192203#endif
    193204
Note: See TracChangeset for help on using the changeset viewer.