svn commit: r228939 - head/sys/dev/mps

Maksim Yevmenkin emax at freebsd.org
Mon Jan 9 22:15:59 UTC 2012


2012/1/9 Alexander Motin <mav at freebsd.org>:
> On 09.01.2012 21:01, Maksim Yevmenkin wrote:
>>
>> 2012/1/9 Alexander Motin<mav at freebsd.org>:
>>>
>>> On 09.01.2012 20:54, Maksim Yevmenkin wrote:
>>>>
>>>>
>>>> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin<mav at freebsd.org>
>>>>  wrote:
>>>>>
>>>>>
>>>>> Author: mav
>>>>> Date: Wed Dec 28 22:49:28 2011
>>>>> New Revision: 228939
>>>>> URL: http://svn.freebsd.org/changeset/base/228939
>>>>>
>>>>> Log:
>>>>>  Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I
>>>>> see
>>>>>  no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is
>>>>> any
>>>>>  way set to allow MAXPHYS, S/G lists (chain elements) are sufficient
>>>>> and
>>>>>  overflows are also handled. On my tests even 1MB I/Os are working
>>>>> fine.
>>>>>
>>>>>  Reviewed by:  ken@
>>>>>
>>>>> Modified:
>>>>>  head/sys/dev/mps/mps_sas.c
>>>>>
>>>>> Modified: head/sys/dev/mps/mps_sas.c
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/dev/mps/mps_sas.c  Wed Dec 28 22:18:53 2011
>>>>>  (r228938)
>>>>> +++ head/sys/dev/mps/mps_sas.c  Wed Dec 28 22:49:28 2011
>>>>>  (r228939)
>>>>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union
>>>>>                cpi->transport_version = 0;
>>>>>                cpi->protocol = PROTO_SCSI;
>>>>>                cpi->protocol_version = SCSI_REV_SPC;
>>>>> +               cpi->maxio = MAXPHYS;
>>>>>                cpi->ccb_h.status = CAM_REQ_CMP;
>>>>>                break;
>>>>>        }
>>>>
>>>>
>>>>
>>>> sorry for the late reply, but can we make in into tunable please? i
>>>> have in local tree
>>>>
>>>> --- mps_sas.c.orig      2011-11-17 02:05:04.000000000 -0800
>>>> +++ mps_sas.c   2011-12-28 16:05:10.000000000 -0800
>>>> @@ -121,6 +121,11 @@
>>>>
>>>>  MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory");
>>>>
>>>> +int mps_maxio = MAXPHYS;
>>>> +TUNABLE_INT("hw.mps.maxio",&mps_maxio);
>>>> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0,
>>>>
>>>> +       "CAM maxio override\n");
>>>> +
>>>>  static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun);
>>>>  static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc
>>>> *,
>>>>      struct mpssas_target *);
>>>> @@ -938,6 +943,7 @@
>>>>                cpi->protocol = PROTO_SCSI;
>>>>                cpi->protocol_version = SCSI_REV_SPC;
>>>>                cpi->ccb_h.status = CAM_REQ_CMP;
>>>> +               cpi->maxio = mps_maxio;
>>>>                break;
>>>>        }
>>>>        case XPT_GET_TRAN_SETTINGS:
>>>
>>>
>>>
>>> We can. but could you explain why? Have you found any problems this
>>> change?
>>
>>
>> not really. i've had this patch in the local tree for a while now. we
>> are experimenting with various MAXPHYS/maxio settings and having this
>> tunable is very handy. basically, we can set MAXPHYS to some larger
>> value and tweak maxio (for testing purposes) without
>> recompiling/installing new kernel.
>
>
> I don't really think that it is perfect place for such tunable. It is a bit
> strange IMHO to have different maxio for different types of HBAs except
> physical limitations. I would prefer it to be configurable on above layers,
> for example, file systems, if needed. But if you need it here for something,
> I won't object against adding it.

i'm not sure i understand your point. there certainly drivers that set
maxio to value smaller then MAXPHYS. sometimes comments in the code
clearly state that this is because of hardware limitation. in case of
mps(4) it was not clear at all which values are acceptable for maxio.
hence the tunable.

> Have you found any benefits of having maxio below MAXPHYS while
> experimenting? May be those results could be used to improve FS behavior
> somehow to make tuning not needed?

we believe so. fs tuning is under investigation as well.

thanks
max


More information about the svn-src-head mailing list