SAN FRANCISCO — With Logan Webb returning from the injured list on Friday, the Giants will soon have to decide the fates of right-handers Tyle Mahle and Trevor McDonald. Who stays in the rotation and who gets demoted to the bullpen?

Based solely on performance, the decision may not be all that difficult.

Manager Tony Vitello didn’t outright rule out the possibility of a six-man rotation but described the concept as a “dark horse” outcome. If the Giants stick with a traditional five-man rotation, the 25-year-old McDonald appears far more likely to stay a starter while the 31-year-old Mahle could be headed for the bullpen.

McDonald joined the rotation after Webb hit the injured list in early May with right knee bursitis and has impressed as Webb’s temporary replacement.

The right-hander’s 5.24 ERA over his last four starts doesn’t look great, but his inflated ERA is mainly the product of one bad inning against the Chicago White Sox last Friday. McDonald’s individual performances are far more telling of how McDonald has thrown the ball.

On Wednesday, McDonald pitched into the seventh inning and allowed three runs (two earned) over 6 1/3 innings with six strikeouts against the Arizona Diamondbacks. On May 16, McDonald allowed one run over 6 2/3 innings to the Athletics. On May 11, he surrendered three runs over 5 1/3 frames against the Los Angeles Dodgers on the road.

“He’s doing exactly what we want to do, or at least what I have in my mind for what you’d like a whole staff to do,” Vitello said. “Just because he’s a young guy doesn’t mean he can’t be a leader. … If you got more guys than not taking that approach, it ends up being a good pitching staff. And if you have a pitching staff, you’d like to think we can improve this record.”

For his part, McDonald said after Wednesday’s game that he won’t worry about things outside of his control.

“Just take it outing by outing,” he said. “Trying to do the best I can each time I get out there, and whatever happens, happens.”

Mahle, by contrast, hasn’t lived up to the one-year, $10 million deal he signed with the Giants this offseason over a much larger sample. Through 11 starts, Mahle’s 6.04 ERA is the highest mark in the majors. Over his last four starts, Mahle has allowed 18 earned runs over 20 2/3 innings (7.84 ERA).

“We got to find a way to maximize … the entire roster,” Vitello said when asked about the possibility of demoting Mahle. “Whatever we got, how can we put ourselves in a position to win as many games as possible or, again, maybe spark things and take things for a little bit different turn or direction?”

While Mahle has his best strikeout rate (22.9 percent) since 2023, the veteran right-hander just hasn’t done enough to maintain his spot in the rotation.

“I think if there was one thing that was glaring for him to improve upon, then it would be addressed in the bullpen or back in the video room or anything like that,” Vitello said. “But you never know if a change of scenery could help a guy move in a different direction.”

Regardless of who stays and who goes, the Giants will be thrilled to welcome Webb back to the starting rotation.

Webb, a two-time All-Star, wasn’t pitching up to his lofty standards before hitting the injured list for the first time since 2021. Over eight starts, Webb had a 2-4 record with a 5.06 ERA and 3.53 FIP over 48 innings.

“I think it could be a great lift in a few different ways,” Vitello said. “One would be logging some innings. He’s always been excellent at that, which helps the bullpen that day, the next day. Could also kind of help set the tone a little bit. I think attacking the strike zone needs to be a little bit more of a priority.