Whamcloud - gitweb
LU-8796 kernel: kernel upgrade RHEL7.3 [3.10.0-514.el7]
[fs/lustre-release.git] / lustre / kernel_patches / patches / blkdev_tunables-3.8.patch
1 Index: linux-3.10.0-495.el7.x86_64/block/blk-settings.c
2 ===================================================================
3 --- linux-3.10.0-495.el7.x86_64.orig/block/blk-settings.c
4 +++ linux-3.10.0-495.el7.x86_64/block/blk-settings.c
5 @@ -19,6 +19,12 @@ EXPORT_SYMBOL(blk_max_low_pfn);
6  
7  unsigned long blk_max_pfn;
8  
9 +int default_max_sectors = BLK_DEF_MAX_SECTORS;
10 +module_param(default_max_sectors, int, 0);
11 +
12 +int default_max_segments = BLK_MAX_SEGMENTS;
13 +module_param(default_max_segments, int, 0);
14 +
15  /**
16   * blk_queue_prep_rq - set a prepare_request function for queue
17   * @q:         queue
18 @@ -108,7 +114,7 @@ EXPORT_SYMBOL_GPL(blk_queue_lld_busy);
19   */
20  void blk_set_default_limits(struct queue_limits *lim)
21  {
22 -       lim->max_segments = BLK_MAX_SEGMENTS;
23 +       lim->max_segments = default_max_segments;
24         lim->max_integrity_segments = 0;
25         lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
26         if (lim->limits_aux)
27 @@ -268,7 +274,7 @@ void blk_limits_max_hw_sectors(struct qu
28  
29         limits->max_hw_sectors = max_hw_sectors;
30         max_sectors = min_not_zero(max_hw_sectors, limits->max_dev_sectors);
31 -       max_sectors = min_t(unsigned int, max_sectors, BLK_DEF_MAX_SECTORS);
32 +       max_sectors = min_t(unsigned int, max_sectors, default_max_sectors);
33         limits->max_sectors = max_sectors;
34  }
35  EXPORT_SYMBOL(blk_limits_max_hw_sectors);
36 Index: linux-3.10.0-495.el7.x86_64/drivers/scsi/Kconfig
37 ===================================================================
38 --- linux-3.10.0-495.el7.x86_64.orig/drivers/scsi/Kconfig
39 +++ linux-3.10.0-495.el7.x86_64/drivers/scsi/Kconfig
40 @@ -246,6 +246,15 @@ config SCSI_LOGGING
41           there should be no noticeable performance impact as long as you have
42           logging turned off.
43  
44 +config SCSI_MAX_SG_SEGMENTS
45 +       int "Maximum SCSI scatter gather segment size"
46 +       range 32 256 
47 +       default "128"
48 +       depends on SCSI
49 +       help
50 +         Control the maximum limit for scatter gather buffers for the
51 +         SCSI device.
52 +
53  config SCSI_SCAN_ASYNC
54         bool "Asynchronous SCSI scanning"
55         depends on SCSI
56 Index: linux-3.10.0-495.el7.x86_64/include/scsi/scsi.h
57 ===================================================================
58 --- linux-3.10.0-495.el7.x86_64.orig/include/scsi/scsi.h
59 +++ linux-3.10.0-495.el7.x86_64/include/scsi/scsi.h
60 @@ -25,7 +25,7 @@ enum scsi_timeouts {
61   * to SG_MAX_SINGLE_ALLOC to pack correctly at the highest order.  The
62   * minimum value is 32
63   */
64 -#define SCSI_MAX_SG_SEGMENTS   128
65 +#define SCSI_MAX_SG_SEGMENTS   CONFIG_SCSI_MAX_SG_SEGMENTS
66  
67  /*
68   * Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit
69 Index: linux-3.10.0-495.el7.x86_64/drivers/scsi/isci/init.c
70 ===================================================================
71 --- linux-3.10.0-495.el7.x86_64.orig/drivers/scsi/isci/init.c
72 +++ linux-3.10.0-495.el7.x86_64/drivers/scsi/isci/init.c
73 @@ -119,6 +119,10 @@ unsigned char phy_gen = SCIC_SDS_PARM_GE
74  module_param(phy_gen, byte, 0);
75  MODULE_PARM_DESC(phy_gen, "PHY generation (1: 1.5Gbps 2: 3.0Gbps 3: 6.0Gbps)");
76  
77 +u16 sg_table_size = SG_ALL;
78 +module_param(sg_table_size, ushort, 0);
79 +MODULE_PARM_DESC(sg_table_size, "Size in KB of scatter gather table");
80 +
81  unsigned char max_concurr_spinup;
82  module_param(max_concurr_spinup, byte, 0);
83  MODULE_PARM_DESC(max_concurr_spinup, "Max concurrent device spinup");
84 @@ -163,7 +167,6 @@ static struct scsi_host_template isci_sh
85         .can_queue                      = ISCI_CAN_QUEUE_VAL,
86         .cmd_per_lun                    = 1,
87         .this_id                        = -1,
88 -       .sg_tablesize                   = SG_ALL,
89         .max_sectors                    = SCSI_DEFAULT_MAX_SECTORS,
90         .use_clustering                 = ENABLE_CLUSTERING,
91         .eh_abort_handler               = sas_eh_abort_handler,
92 @@ -571,6 +574,7 @@ static struct isci_host *isci_host_alloc
93  
94                 INIT_LIST_HEAD(&idev->node);
95         }
96 +       isci_sht.sg_tablesize = sg_table_size;
97  
98         shost = scsi_host_alloc(&isci_sht, sizeof(void *));
99         if (!shost)
100 Index: linux-3.10.0-495.el7.x86_64/drivers/message/fusion/Kconfig
101 ===================================================================
102 --- linux-3.10.0-495.el7.x86_64.orig/drivers/message/fusion/Kconfig
103 +++ linux-3.10.0-495.el7.x86_64/drivers/message/fusion/Kconfig
104 @@ -61,9 +61,9 @@ config FUSION_SAS
105           LSISAS1078
106  
107  config FUSION_MAX_SGE
108 -       int "Maximum number of scatter gather entries (16 - 128)"
109 -       default "128"
110 -       range 16 128
111 +       int "Maximum number of scatter gather entries (16 - 256)"
112 +       default "256"
113 +       range 16 256
114         help
115           This option allows you to specify the maximum number of scatter-
116           gather entries per I/O. The driver default is 128, which matches
117 Index: linux-3.10.0-495.el7.x86_64/drivers/message/fusion/mptbase.h
118 ===================================================================
119 --- linux-3.10.0-495.el7.x86_64.orig/drivers/message/fusion/mptbase.h
120 +++ linux-3.10.0-495.el7.x86_64/drivers/message/fusion/mptbase.h
121 @@ -166,10 +166,10 @@
122   * Set the MAX_SGE value based on user input.
123   */
124  #ifdef CONFIG_FUSION_MAX_SGE
125 -#if CONFIG_FUSION_MAX_SGE  < 16
126 +#if CONFIG_FUSION_MAX_SGE < 16
127  #define MPT_SCSI_SG_DEPTH      16
128 -#elif CONFIG_FUSION_MAX_SGE  > 128
129 -#define MPT_SCSI_SG_DEPTH      128
130 +#elif CONFIG_FUSION_MAX_SGE > 256
131 +#define MPT_SCSI_SG_DEPTH      256
132  #else
133  #define MPT_SCSI_SG_DEPTH      CONFIG_FUSION_MAX_SGE
134  #endif