If pain or loss of joint mobility is diminishing your ability to function, surgery may be considered. Options include arthroscopy, synovectomy (removal of the lining of the joint), osteotomy (the cutting and reshaping of the joint bone), and total joint replacement.