LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Andrew Bird <ajb@spheresystems.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Spinlock debugging
Date: Tue, 12 Sep 2006 14:43:48 +0100	[thread overview]
Message-ID: <1158068628.6780.9.camel@localhost.localdomain> (raw)
In-Reply-To: <200609120847.39655.ajb@spheresystems.co.uk>

Ar Maw, 2006-09-12 am 08:47 +0100, ysgrifennodd Andrew Bird:
> Alan
> 	thanks that did the trick. 
> One further question, on the later kernels 2.6.17+, I don't have low_latency 
> set. Can I still guarantee that after calling tty_flip_buffer_push() I have 
> made space in the tty for my buffer? For example, is this legal? 

It makes no guarantee in any kernel.

In the new tty case however tty_buffer_request_room() will only fail if
you have 64K queued or the box is completely out of atomic memory and
also doing stuff like dropping network packets and console keystrokes.

So all you need in your IRQ handler is

	if (tty_insert_flip_string(tty, buf, size))
		tty_flip_buffer_push(tty);

the rest will occur automatically. Hinting with tty_buffer_request_room
may improve performance for some workloads (notably virtualized uarts)
or when using DMA but otherwise the above should be fine.

Most existing drivers were a straight conversion so at the moment try
too hard.



  reply	other threads:[~2006-09-12 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-11 15:32 Andrew Bird (Sphere Systems)
2006-09-11 16:36 ` Alan Cox
2006-09-11 16:38   ` Andrew Bird
2006-09-11 17:24     ` Alan Cox
2006-09-12  7:47       ` Andrew Bird
2006-09-12 13:43         ` Alan Cox [this message]
2006-09-12 13:31           ` Sergei Organov
2006-09-12 14:04             ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1158068628.6780.9.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=ajb@spheresystems.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Spinlock debugging' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).