From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ilya Zykov <ilya@ilyx.ru>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Alan Cox <alan@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] TTY: tty flip buffer change reserve memory strategy.
Date: Tue, 25 Oct 2011 08:45:43 +0100 [thread overview]
Message-ID: <20111025084543.09432276@pyx> (raw)
In-Reply-To: <4EA48474.4010101@ilyx.ru>
> free(kfree()) every chunk more 256 bytes every time,
> even we have in free buffer enough space, because we can't
> pass through chunk boundary in free buffer. Also we can't limit reserve
> memory size. In worse case we will have in free buffer:
> (256 * 256 byte chunk) = (256 * 552 ) = 141312 byte unused memory.
The idea is to trade off between the devices that need long linear blocks
(mostly for DMA) and devices that don't care - but many of which pass 1
or 2 bytes/irq so want a common buffer.
Most drivers should not be using tty_reserve_room in the first place.
> Also we can limit reserve memory size, but then,
> we will be use kmalloc()-kree() calls on intensive stream from the driver.
kmalloc is very fast anyway so I'd be interested in seeing the drivers
suffering and the profile traces of a real example.
I'm also not sure I agree with the maths - we chunk buffers to 256 byte
boundaries to avoid getting lots of queued buffers of different sizes. We
could in fact I think simplify the code from what we have learned using
it and simply treat the 256 byte buffer case as special rather than 256
and 512 as we do now. That would let us remove the more generic support
for free buffer sizes which is overcomplex and mean we could simply count
the number of 256 byte buffers we have to hand.
Alan
next prev parent reply other threads:[~2011-10-25 7:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-23 21:17 [PATCH] TTY: tty flip buffer change reserve memory strategy Ilya Zykov
2011-10-25 7:45 ` Alan Cox [this message]
2011-10-25 11:22 ` Ilya Zykov
2011-11-01 11:41 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2011-10-23 19:04 Ilya Zykov
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=20111025084543.09432276@pyx \
--to=alan@lxorguk.ukuu.org.uk \
--cc=alan@linux.intel.com \
--cc=gregkh@suse.de \
--cc=ilya@ilyx.ru \
--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