]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: megaraid_sas: Selectively apply stream detection based on IO type
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Fri, 5 Jan 2018 13:27:45 +0000 (05:27 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 8 Mar 2018 02:44:11 +0000 (18:44 -0800)
Performance improvement:

Current driver calls stream detection unconditionally for all IOs.
Stream Detection logic is not required for most of the fast path IO. To
improve performance, avoid stream detection logic and do it only if
required.

Below are the cases where stream detection is required in driver:

1. All non-FastPath IOs (IOs going to FW)
2. Fast Path reads sent to ReadAhead capable VDs.

Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 27625001
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_fusion.c

index 603c9875cb7c72f177347e0f72d21f91be844f32..e64227f3d3863cb34c4e50d9da480f428e3467c3 100644 (file)
@@ -2668,16 +2668,6 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
        praid_context = &io_request->RaidContext;
 
        if (instance->adapter_type == VENTURA_SERIES) {
-               spin_lock_irqsave(&instance->stream_lock, spinlock_flags);
-               megasas_stream_detect(instance, cmd, &io_info);
-               spin_unlock_irqrestore(&instance->stream_lock, spinlock_flags);
-               /* In ventura if stream detected for a read and it is read ahead
-                *  capable make this IO as LDIO
-                */
-               if (is_stream_detected(&io_request->RaidContext.raid_context_g35) &&
-                   io_info.isRead && io_info.ra_capable)
-                       fp_possible = false;
-
                /* FP for Optimal raid level 1.
                 * All large RAID-1 writes (> 32 KiB, both WT and WB modes)
                 * are built by the driver as LD I/Os.
@@ -2703,6 +2693,20 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
                        }
                }
 
+               if (!fp_possible ||
+                   (io_info.isRead && io_info.ra_capable)) {
+                       spin_lock_irqsave(&instance->stream_lock,
+                                         spinlock_flags);
+                       megasas_stream_detect(instance, cmd, &io_info);
+                       spin_unlock_irqrestore(&instance->stream_lock,
+                                              spinlock_flags);
+                       /* In ventura if stream detected for a read and it is
+                        * read ahead capable make this IO as LDIO
+                        */
+                       if (is_stream_detected(&io_request->RaidContext.raid_context_g35))
+                               fp_possible = false;
+               }
+
                /* If raid is NULL, set CPU affinity to default CPU0 */
                if (raid)
                        megasas_set_raidflag_cpu_affinity(praid_context,