From: Jens Axboe <jens.axboe@oracle.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>,
SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: memory allocation in sg_io()
Date: Thu, 10 Jan 2008 14:24:01 +0100 [thread overview]
Message-ID: <20080110132401.GB6258@kernel.dk> (raw)
In-Reply-To: <200801101419.09651.oliver@neukum.org>
On Thu, Jan 10 2008, Oliver Neukum wrote:
> Am Donnerstag, 10. Januar 2008 14:05:25 schrieb Boaz Harrosh:
> > On Thu, Jan 10 2008 at 14:33 +0200, Oliver Neukum <oliver@neukum.org> wrote:
> > > Hi,
> > >
> > > could you explain to me why this code can get away with allocating the
> > > sense buffer on the stack?
> > >
> > > static int sg_io(struct file *file, struct request_queue *q,
> > > struct gendisk *bd_disk, struct sg_io_hdr *hdr)
> > > {
> > > unsigned long start_time;
> > > int writing = 0, ret = 0, has_write_perm = 0;
> > > struct request *rq;
> > > char sense[SCSI_SENSE_BUFFERSIZE];
> > >
> > > Regards
> > > Oliver
> > > -
> > where? what? do you mean in scsi_ioctl.c?
> > why not it's a synchronous call?
> > Do you mean 96 bytes is too big?
> > Do you mean DMA alignment and cache coherency? I'm working
> > on that for scsi devices.
>
> Yes, you are doing DMA on the stack.
There are many offenders like that, just take a peek in cdrom.c for
instance.
--
Jens Axboe
next prev parent reply other threads:[~2008-01-10 13:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 12:33 memory allocation in sg_io() Oliver Neukum
2008-01-10 13:05 ` Boaz Harrosh
2008-01-10 13:06 ` Jens Axboe
2008-01-10 13:14 ` Boaz Harrosh
2008-01-10 13:19 ` Oliver Neukum
2008-01-10 13:24 ` Jens Axboe [this message]
2008-01-10 13:30 ` Matthew Wilcox
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=20080110132401.GB6258@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=bharrosh@panasas.com \
--cc=linux-scsi@vger.kernel.org \
--cc=oliver@neukum.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