we have an application that MUST send an udp packet every 10ms. so we use a realtime kernel patch and a high prio thread. all well until someone tries to login using either ssh (on a different network adapter) or even the local console. then we experience hick-ups. reason is the sendto() call blocking for more than 10 ms.
does anyone have a clue what can be going on during login? or even entering a user name. or logging out. I'm confused :(
// send messages
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
while(true)
{ // send message - this call may block for more than 10ms
int bytes_sent = sendto(socket_fd, buffer, buffer_size, 0, (struct sockaddr*)&destination, sizeof(destination));
// sleep until next message must be sent
t.tv_nsec += INTERVAL; // 10 ms
while (t.tv_nsec >= NSEC_PER_SEC)
{
t.tv_nsec -= NSEC_PER_SEC;
t.tv_sec++;
}
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &t, NULL);
}
it seems selinux was my foe ... now it's switched off my application is no longer bothered by logins. even a SCHED_FIFO thread at prio 99 was affected (same calculations took more time without getting nonvoluntary context switches) while it selinux was still on ...