* use_clustering (sht) bit set to 0 in AHCI ?
@ 2007-04-26 5:49 Alok kataria
2007-05-21 12:17 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Alok kataria @ 2007-04-26 5:49 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide
Hi Jeff,
I recently got a new AHCI disk, and was using the AHCI-libata driver to run
this. I noticed that the scattergather lists that were being built for
the I/O on this device were just of PAGE_SIZE length, even though i
was doing IO on
contiguous pages.
Through a little instrumentation i figured out that the use_clustering
bit in the ahci_sht (scsi_host_template) is set to zero. Due to which
we are not putting consecutive bios into one sg in blk_rq_map_sg.
I tried changing the clustering bit to 1, but encountered a panic at
the initialization of the disks during the bootup process, and so
couldn't entirely get hold of the panic mesg.
I was wondering, though the max segment size suported with this driver
is 65536, why was i not able to feed in bigger SG's to this driver.
I searched on the net and the intel ahci arch doc too but couldn't
find anything relative to the clustering support for AHCI.
It would be great help if you could let me know about the possible
problems with clustering on AHCI ? why is it off by default in the
driver ? or anything else that might help.
Thanks & Regards,
Alok Kataria.
Principal Dev. Engg.
Calsoft Pvt. Ltd.
Pune, India.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: use_clustering (sht) bit set to 0 in AHCI ?
2007-04-26 5:49 use_clustering (sht) bit set to 0 in AHCI ? Alok kataria
@ 2007-05-21 12:17 ` Jens Axboe
2007-05-21 21:17 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2007-05-21 12:17 UTC (permalink / raw)
To: Alok kataria; +Cc: Jeff Garzik, linux-ide
On Thu, Apr 26 2007, Alok kataria wrote:
> Hi Jeff,
>
> I recently got a new AHCI disk, and was using the AHCI-libata driver to run
> this. I noticed that the scattergather lists that were being built for
> the I/O on this device were just of PAGE_SIZE length, even though i
> was doing IO on
> contiguous pages.
>
> Through a little instrumentation i figured out that the use_clustering
> bit in the ahci_sht (scsi_host_template) is set to zero. Due to which
> we are not putting consecutive bios into one sg in blk_rq_map_sg.
>
> I tried changing the clustering bit to 1, but encountered a panic at
> the initialization of the disks during the bootup process, and so
> couldn't entirely get hold of the panic mesg.
> I was wondering, though the max segment size suported with this driver
> is 65536, why was i not able to feed in bigger SG's to this driver.
>
> I searched on the net and the intel ahci arch doc too but couldn't
> find anything relative to the clustering support for AHCI.
>
> It would be great help if you could let me know about the possible
> problems with clustering on AHCI ? why is it off by default in the
> driver ? or anything else that might help.
It's a good question. If you look at the documentation, it states that
ahci supports up to 64k sg entries and each can have a size of up to 4mb
(bits 0 through 21). So as far as I can tell, clustering should work
with a segment size up to those 4mb.
ahci has always had clustering disabled, perhaps Jeff can expand on why?
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: use_clustering (sht) bit set to 0 in AHCI ?
2007-05-21 12:17 ` Jens Axboe
@ 2007-05-21 21:17 ` Jeff Garzik
2007-05-22 7:45 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2007-05-21 21:17 UTC (permalink / raw)
To: Jens Axboe; +Cc: Alok kataria, linux-ide
Jens Axboe wrote:
> ahci has always had clustering disabled, perhaps Jeff can expand on why?
Just historical reasons. libata had clustering disabled by default in
the beginning, for all drivers. Then we enabled it globally by changing
the value of ATA_SHT_USE_CLUSTERING... but apparently forgot to change
drivers which use their own value rather than ATA_SHT_USE_CLUSTERING.
Feel free to submit a patch turning it on...
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: use_clustering (sht) bit set to 0 in AHCI ?
2007-05-21 21:17 ` Jeff Garzik
@ 2007-05-22 7:45 ` Jens Axboe
2007-05-25 3:06 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2007-05-22 7:45 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Alok kataria, linux-ide
On Mon, May 21 2007, Jeff Garzik wrote:
> Jens Axboe wrote:
> >ahci has always had clustering disabled, perhaps Jeff can expand on why?
>
>
> Just historical reasons. libata had clustering disabled by default in
> the beginning, for all drivers. Then we enabled it globally by changing
> the value of ATA_SHT_USE_CLUSTERING... but apparently forgot to change
> drivers which use their own value rather than ATA_SHT_USE_CLUSTERING.
>
> Feel free to submit a patch turning it on...
The below works for me, but it's only lightly tested. I booted it up and
ran some large IO tests, I've verified really large IO sizes as well
(using blktrace, I've verified ios up to 9216KiB being accepted and
completed by the drive).
-----
From: Jens Axboe <jens.axboe@oracle.com>
ahci: enable sg segment clustering
The specification states that ahci supports segments up to 4MiB in size,
so enable clustering.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e00e1b9..bfcd8ec 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -54,7 +54,7 @@ enum {
AHCI_MAX_PORTS = 32,
AHCI_MAX_SG = 168, /* hardware max is 64K */
AHCI_DMA_BOUNDARY = 0xffffffff,
- AHCI_USE_CLUSTERING = 0,
+ AHCI_USE_CLUSTERING = 1,
AHCI_MAX_CMDS = 32,
AHCI_CMD_SZ = 32,
AHCI_CMD_SLOT_SZ = AHCI_MAX_CMDS * AHCI_CMD_SZ,
--
Jens Axboe
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: use_clustering (sht) bit set to 0 in AHCI ?
2007-05-22 7:45 ` Jens Axboe
@ 2007-05-25 3:06 ` Jeff Garzik
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2007-05-25 3:06 UTC (permalink / raw)
To: Jens Axboe; +Cc: Alok kataria, linux-ide
Jens Axboe wrote:
> On Mon, May 21 2007, Jeff Garzik wrote:
>> Jens Axboe wrote:
>>> ahci has always had clustering disabled, perhaps Jeff can expand on why?
>>
>> Just historical reasons. libata had clustering disabled by default in
>> the beginning, for all drivers. Then we enabled it globally by changing
>> the value of ATA_SHT_USE_CLUSTERING... but apparently forgot to change
>> drivers which use their own value rather than ATA_SHT_USE_CLUSTERING.
>>
>> Feel free to submit a patch turning it on...
>
> The below works for me, but it's only lightly tested. I booted it up and
> ran some large IO tests, I've verified really large IO sizes as well
> (using blktrace, I've verified ios up to 9216KiB being accepted and
> completed by the drive).
>
> -----
>
> From: Jens Axboe <jens.axboe@oracle.com>
>
> ahci: enable sg segment clustering
>
> The specification states that ahci supports segments up to 4MiB in size,
> so enable clustering.
>
> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
applied
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-05-25 3:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-26 5:49 use_clustering (sht) bit set to 0 in AHCI ? Alok kataria
2007-05-21 12:17 ` Jens Axboe
2007-05-21 21:17 ` Jeff Garzik
2007-05-22 7:45 ` Jens Axboe
2007-05-25 3:06 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).