In the sercomm_cons layer, ee used to enqueue a msgb for sending
every time there is an end-of-line. However, if we send a number
of very short lines, we easily run out of msgbs.
Now we check how much msgb backlog there is in the transmit queue,
and decide to skip the end-of-line flushing if needed.
This still doesn't solve all our problems, but its still a useful
mechanism.
{
unsigned int i;
for (i = 0; i < write_num; i++) {
- /* flush buffer at end of line */
- if (*s == '\n')
+ /* flush buffer at end of line, but skip
+ * flushing if we have a backlog in order to
+ * increase efficiency of msgb filling */
+ if (*s == '\n' &&
+ sercomm_tx_queue_depth(SC_DLCI_CONSOLE) < 4)
flush = 1;
*data++ = *s++;
}