--- x/mm/rmap.c +++ y/mm/rmap.c @@ -1279,7 +1279,7 @@ void folio_add_new_anon_rmap(struct foli if (likely(!folio_test_pmd_mappable(folio))) { /* increment count (starts at -1) */ - atomic_set(&folio->_mapcount, 0); + atomic_inc(&folio->_mapcount); nr = 1; } else { /* increment count (starts at -1) */