Design/methodology/approach Inspired by the microstructure of shark skin surface, a diamond-shaped biomimetic texture was designed to improve the tribological performance of gear–rack mechanism under starved lubrication conditions. The line contact meshing process of gear–rack mechanisms under lubrication-deficient conditions was simulated by using a block-on-ring test. Using the response surface method, this paper analyzed the effects of bionic texture parameters (width, depth and spacing) on the tribological performance (friction coefficient and wear amount) of tested samples under line contact and starved lubrication conditions. Findings The experimental results show an optimal proportional relationship between the texture parameters, which made the tribological performance of the tested samples the best. The texture parameters were optimized by using the main objective function method, and the preferred combination of parameters was a width of 69 µm, depth of 24 µm and spacing of 1,162 µm. Originality/value The research results have practical guiding significance for designing line contact motion pairs surface texture and provide a theoretical basis for optimizing line contact motion pairs tribological performance under extreme working conditions.