@@ -1298,3 +1298,239 @@ Description: This node is used to set or display whether UFS WriteBooster is
12981298 (if the platform supports UFSHCD_CAP_CLK_SCALING). For a
12991299 platform that doesn't support UFSHCD_CAP_CLK_SCALING, we can
13001300 disable/enable WriteBooster through this sysfs node.
1301+
1302+ What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_version
1303+ Date: June 2021
1304+ Contact: Daejun Park <
[email protected] >
1305+ Description: This entry shows the HPB specification version.
1306+ The full information about the descriptor can be found in the UFS
1307+ HPB (Host Performance Booster) Extension specifications.
1308+ Example: version 1.2.3 = 0123h
1309+
1310+ The file is read only.
1311+
1312+ What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_control
1313+ Date: June 2021
1314+ Contact: Daejun Park <
[email protected] >
1315+ Description: This entry shows an indication of the HPB control mode.
1316+ 00h: Host control mode
1317+ 01h: Device control mode
1318+
1319+ The file is read only.
1320+
1321+ What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_region_size
1322+ Date: June 2021
1323+ Contact: Daejun Park <
[email protected] >
1324+ Description: This entry shows the bHPBRegionSize which can be calculated
1325+ as in the following (in bytes):
1326+ HPB Region size = 512B * 2^bHPBRegionSize
1327+
1328+ The file is read only.
1329+
1330+ What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_number_lu
1331+ Date: June 2021
1332+ Contact: Daejun Park <
[email protected] >
1333+ Description: This entry shows the maximum number of HPB LU supported by
1334+ the device.
1335+ 00h: HPB is not supported by the device.
1336+ 01h ~ 20h: Maximum number of HPB LU supported by the device
1337+
1338+ The file is read only.
1339+
1340+ What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_subregion_size
1341+ Date: June 2021
1342+ Contact: Daejun Park <
[email protected] >
1343+ Description: This entry shows the bHPBSubRegionSize, which can be
1344+ calculated as in the following (in bytes) and shall be a multiple of
1345+ logical block size:
1346+ HPB Sub-Region size = 512B x 2^bHPBSubRegionSize
1347+ bHPBSubRegionSize shall not exceed bHPBRegionSize.
1348+
1349+ The file is read only.
1350+
1351+ What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_max_active_regions
1352+ Date: June 2021
1353+ Contact: Daejun Park <
[email protected] >
1354+ Description: This entry shows the maximum number of active HPB regions that
1355+ is supported by the device.
1356+
1357+ The file is read only.
1358+
1359+ What: /sys/class/scsi_device/*/device/unit_descriptor/hpb_lu_max_active_regions
1360+ Date: June 2021
1361+ Contact: Daejun Park <
[email protected] >
1362+ Description: This entry shows the maximum number of HPB regions assigned to
1363+ the HPB logical unit.
1364+
1365+ The file is read only.
1366+
1367+ What: /sys/class/scsi_device/*/device/unit_descriptor/hpb_pinned_region_start_offset
1368+ Date: June 2021
1369+ Contact: Daejun Park <
[email protected] >
1370+ Description: This entry shows the start offset of HPB pinned region.
1371+
1372+ The file is read only.
1373+
1374+ What: /sys/class/scsi_device/*/device/unit_descriptor/hpb_number_pinned_regions
1375+ Date: June 2021
1376+ Contact: Daejun Park <
[email protected] >
1377+ Description: This entry shows the number of HPB pinned regions assigned to
1378+ the HPB logical unit.
1379+
1380+ The file is read only.
1381+
1382+ What: /sys/class/scsi_device/*/device/hpb_stats/hit_cnt
1383+ Date: June 2021
1384+ Contact: Daejun Park <
[email protected] >
1385+ Description: This entry shows the number of reads that changed to HPB read.
1386+
1387+ The file is read only.
1388+
1389+ What: /sys/class/scsi_device/*/device/hpb_stats/miss_cnt
1390+ Date: June 2021
1391+ Contact: Daejun Park <
[email protected] >
1392+ Description: This entry shows the number of reads that cannot be changed to
1393+ HPB read.
1394+
1395+ The file is read only.
1396+
1397+ What: /sys/class/scsi_device/*/device/hpb_stats/rb_noti_cnt
1398+ Date: June 2021
1399+ Contact: Daejun Park <
[email protected] >
1400+ Description: This entry shows the number of response UPIUs that has
1401+ recommendations for activating sub-regions and/or inactivating region.
1402+
1403+ The file is read only.
1404+
1405+ What: /sys/class/scsi_device/*/device/hpb_stats/rb_active_cnt
1406+ Date: June 2021
1407+ Contact: Daejun Park <
[email protected] >
1408+ Description: This entry shows the number of active sub-regions recommended by
1409+ response UPIUs.
1410+
1411+ The file is read only.
1412+
1413+ What: /sys/class/scsi_device/*/device/hpb_stats/rb_inactive_cnt
1414+ Date: June 2021
1415+ Contact: Daejun Park <
[email protected] >
1416+ Description: This entry shows the number of inactive regions recommended by
1417+ response UPIUs.
1418+
1419+ The file is read only.
1420+
1421+ What: /sys/class/scsi_device/*/device/hpb_stats/map_req_cnt
1422+ Date: June 2021
1423+ Contact: Daejun Park <
[email protected] >
1424+ Description: This entry shows the number of read buffer commands for
1425+ activating sub-regions recommended by response UPIUs.
1426+
1427+ The file is read only.
1428+
1429+ What: /sys/class/scsi_device/*/device/hpb_params/requeue_timeout_ms
1430+ Date: June 2021
1431+ Contact: Daejun Park <
[email protected] >
1432+ Description: This entry shows the requeue timeout threshold for write buffer
1433+ command in ms. The value can be changed by writing an integer to
1434+ this entry.
1435+
1436+ What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_data_size_hpb_single_cmd
1437+ Date: June 2021
1438+ Contact: Daejun Park <
[email protected] >
1439+ Description: This entry shows the maximum HPB data size for using a single HPB
1440+ command.
1441+
1442+ === ========
1443+ 00h 4KB
1444+ 01h 8KB
1445+ 02h 12KB
1446+ ...
1447+ FFh 1024KB
1448+ === ========
1449+
1450+ The file is read only.
1451+
1452+ What: /sys/bus/platform/drivers/ufshcd/*/flags/hpb_enable
1453+ Date: June 2021
1454+ Contact: Daejun Park <
[email protected] >
1455+ Description: This entry shows the status of HPB.
1456+
1457+ == ============================
1458+ 0 HPB is not enabled.
1459+ 1 HPB is enabled
1460+ == ============================
1461+
1462+ The file is read only.
1463+
1464+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/activation_thld
1465+ Date: February 2021
1466+ Contact: Avri Altman <
[email protected] >
1467+ Description: In host control mode, reads are the major source of activation
1468+ trials. Once this threshold hs met, the region is added to the
1469+ "to-be-activated" list. Since we reset the read counter upon
1470+ write, this include sending a rb command updating the region
1471+ ppn as well.
1472+
1473+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/normalization_factor
1474+ Date: February 2021
1475+ Contact: Avri Altman <
[email protected] >
1476+ Description: In host control mode, we think of the regions as "buckets".
1477+ Those buckets are being filled with reads, and emptied on write.
1478+ We use entries_per_srgn - the amount of blocks in a subregion as
1479+ our bucket size. This applies because HPB1.0 only handles
1480+ single-block reads. Once the bucket size is crossed, we trigger
1481+ a normalization work - not only to avoid overflow, but mainly
1482+ because we want to keep those counters normalized, as we are
1483+ using those reads as a comparative score, to make various decisions.
1484+ The normalization is dividing (shift right) the read counter by
1485+ the normalization_factor. If during consecutive normalizations
1486+ an active region has exhausted its reads - inactivate it.
1487+
1488+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_enter
1489+ Date: February 2021
1490+ Contact: Avri Altman <
[email protected] >
1491+ Description: Region deactivation is often due to the fact that eviction took
1492+ place: A region becomes active at the expense of another. This is
1493+ happening when the max-active-regions limit has been crossed.
1494+ In host mode, eviction is considered an extreme measure. We
1495+ want to verify that the entering region has enough reads, and
1496+ the exiting region has much fewer reads. eviction_thld_enter is
1497+ the min reads that a region must have in order to be considered
1498+ a candidate for evicting another region.
1499+
1500+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_exit
1501+ Date: February 2021
1502+ Contact: Avri Altman <
[email protected] >
1503+ Description: Same as above for the exiting region. A region is considered to
1504+ be a candidate for eviction only if it has fewer reads than
1505+ eviction_thld_exit.
1506+
1507+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_ms
1508+ Date: February 2021
1509+ Contact: Avri Altman <
[email protected] >
1510+ Description: In order not to hang on to "cold" regions, we inactivate
1511+ a region that has no READ access for a predefined amount of
1512+ time - read_timeout_ms. If read_timeout_ms has expired, and the
1513+ region is dirty, it is less likely that we can make any use of
1514+ HPB reading it so we inactivate it. Still, deactivation has
1515+ its overhead, and we may still benefit from HPB reading this
1516+ region if it is clean - see read_timeout_expiries.
1517+
1518+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_expiries
1519+ Date: February 2021
1520+ Contact: Avri Altman <
[email protected] >
1521+ Description: If the region read timeout has expired, but the region is clean,
1522+ just re-wind its timer for another spin. Do that as long as it
1523+ is clean and did not exhaust its read_timeout_expiries threshold.
1524+
1525+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/timeout_polling_interval_ms
1526+ Date: February 2021
1527+ Contact: Avri Altman <
[email protected] >
1528+ Description: The frequency with which the delayed worker that checks the
1529+ read_timeouts is awakened.
1530+
1531+ What: /sys/class/scsi_device/*/device/hpb_param_sysfs/inflight_map_req
1532+ Date: February 2021
1533+ Contact: Avri Altman <
[email protected] >
1534+ Description: In host control mode the host is the originator of map requests.
1535+ To avoid flooding the device with map requests, use a simple throttling
1536+ mechanism that limits the number of inflight map requests.
0 commit comments