<feed xmlns='http://www.w3.org/2005/Atom'>
<title>accel-ppp.git/accel-pppd/triton, branch 1.12</title>
<subtitle>High performance PPTP/L2TP/SSTP/PPPoE/IPoE server for Linux (mirror of https://github.com/accel-ppp/accel-ppp.git)
</subtitle>
<id>https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=1.12</id>
<link rel='self' href='https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=1.12'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/'/>
<updated>2018-11-03T06:00:11+00:00</updated>
<entry>
<title>triton: fix context schedule/wakeup race</title>
<updated>2018-11-03T06:00:11+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-10-22T10:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=c709a12656b64f33cd553b7d01842381d8fdce7a'/>
<id>urn:sha1:c709a12656b64f33cd553b7d01842381d8fdce7a</id>
<content type='text'>
Allow triton_context_wakeup() to run before triton_context_schedule().
When that happens, triton_context_schedule() now lets the context
running instead of putting it in sleep mode.

Note that, even though triton now allows triton_context_wakeup() to
happen before triton_context_schedule(), these two functions still need
to be paired and not nested. That is, in a sequence like the following,

triton_context_wakeup()
triton_context_wakeup()
triton_context_schedule()
triton_context_schedule()

the second triton_context_schedule() would put the context in sleep
mode. No matter how many triton_context_wakeup() have been called, the
first triton_context_schedule() "consumes" them all.

Being immune to schedule/wakeup inversion allows to fix the pppd_compat
module. This module needs to fork() to execute external programs. The
parent then waits for completion of its child using
triton_context_schedule(). When child terminates, the sigchld module
runs a callback that has to call triton_context_wakeup() to resume
execution of the parent.

The problem is that there is no synchronisation between the parent and
its child. When under stress, the child may execute faster than its
parent and the sigchld callback might run triton_context_wakeup()
before the parent had time to call triton_context_schedule().

Then accel-ppp might crash because the triton thread might have reset
ctx-&gt;thread to NULL, making triton_context_wakeup() write to invalid
memory when trying to insert the context in ctx-&gt;thread-&gt;wakeup_list[].

Synchronising the parent and its child completion's callback would
require cooperation from triton_context_schedule(). Otherwise we would
still have a time frame between the moment we let the callback waking
up the context and the moment we put the context in sleep mode.
Allowing schedule/wakeup call inversion in triton looks simpler since
it avoids modifying the current API.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>triton: make mempool.h self-contained even when MEMDEBUG is defined</title>
<updated>2018-10-26T03:34:34+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-10-24T14:36:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=e2014029851b6f720b2d55be3d1680c0e72e4641'/>
<id>urn:sha1:e2014029851b6f720b2d55be3d1680c0e72e4641</id>
<content type='text'>
If MEMDEBUG is defined, then we need to include "memdebug.h" to define
'md_free'.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>triton: fixed improper locking</title>
<updated>2018-05-28T14:18:04+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2018-05-28T14:18:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=03d9f8c59b6375325d7dfef0313c8c54705cfe0b'/>
<id>urn:sha1:03d9f8c59b6375325d7dfef0313c8c54705cfe0b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>triton: prevent alloc_context function to be inlined (fixes improper stack size calculation)</title>
<updated>2018-03-06T09:11:37+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2018-03-06T09:11:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=1e5079d215643295cba69ce9d0999bf3c5f5df38'/>
<id>urn:sha1:1e5079d215643295cba69ce9d0999bf3c5f5df38</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix build error with VALGRIND defined</title>
<updated>2018-03-03T21:42:02+00:00</updated>
<author>
<name>Vladislav Grishenko</name>
<email>themiron@mail.ru</email>
</author>
<published>2018-03-03T21:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=ca152efa0c0b1a3a2cecfcdc0a72959e670b9f45'/>
<id>urn:sha1:ca152efa0c0b1a3a2cecfcdc0a72959e670b9f45</id>
<content type='text'>
</content>
</entry>
<entry>
<title>triton: more general fix of thread wake up crash</title>
<updated>2018-03-02T14:43:38+00:00</updated>
<author>
<name>Vladislav Grishenko</name>
<email>themiron@mail.ru</email>
</author>
<published>2018-03-02T14:43:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=64f65c44772176292de943176843abed7d61202f'/>
<id>urn:sha1:64f65c44772176292de943176843abed7d61202f</id>
<content type='text'>
after commit 287adbfc205c02eac375f55fb94f13c073faec97 gcc
still may reorder alloca() and memset() calls.
fix that with volatile access &amp; memory barrier.
</content>
</entry>
<entry>
<title>triton: fix crash due gcc mis-optimization of alloca()</title>
<updated>2017-12-27T21:27:07+00:00</updated>
<author>
<name>Vladislav Grishenko</name>
<email>themiron@mail.ru</email>
</author>
<published>2017-12-27T21:27:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=287adbfc205c02eac375f55fb94f13c073faec97'/>
<id>urn:sha1:287adbfc205c02eac375f55fb94f13c073faec97</id>
<content type='text'>
 since alloca() result is used indirectly, gcc 4.7.2 thinks
 the whole call can be dropped on any optimization level.
</content>
</entry>
<entry>
<title>triton: fixed bugs introduced by previous commit</title>
<updated>2017-12-27T08:43:09+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2017-12-27T08:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=4c746c721ed4fadc15964b725707faf753843a9d'/>
<id>urn:sha1:4c746c721ed4fadc15964b725707faf753843a9d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>reworked context priorities</title>
<updated>2017-12-26T17:46:06+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2017-12-26T17:46:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=c767ca5d3c09d8f64dbfa05e86fde1fd5d702083'/>
<id>urn:sha1:c767ca5d3c09d8f64dbfa05e86fde1fd5d702083</id>
<content type='text'>
Introduced 4 priorities:
0 - management (cli)
1 - starting sessions (default priority)
2 - active sessions
3 - finishing sessions
</content>
</entry>
<entry>
<title>triton: rewrited context sleeping implementation</title>
<updated>2017-10-12T15:47:12+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2017-10-12T14:09:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=ae48a9d61cafaee49fd1936e83e0e919dec5fa2d'/>
<id>urn:sha1:ae48a9d61cafaee49fd1936e83e0e919dec5fa2d</id>
<content type='text'>
Instead of entering working thread into sleep triton saves machine context and stack on sleep and restores context/stack on wakeup.
This saves costly new thread allocation.
</content>
</entry>
</feed>
