From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: hugh@veritas.com
Cc: fujita.tomonori@lab.ntt.co.jp,
James.Bottomley@HansenPartnership.com,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
jens.axboe@oracle.com, clameter@sgi.com, penberg@cs.helsinki.fi,
a.p.zijlstra@chello.nl, rjw@sisk.pl,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: fix sense_slab/bio swapping livelock
Date: Tue, 8 Apr 2008 23:04:55 +0900 [thread overview]
Message-ID: <20080408230354U.tomof@acm.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0804071851230.14273@blonde.site>
On Mon, 7 Apr 2008 19:07:56 +0100 (BST)
Hugh Dickins <hugh@veritas.com> wrote:
> On Mon, 7 Apr 2008, FUJITA Tomonori wrote:
> > On Sun, 6 Apr 2008 23:56:57 +0100 (BST)
> > Hugh Dickins <hugh@veritas.com> wrote:
> >
> > Really sorry about the bug.
>
> No, it's brought attention to this interesting slab merge issue;
> even if in the end we decide that's a non-issue.
Yeah, seems that it led to an interesting discussion (using cache
behavior like ephemeral sounds useful, I think) though surely this is
a bug.
> > > Another alternative is to revert the separate sense_slab, using
> > > cache-line-aligned sense_buffer allocated beyond scsi_cmnd from
> > > the one kmem_cache; but that might waste more memory, and is
> > > only a way of diverting around the known problem.
> >
> > Reverting the separate sense_slab is fine for now but we need the
> > separation shortly anyway. We need to support larger sense buffer (260
> > bytes). The current 96 byte sense buffer works for the majority of us,
> > so we doesn't want to embed 260 byte sense buffer in scsi_cmnd struct.
>
> I don't believe you _need_ a separate sense_slab even for that:
> what I meant was that you just need something like
> pool->cmd_slab = kmem_cache_create(pool->cmd_name,
> cache_line_align(
> sizeof(struct scsi_cmnd)) +
> max_scsi_sense_buffersize,
> 0, pool->slab_flags, NULL);
> then point cmd->sense_buffer to (unsigned char *) cmd +
> cache_line_align(sizeof(struct scsi_cmnd));
> where cache_line_align and max_scsi_sense_buffersize are preferably
> determined at runtime.
Yes, if we have only 96 and 260 bytes sense buffers, it would be a
solution. Well, evne if we have various length sense buffers, we can
have a pool per driver (or device, scsi_host, etc).
Another reason why we separated them is that we could allocate a sense
buffer only when it's necessary (though I'm not sure we will do it
actually).
> Now, it may well be that over the different configurations, at least
> some would waste significant memory by putting it all in the one big
> buffer, and you're better off with the separate slabs: so I didn't
> want to interfere with your direction on that.
Yes, this was about wasting memory (with the one big buffer)
vs. overheads due to allocating two buffers. After some performance
tests, we chose the latter but we might change this again in the
future.
next prev parent reply other threads:[~2008-04-08 14:06 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-06 22:56 [PATCH] scsi: fix sense_slab/bio swapping livelock Hugh Dickins
2008-04-06 23:35 ` James Bottomley
2008-04-07 1:01 ` Hugh Dickins
2008-04-07 17:51 ` Hugh Dickins
2008-04-07 18:04 ` James Bottomley
2008-04-07 18:26 ` Hugh Dickins
2008-04-07 2:48 ` FUJITA Tomonori
2008-04-07 18:07 ` Hugh Dickins
2008-04-08 14:04 ` FUJITA Tomonori [this message]
2008-04-07 5:26 ` Christoph Lameter
2008-04-07 19:40 ` Hugh Dickins
2008-04-07 19:55 ` Peter Zijlstra
2008-04-07 20:31 ` Hugh Dickins
2008-04-07 20:47 ` Peter Zijlstra
2008-04-07 21:00 ` Pekka Enberg
2008-04-07 21:05 ` Pekka Enberg
2008-04-07 21:15 ` Linus Torvalds
2008-04-07 21:34 ` Pekka Enberg
2008-04-07 21:39 ` Pekka Enberg
2008-04-07 22:05 ` Pekka J Enberg
2008-04-07 22:17 ` Linus Torvalds
2008-04-07 22:42 ` Pekka Enberg
2008-04-08 20:42 ` Pekka J Enberg
2008-04-08 20:44 ` Pekka Enberg
2008-04-08 20:45 ` Christoph Lameter
2008-04-08 21:11 ` Pekka Enberg
2008-04-08 21:40 ` Peter Zijlstra
2008-04-07 21:30 ` Hugh Dickins
2008-04-07 21:36 ` Pekka Enberg
2008-04-08 20:43 ` Christoph Lameter
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=20080408230354U.tomof@acm.org \
--to=fujita.tomonori@lab.ntt.co.jp \
--cc=James.Bottomley@HansenPartnership.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=hugh@veritas.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.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