From: Eric Barton <eric@bartonsoftware.com>
To: linux-kernel@vger.kernel.org
Subject: kiobuf setup overhead
Date: 9 May 2001 10:08:55 +0100 [thread overview]
Message-ID: <08c845508090951PCOW029M@blueyonder.co.uk> (raw)
I've noticed that alloc_kiovec() calls alloc_kiobuf_bhs(), which...
> int alloc_kiobuf_bhs(struct kiobuf * kiobuf)
> {
> int i;
>
> for (i = 0; i < KIO_MAX_SECTORS; i++)
> if (!(kiobuf->bh[i] = kmem_cache_alloc(bh_cachep, SLAB_KERNEL))) {
> while (i--) {
> kmem_cache_free(bh_cachep, kiobuf->bh[i]);
> kiobuf->bh[i] = NULL;
> }
> return -ENOMEM;
> }
> return 0;
> }
...where KIO_MAX_SECTORS is currently 1024. This makes a kiobuf quite a
heavy-weight object to allocate and free.
Was this high-overhead initialisation left in because kiobufs shouldn't be
allocated and freed at the drop of a hat in any case?
If not, allocating the kiobuf->bh[i], could be delayed until the number
required is known.
This would be beneficial for direct I/O in the scsi generic driver, which
currently allocates and frees a kiobuf on each read/write.
--
Cheers,
Eric
reply other threads:[~2001-05-09 9:07 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=08c845508090951PCOW029M@blueyonder.co.uk \
--to=eric@bartonsoftware.com \
--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