Underpayment penalty

This is never a clear subject.  Let’s say I have a job, with the usual withholding, and in May have sell a bunch of stock and incur capital gains.  So if I pay 110%(agi higher than 150k) of last years taxes or 90% of this years sometime during the year am I safe?  Some of the gains are offset by losses from the previous year, so the gain is less than initially reported to the irs.  Can I just increase withholding for the rest of the year, or if I’m in the safe harbor region can I wait until April 15th.  Don’t want to make a big payment earlier than I have to.