Message ID | 20210222132405.91369-1-hare@suse.de |
---|---|
Headers | show |
Series | scsi: enable reserved commands for LLDDs | expand |
On 23/02/2021 10:16, John Garry wrote: > On 22/02/2021 13:23, Hannes Reinecke wrote: >> Hi all, > > + > >> >> quite some drivers use internal commands for various purposes, most >> commonly sending TMFs or querying the HBA status. >> While these commands use the same submission mechanism than normal >> I/O commands, they will not be counted as outstanding commands, >> requiring those drivers to implement their own mechanism to figure >> out outstanding commands. >> The block layer already has the concept of 'reserved' tags for >> precisely this purpose, namely non-I/O tags which live off a separate >> tag pool. That guarantees that these commands can always be sent, >> and won't be influenced by tag starvation from the I/O tag pool. >> This patchset enables the use of reserved tags for the SCSI midlayer >> by allocating a virtual LUN for the HBA itself which just serves >> as a resource to allocate valid tags from. >> This removes quite some hacks which were required for some >> drivers (eg. fnic or snic), and allows the use of tagset >> iterators within the drivers. >> >> The entire patchset can be found at >> >> git://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git >> reserved-tags.v7 > > > Thanks for doing this, I'll have a look. So I got this working eventually for hisi_sas - a few fixes needed: https://github.com/hisilicon/kernel-dev/commits/private-topic-sas-5.11-resv7 I'll have a look at the core patches tomorrow. However, at this point, how about convert just a couple of drivers (the ones which you can test) to get it merged as a start? 31 patches is too many. thanks, John
On 2/23/21 6:50 PM, John Garry wrote: > On 23/02/2021 10:16, John Garry wrote: >> On 22/02/2021 13:23, Hannes Reinecke wrote: >>> Hi all, >> >> + >> >>> >>> quite some drivers use internal commands for various purposes, most >>> commonly sending TMFs or querying the HBA status. >>> While these commands use the same submission mechanism than normal >>> I/O commands, they will not be counted as outstanding commands, >>> requiring those drivers to implement their own mechanism to figure >>> out outstanding commands. >>> The block layer already has the concept of 'reserved' tags for >>> precisely this purpose, namely non-I/O tags which live off a separate >>> tag pool. That guarantees that these commands can always be sent, >>> and won't be influenced by tag starvation from the I/O tag pool. >>> This patchset enables the use of reserved tags for the SCSI midlayer >>> by allocating a virtual LUN for the HBA itself which just serves >>> as a resource to allocate valid tags from. >>> This removes quite some hacks which were required for some >>> drivers (eg. fnic or snic), and allows the use of tagset >>> iterators within the drivers. >>> >>> The entire patchset can be found at >>> >>> git://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git >>> reserved-tags.v7 >> >> >> Thanks for doing this, I'll have a look. > > So I got this working eventually for hisi_sas - a few fixes needed: > https://github.com/hisilicon/kernel-dev/commits/private-topic-sas-5.11-resv7 > > > I'll have a look at the core patches tomorrow. However, at this point, > how about convert just a couple of drivers (the ones which you can test) > to get it merged as a start? 31 patches is too many. > Yeah, I know. Actually, I just sent it out so that you can have a look at my libsas slow task rework. But I can easily split it off for just fnic/snic/aacraid/hpsa, and leave the libsas slow task stuff for the next round. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
On 24/02/2021 06:54, Hannes Reinecke wrote: >> >> So I got this working eventually for hisi_sas - a few fixes needed: >> https://github.com/hisilicon/kernel-dev/commits/private-topic-sas-5.11-resv7 >> >> >> I'll have a look at the core patches tomorrow. However, at this point, >> how about convert just a couple of drivers (the ones which you can >> test) to get it merged as a start? 31 patches is too many. >> > Yeah, I know. Actually, I just sent it out so that you can have a look > at my libsas slow task rework. > Fine, but obviously that libsas and users stuff needs more work. > But I can easily split it off for just fnic/snic/aacraid/hpsa, and leave > the libsas slow task stuff for the next round. I think that's better. But even then, it's still a large patchset. Maybe 1 or 2 drivers is enough to start with... and whatever you can test, as I don't have HW to test those. Thanks, John
-----Original Message-----
From: Hannes Reinecke [mailto:hare@suse.de]
Subject: [PATCHv7 00/31] scsi: enable reserved commands for LLDDs
Hi all,
quite some drivers use internal commands for various purposes, most commonly sending TMFs or querying the HBA status.
While these commands use the same submission mechanism than normal I/O commands, they will not be counted as outstanding commands, requiring those drivers to implement their own mechanism to figure out outstanding commands.
The block layer already has the concept of 'reserved' tags for precisely this purpose, namely non-I/O tags which live off a separate tag pool. That guarantees that these commands can always be sent, and won't be influenced by tag starvation from the I/O tag pool.
This patchset enables the use of reserved tags for the SCSI midlayer by allocating a virtual LUN for the HBA itself which just serves as a resource to allocate valid tags from.
This removes quite some hacks which were required for some drivers (eg. fnic or snic), and allows the use of tagset iterators within the drivers.
The entire patchset can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
reserved-tags.v7
Don: Cloned and kernel built. I'll have some test results by end of next week or so...
Thanks,
Don
--
2.29.2
On 2/22/21 7:23 AM, Hannes Reinecke wrote: > Hi all, > > quite some drivers use internal commands for various purposes, most > commonly sending TMFs or querying the HBA status. > While these commands use the same submission mechanism than normal > I/O commands, they will not be counted as outstanding commands, > requiring those drivers to implement their own mechanism to figure > out outstanding commands. > The block layer already has the concept of 'reserved' tags for > precisely this purpose, namely non-I/O tags which live off a separate > tag pool. That guarantees that these commands can always be sent, > and won't be influenced by tag starvation from the I/O tag pool. > This patchset enables the use of reserved tags for the SCSI midlayer > by allocating a virtual LUN for the HBA itself which just serves > as a resource to allocate valid tags from. > This removes quite some hacks which were required for some > drivers (eg. fnic or snic), and allows the use of tagset > iterators within the drivers. > Hey Hannes, I was trying to port some iscsi patches to this set. One question I had is how to handle if my driver implements init_cmd_priv, and wants to use the reserved cmds for a non scsi IO. My case I want to use them for cmds like a iscsi nop/ping, device/target reset or login request. There is no bit to way to tell if at init_cmd_priv time the cmd will be for a reserved or non reserved cmd right? If not, I was wondering should I do: 1. in libiscsi, allocate an array of size $reserved_cmds with non_scsi_cmds structs. When I need to do a non scsi cmd do blk_mq_get_tag on the host's tags to get a reserved tag then use that to lookup a struct in my array? 2. in libiscsi when I need to do a non scsi cmd do a scsi_get_internal_cmd. At this time allocate the non_scsi_cmd struct parts.
On 3/12/21 12:53 AM, michael.christie@oracle.com wrote: > On 2/22/21 7:23 AM, Hannes Reinecke wrote: >> Hi all, >> >> quite some drivers use internal commands for various purposes, most >> commonly sending TMFs or querying the HBA status. >> While these commands use the same submission mechanism than normal >> I/O commands, they will not be counted as outstanding commands, >> requiring those drivers to implement their own mechanism to figure >> out outstanding commands. >> The block layer already has the concept of 'reserved' tags for >> precisely this purpose, namely non-I/O tags which live off a separate >> tag pool. That guarantees that these commands can always be sent, >> and won't be influenced by tag starvation from the I/O tag pool. >> This patchset enables the use of reserved tags for the SCSI midlayer >> by allocating a virtual LUN for the HBA itself which just serves >> as a resource to allocate valid tags from. >> This removes quite some hacks which were required for some >> drivers (eg. fnic or snic), and allows the use of tagset >> iterators within the drivers. >> > > Hey Hannes, > > I was trying to port some iscsi patches to this set. One question I had > is how to handle if my driver implements init_cmd_priv, and wants to use > the reserved cmds for a non scsi IO. My case I want to use them for cmds > like a iscsi nop/ping, device/target reset or login request. > > There is no bit to way to tell if at init_cmd_priv time the cmd will be > for a reserved or non reserved cmd right? If not, I was wondering should > I do: > > 1. in libiscsi, allocate an array of size $reserved_cmds with non_scsi_cmds > structs. When I need to do a non scsi cmd do blk_mq_get_tag on the host's > tags to get a reserved tag then use that to lookup a struct in my array? > > 2. in libiscsi when I need to do a non scsi cmd do a scsi_get_internal_cmd. > At this time allocate the non_scsi_cmd struct parts. > You sure you will need to allocate additional stuff? The request already comes with the request, scsi, and driver private bits (ie the additional space from .cmd_size) allocated. And yes, you can tell in init_cmd_priv() if the command is coming from the private pool; I had a helper 'req_is_reserved' once, I thought it's still there ... Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
-----Original Message-----
Subject: RE: [PATCHv7 00/31] scsi: enable reserved commands for LLDDs
-----Original Message-----
From: Hannes Reinecke [mailto:hare@suse.de]
Subject: [PATCHv7 00/31] scsi: enable reserved commands for LLDDs
Hi all,
quite some drivers use internal commands for various purposes, most commonly sending TMFs or querying the HBA status.
While these commands use the same submission mechanism than normal I/O commands, they will not be counted as outstanding commands, requiring those drivers to implement their own mechanism to figure out outstanding commands.
The block layer already has the concept of 'reserved' tags for precisely this purpose, namely non-I/O tags which live off a separate tag pool. That guarantees that these commands can always be sent, and won't be influenced by tag starvation from the I/O tag pool.
This patchset enables the use of reserved tags for the SCSI midlayer by allocating a virtual LUN for the HBA itself which just serves as a resource to allocate valid tags from.
This removes quite some hacks which were required for some drivers (eg. fnic or snic), and allows the use of tagset iterators within the drivers.
The entire patchset can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
reserved-tags.v7
Don: Cloned and kernel built. I'll have some test results by end of next week or so...
Thanks,
Don
--
2.29.2
Don:
03/16/2021
Have run a lot of heavy I/O tests. The driver/OS holds together until there are reset operations. The resets do not complete because of 1 patch pending on Martin Peterson's 5.13/scsi-queue tree
f749d8b7a989 scsi: hpsa: Correct dev cmds outstanding for retried cmds
and pending patch
https://patchwork.kernel.org/project/linux-scsi/patch/161540317205.18786.5821926127237311408.stgit@brunhilda/ hpsa: fix regression issue for old controllers
My testing consisted of running 7 operations in parallel using a lot of HBA, LVs, and AIO LVs.
1. mkfs
2. mount
3. rsync to mounted volumes
4. fio to mounted file systems.
5. umount
6. fsck
7. fio to raw disks.
So far, so good, but I need to add in tests that exercise the reserved slots. I'll start that soon after I complete my resulting logfile checks.
Thanks,
Don
On 12/03/2021 16:08, Hannes Reinecke wrote: > On 3/12/21 12:53 AM, michael.christie@oracle.com wrote: >> On 2/22/21 7:23 AM, Hannes Reinecke wrote: >>> Hi all, >>> >>> quite some drivers use internal commands for various purposes, most >>> commonly sending TMFs or querying the HBA status. >>> While these commands use the same submission mechanism than normal >>> I/O commands, they will not be counted as outstanding commands, >>> requiring those drivers to implement their own mechanism to figure >>> out outstanding commands. >>> The block layer already has the concept of 'reserved' tags for >>> precisely this purpose, namely non-I/O tags which live off a separate >>> tag pool. That guarantees that these commands can always be sent, >>> and won't be influenced by tag starvation from the I/O tag pool. >>> This patchset enables the use of reserved tags for the SCSI midlayer >>> by allocating a virtual LUN for the HBA itself which just serves >>> as a resource to allocate valid tags from. >>> This removes quite some hacks which were required for some >>> drivers (eg. fnic or snic), and allows the use of tagset >>> iterators within the drivers. >>> >> >> Hey Hannes, >> >> I was trying to port some iscsi patches to this set. One question I had >> is how to handle if my driver implements init_cmd_priv, and wants to use >> the reserved cmds for a non scsi IO. My case I want to use them for cmds >> like a iscsi nop/ping, device/target reset or login request. >> >> There is no bit to way to tell if at init_cmd_priv time the cmd will be >> for a reserved or non reserved cmd right? If not, I was wondering should >> I do: If I'm not mistaken, init_cmd_priv has no in-tree user today. Any plans to add one ... to see what it's about? Thanks, John >> >> 1. in libiscsi, allocate an array of size $reserved_cmds with non_scsi_cmds >> structs. When I need to do a non scsi cmd do blk_mq_get_tag on the host's >> tags to get a reserved tag then use that to lookup a struct in my array? >> >> 2. in libiscsi when I need to do a non scsi cmd do a scsi_get_internal_cmd. >> At this time allocate the non_scsi_cmd struct parts. >> > You sure you will need to allocate additional stuff? > The request already comes with the request, scsi, and driver private > bits (ie the additional space from .cmd_size) allocated. > > And yes, you can tell in init_cmd_priv() if the command is coming from > the private pool; I had a helper 'req_is_reserved' once, I thought it's > still there ... > > Cheers, > > Hannes >
-----Original Message----- From: Don Brace - C33706 Sent: Tuesday, March 16, 2021 12:58 PM To: Don Brace - C33706 <Don.Brace@microchip.com>; hare@suse.de; martin.petersen@oracle.com Cc: james.bottomley@hansenpartnership.com; hch@lst.de; john.garry@huawei.com; linux-scsi@vger.kernel.org Subject: RE: [PATCHv7 00/31] scsi: enable reserved commands for LLDDs Hi all, quite some drivers use internal commands for various purposes, most commonly sending TMFs or querying the HBA status. While these commands use the same submission mechanism than normal I/O commands, they will not be counted as outstanding commands, requiring those drivers to implement their own mechanism to figure out outstanding commands. The block layer already has the concept of 'reserved' tags for precisely this purpose, namely non-I/O tags which live off a separate tag pool. That guarantees that these commands can always be sent, and won't be influenced by tag starvation from the I/O tag pool. This patchset enables the use of reserved tags for the SCSI midlayer by allocating a virtual LUN for the HBA itself which just serves as a resource to allocate valid tags from. This removes quite some hacks which were required for some drivers (eg. fnic or snic), and allows the use of tagset iterators within the drivers. The entire patchset can be found at git://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git reserved-tags.v7 Don: Cloned and kernel built. I'll have some test results by end of next week or so... Thanks, Don -- 2.29.2 Don: 03/16/2021 Have run a lot of heavy I/O tests. The driver/OS holds together until there are reset operations. The resets do not complete because of 1 patch pending on Martin Peterson's 5.13/scsi-queue tree f749d8b7a989 scsi: hpsa: Correct dev cmds outstanding for retried cmds and pending patch https://patchwork.kernel.org/project/linux-scsi/patch/161540317205.18786.5821926127237311408.stgit@brunhilda/ hpsa: fix regression issue for old controllers My testing consisted of running 7 operations in parallel using a lot of HBA, LVs, and AIO LVs. 1. mkfs 2. mount 3. rsync to mounted volumes 4. fio to mounted file systems. 5. umount 6. fsck 7. fio to raw disks. So far, so good, but I need to add in tests that exercise the reserved slots. I'll start that soon after I complete my resulting logfile checks. Thanks, Don 03/29/2021 Don: After applying my patch commit 6651ea81e097b369ececdc53d1e04bc40955d92a (HEAD -> reserved-tags.v7) Author: Don Brace <don.brace@microchip.com> Date: Mon Feb 15 16:26:57 2021 -0600 scsi: hpsa: Correct dev cmds outstanding for retried cmds I re-ran my Heavy I/O scripts and testing held up. For the hpsa driver: Acked-by: Don Brace <don.brace@microchip.com> Tested-by: Don Brace <don.brace@microchip.com>