Re: [PATCH 1/2] Implement basic sleeping locks for gnumach v2

2017-03-04 Thread Samuel Thibault
Applied, thanks! Samuel

[PATCH 1/2] Implement basic sleeping locks for gnumach v2

2017-02-01 Thread Agustina Arzille
--- Makefrag.am | 3 +++ kern/atomic.h | 54 +++ kern/kmutex.c | 76 +++ kern/kmutex.h | 52 + kern/sched_prim.c | 5 +++- kern/sched_prim.h | 2 +- 6 fi

Re: [PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-29 Thread Agustina Arzille
On 2017-01-29 21:34, Samuel Thibault wrote: Agustina Arzille, on Sun 29 Jan 2017 21:11:12 -0300, wrote: On 2017-01-29 17:44, Samuel Thibault wrote: >Agustina Arzille, on Sun 29 Jan 2017 16:46:45 -0300, wrote: > >There is just one thing I'm a bit afraid of: the code is assuming that >the only rea

Re: [PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-29 Thread Samuel Thibault
Agustina Arzille, on Sun 29 Jan 2017 21:11:12 -0300, wrote: > On 2017-01-29 17:44, Samuel Thibault wrote: > >Agustina Arzille, on Sun 29 Jan 2017 16:46:45 -0300, wrote: > > > >There is just one thing I'm a bit afraid of: the code is assuming that > >the only reason why the locker thread is awakened

Re: [PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-29 Thread Agustina Arzille
On 2017-01-29 17:44, Samuel Thibault wrote: Agustina Arzille, on Sun 29 Jan 2017 16:46:45 -0300, wrote: There is just one thing I'm a bit afraid of: the code is assuming that the only reason why the locker thread is awakened is that it was given the mutex control. Is that guaranteed? Well, th

Re: [PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-29 Thread Samuel Thibault
Agustina Arzille, on Sun 29 Jan 2017 16:46:45 -0300, wrote: > >T1 atomic_cas(), gets the mutex > >T2 fails atomic_cas() > >T2 simple_lock() > >T1 atomic_cas() to release the mutex > >T2 reads KMUTEX_AVAIL in locked_swap > >T3 atomic_cas(), gets the mutex > >T2 writes KMUTEX_CONTENDED, gets KMUTEX_A

Re: [PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-29 Thread Agustina Arzille
On 2017-01-28 21:03, Samuel Thibault wrote: Hello, Agustina Arzille, on Thu 19 Jan 2017 10:00:32 -0500, wrote: +/* Atomically compare *PTR with EXP and set it to NVAL if they're equal. + * Evaluates to a boolean, indicating whether the comparison was successful.*/ +#define atomic_cas(ptr, exp

Re: [PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-28 Thread Samuel Thibault
Hello, Agustina Arzille, on Thu 19 Jan 2017 10:00:32 -0500, wrote: > +/* Atomically compare *PTR with EXP and set it to NVAL if they're equal. > + * Evaluates to a boolean, indicating whether the comparison was > successful.*/ > +#define atomic_cas(ptr, exp, nval) \ > + ({ \ > + typeof(e

[PATCH 1/2] Implement basic sleeping locks for gnumach.

2017-01-19 Thread Agustina Arzille
--- Makefrag.am | 3 +++ kern/atomic.h | 40 kern/kmutex.c | 79 +++ kern/kmutex.h | 50 +++ kern/sched_prim.c | 5 +++- kern/sched_prim.h | 2 +- 6 files changed,