code: def val_accuracy(show_swap):
      
      kv = kernel_ver()
      pid = os.getpid()
      swap_accuracy = -1
      if kv[:2] == (2,4):
          if proc.open('meminfo').read().find("Inact_") == -1:
              return 1, swap_accuracy
          return 0, swap_accuracy
      elif kv[:2] == (2,6):
          if os.path.exists(proc.path(pid, 'smaps')):
              swap_accuracy = 1
              if proc.open(pid, 'smaps').read().find("Pss:")!=-1:
                  return 2, swap_accuracy
              else:
                  return 1, swap_accuracy
          if (2,6,1) <= kv <= (2,6,9):
              return -1, swap_accuracy
          return 0, swap_accuracy
      elif kv[0] > 2 and os.path.exists(proc.path(pid, 'smaps')):
          swap_accuracy = 1
          if show_swap and proc.open(pid, 'smaps').read().find("SwapPss:")!=-1:
              swap_accuracy = 2
          return 2, swap_accuracy
      else:
          return 1, swap_accuracy
docs: http://wiki.apache.org/spamassassin/TopSharedMemoryBug