I prefer to keep my cadence in the 60-75 rpm range on hills. Any faster, and I tend to not have as good control of the bike to dodge things in the road. On steeper hills (11% or greater), I just mash as fast as I can in the lowest gear that I have.
I rode a steep hill this morning, where my cadence dropped into the 30s. My legs could push no faster or harder. It was either gut-it-out, or get off and walk. If you have bad knees, don't do this. Seriously.