Re: [PATCH v2] mm: deduplicate cacheline padding code

From: Andrew Morton
Date: Fri Aug 26 2022 - 21:36:03 EST


On Fri, 26 Aug 2022 23:06:42 +0000 Shakeel Butt <shakeelb@xxxxxxxxxx> wrote:

> There are three users (mmzone.h, memcontrol.h, page_counter.h) using
> similar code for forcing cacheline padding between fields of different
> structures. Dedup that code.
>
> ...
>
> include/linux/cache.h | 13 +++++++++++++
> include/linux/memcontrol.h | 13 ++-----------
> include/linux/mmzone.h | 24 +++++-------------------
> include/linux/page_counter.h | 13 ++-----------

I'm looking for an obvious and reliable way in which those three
headers include cache.h. Seems that mm_types.h's inclusion of cache.h
should be sufficient. Direct inclusion of cache.h would of course be
safest. I guess if it breaks, we'll hear about it ;)