From: Nick.Holloway@pyrites.org.uk (Nick Holloway)
To: linux-kernel@vger.kernel.org
Subject: Avoid large reads using parport_read() ?
Date: 30 Dec 2002 10:32:01 -0000 [thread overview]
Message-ID: <aup7b1$i50$1@alfie.demon.co.uk> (raw)
I've been involved with the cpia_pp driver (parallel port Webcam), and
found that X becomes very sluggish when capturing a stream of images.
I suspect that this is due to reading the whole of each frame using
parport_read(), which could be up to 200K.
In the 2.0 kernel days (pre-parport layer), the cpia_pp driver would do
its own parallel port banging, and would actually only read 16 bytes
(fifo size) at a time before checking if it needed to reschedule.
Now it fetches the whole image using a single call to parport_read().
I did a quick check, and instead of issuing one parport_read for the whole
image, I looped round issuing reads of 4096 bytes. The responsiveness
of the machine was much improved.
Is there any problem with looping calls to parport_read() with a smaller
buffer size, and performing cond_resched() each time through the loop?
What size of buffer should I use?
--
`O O' | Nick.Holloway@pyrites.org.uk
// ^ \\ | http://www.pyrites.org.uk/
reply other threads:[~2002-12-30 10:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='aup7b1$i50$1@alfie.demon.co.uk' \
--to=nick.holloway@pyrites.org.uk \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®