I am just guessing that top "thinks" the KSM merged pages are like shared library.
from process address space's point of view, those pages are still mapped on each processes, thus are counted in their RSS (resident set size). The same like your shared libraries. It might be single .so file, but mapped into say 3 programs. Well then, each of them will count this .so into their RSS, while in fact only lesser amount of file backed pages are used.
Hope I explained it clearly