Skip to content

Commit 8492936

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm: simplify folio_memcg_charged()
There's no need to check which kind of pointer is in the memcg_data field, all we actually care about is whether it's zero or not. Saves 70 bytes in workingset_activation() with the Debian config. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Johannes Weiner <[email protected]> Acked-by: Shakeel Butt <[email protected]> Acked-by: Roman Gushchin <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7cc57ec commit 8492936

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

include/linux/memcontrol.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ static inline struct mem_cgroup *folio_memcg(struct folio *folio)
438438
*/
439439
static inline bool folio_memcg_charged(struct folio *folio)
440440
{
441-
if (folio_memcg_kmem(folio))
442-
return __folio_objcg(folio) != NULL;
443-
return __folio_memcg(folio) != NULL;
441+
return folio->memcg_data != 0;
444442
}
445443

446444
/*

0 commit comments

Comments
 (0)