From: Jens Axboe <axboe@suse.de>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/10] seperate max sectors and max hw sectors
Date: Tue, 8 Nov 2005 18:57:07 +0100 [thread overview]
Message-ID: <20051108175707.GL3699@suse.de> (raw)
In-Reply-To: <4370E5ED.60901@cs.wisc.edu>
On Tue, Nov 08 2005, Mike Christie wrote:
> Jens Axboe wrote:
> >On Tue, Nov 08 2005, Mike Christie wrote:
> >
> >>Seperate max_hw_sectors and max_sectors.
> >>
> >>LLDs call blk_queue_max_hw_sectors() to set max_hw_sectors.
> >>blk_queue_max_sectors will also set max_sectors to a safe
> >>default value.
> >>
> >>blk_init_queue still calls blk_queue_max_sectors so if there
> >>are any LLDs that do not call blk_queue_max_hw_sectors() and
> >>were expecting both the max_sectors and max_hw_sectors to be
> >>255 they do not have to do anything.
> >>
> >>I was not able to test every driver I touched, but I think the
> >>only place I may have messed up is MD so some testing is needed.
> >
> >
> >->max_sectors will become less of a driver property and more of a
> >block/vm propery, so I think the best way to do this is just to have
> >blk_queue_max_sectors() set ->max_hw_sectors directly and lower
> >->max_sectors appropriately if it is lower. That also comes with the
> >bonus of not having to modify drivers.
> >
>
> Ugggh. I did this in reverse to make the naming nicer. So I added a
> blk_queue_max_hw_sectors() which sets ->max_sectors to some Block layer
> default and ->max_hw_sectors to the hw limit (for SCSI this is the scsi
> host template ->max_sectors). Is this ok? It is more clear for driver
> writers that they are setting max_hw_sectors when calling
> blk_queue_max_hw_sectors(). I also converted all the
> blk_queue_max_sectors() to blk_queue_max_hw_sectors().
Driver writers need not know. They call blk_queue_max_sectors() to set
the maximum value of a request they can handle, they could not care less
what internal field in the queue is actually used for that. From their
perspective, blk_queue_max_sectors() defines their hard limit. We may
(and will) adjust the soft limit behind their back - which is ok, as
long as we honor the value they defined by calling
blk_queue_max_sectors().
--
Jens Axboe
next prev parent reply other threads:[~2005-11-08 17:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-08 10:06 [PATCH 2/10] seperate max sectors and max hw sectors Mike Christie
2005-11-08 17:47 ` Jens Axboe
2005-11-08 17:52 ` Mike Christie
2005-11-08 17:57 ` Jens Axboe [this message]
2005-11-08 18:17 ` Mike Christie
2005-11-08 18:33 ` Mike Christie
2005-11-08 17:47 ` Stefan Richter
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=20051108175707.GL3699@suse.de \
--to=axboe@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.