I did not check for efficiency, but my suggestion is as follows:
1. Find analytical expressions for the sums involved (Hint: Geometric series).
Result is an explicit expression of the form f(m_s,irr2) = 0.
2. You can't solve f for irr2 in terms of m_s.
But assume irr2 = irr2(m_s).
Differentiate f(m_s,irr2(m_s)) implicitly with respect to m_s:
0=df/dm_s + df/d(irr2)*d(irr2)/dm_s.
Solving for d(irr2)/dm_s gives
d(irr2)/dm_s = - (df/dm_s) / (df/d(irr2)).
3. Solve the ordinary differential equation
d(irr2)/dm_s = - (df/dm_s) / (df/d(irr2))
with initial condition irr2(m_s=0) = irr1
Use the event facility of ODE45 to detect when d(irr2)/dm_s becomes zero.
This is the value for m_s where irr2 has a local extremum.
My hope is that it's unique and a maximum.