mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: akpm@osdl.org, mingo@elte.hu, laurent.riffard@free.fr,
	barryn@pobox.com, 76306.1226@compuserve.com,
	linux-kernel@vger.kernel.org, jbeulich@novell.com,
	arjan@linux.intel.com
Subject: Re: [PATCH] ide-cd: use blk_get_request()
Date: Thu, 8 Jun 2006 08:30:00 +0200	[thread overview]
Message-ID: <20060608063000.GG5207@suse.de> (raw)
In-Reply-To: <20060607202223.3478c8ad.rdunlap@xenotime.net>

On Wed, Jun 07 2006, Randy.Dunlap wrote:
> On Wed, 7 Jun 2006 08:22:08 +0200 Jens Axboe wrote:
> 
> > On Tue, Jun 06 2006, Andrew Morton wrote:
> > > 
> > > Note that Laurent is also passing through ide_cdrom_packet(), which has a
> > > `struct request' on the stack.  The kernel does this in a lot of places,
> > > and at 168 bytes on x86, it'd really be best if we were to dynamically
> > > allocate these things.
> > 
> > That's an old peeve of mine, on-stack requests... It's nasty from
> > several angles, stack usage just being one of them. Perhaps I'll give it
> > a go for 2.6.18 and add checks for request being thrown at the block
> > layer which didn't originate from get_request().
> 
> This is a start at converting ide-cd.c to use blk_get_request().
> How does it look so far?
> It builds, but I have not tested it yet.
> And of course, there are other drivers to be modified as well.
> 
> ---
> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> Convert struct request req; on function stacks to
> use allocation via blk_get_request() to
> (a) reduce stack pressure and
> (b) use centralized blk_ functions and
> (c) allow for block IO tracing.
> 
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> ---
>  drivers/ide/ide-cd.c |  258 +++++++++++++++++++++++++++++++++------------------
>  1 files changed, 170 insertions(+), 88 deletions(-)
> 
> --- linux-2617-rc6.orig/drivers/ide/ide-cd.c
> +++ linux-2617-rc6/drivers/ide/ide-cd.c
> @@ -2033,24 +2033,32 @@ int msf_to_lba (byte m, byte s, byte f)
>  
>  static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense)
>  {
> -	struct request req;
> +	struct request *req;
>  	struct cdrom_info *info = drive->driver_data;
>  	struct cdrom_device_info *cdi = &info->devinfo;
> +	request_queue_t *q = cdi->disk->queue;
> +	int stat;
>  
> -	cdrom_prepare_request(drive, &req);
> -
> -	req.sense = sense;
> -	req.cmd[0] = GPCMD_TEST_UNIT_READY;
> -	req.flags |= REQ_QUIET;
> +	req = blk_get_request(q, READ, GFP_KERNEL);
> +	if (!req)
> +		return -ENOMEM;
> +
> +	cdrom_prepare_request(drive, req);

This cannot work, have you seen what cdrom_prepare_request() does?

-- 
Jens Axboe


  reply	other threads:[~2006-06-08  6:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05  0:59 2.6.17-rc5-mm1 Chuck Ebbert
2006-06-05  1:10 ` 2.6.17-rc5-mm1 Andrew Morton
2006-06-05 10:32   ` 2.6.17-rc5-mm1 Laurent Riffard
2006-06-05 16:14     ` 2.6.17-rc5-mm1 Laurent Riffard
2006-06-05 18:00       ` 2.6.17-rc5-mm1 Andrew Morton
2006-06-05 18:18         ` 2.6.17-rc5-mm1 Dave Jones
2006-06-05 21:52         ` 2.6.17-rc5-mm1 Barry K. Nathan
2006-06-06  7:26           ` 2.6.17-rc5-mm1 Ingo Molnar
2006-06-06 20:08             ` 2.6.17-rc5-mm1 Laurent Riffard
2006-06-06 20:58               ` 2.6.17-rc5-mm1 Ingo Molnar
2006-06-06 21:38                 ` 2.6.17-rc5-mm1 Laurent Riffard
2006-06-06 22:05                   ` 2.6.17-rc5-mm1 Ingo Molnar
2006-06-06 22:29                     ` 2.6.17-rc5-mm1 Andrew Morton
2006-06-07  6:22                       ` 2.6.17-rc5-mm1 Jens Axboe
2006-06-08  3:22                         ` [PATCH] ide-cd: use blk_get_request() Randy.Dunlap
2006-06-08  6:30                           ` Jens Axboe [this message]
2006-06-08 15:01                             ` Randy.Dunlap
2006-06-08 19:00                         ` 2.6.17-rc5-mm1 Laurent Riffard

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=20060608063000.GG5207@suse.de \
    --to=axboe@suse.de \
    --cc=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=arjan@linux.intel.com \
    --cc=barryn@pobox.com \
    --cc=jbeulich@novell.com \
    --cc=laurent.riffard@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rdunlap@xenotime.net \
    /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

Powered by JetHome