/* The number of zero pages which is placed by KSM */
 unsigned long ksm_zero_pages;
 
+/* The number of pages that have been skipped due to "smart scanning" */
+static unsigned long ksm_pages_skipped;
+
 #ifdef CONFIG_NUMA
 /* Zeroed when merging across nodes is not allowed */
 static unsigned int ksm_merge_across_nodes = 1;
        }
 
        /* Skip this page */
+       ksm_pages_skipped++;
        rmap_item->remaining_skips--;
        remove_rmap_item_from_tree(rmap_item);
        return true;
 }
 KSM_ATTR_RO(pages_volatile);
 
+static ssize_t pages_skipped_show(struct kobject *kobj,
+                                 struct kobj_attribute *attr, char *buf)
+{
+       return sysfs_emit(buf, "%lu\n", ksm_pages_skipped);
+}
+KSM_ATTR_RO(pages_skipped);
+
 static ssize_t ksm_zero_pages_show(struct kobject *kobj,
                                struct kobj_attribute *attr, char *buf)
 {
        &pages_sharing_attr.attr,
        &pages_unshared_attr.attr,
        &pages_volatile_attr.attr,
+       &pages_skipped_attr.attr,
        &ksm_zero_pages_attr.attr,
        &full_scans_attr.attr,
 #ifdef CONFIG_NUMA