diff options
| author | Nick Terrell <terrelln@fb.com> | 2022-12-14 03:21:55 +0300 |
|---|---|---|
| committer | Nick Terrell <terrelln@fb.com> | 2022-12-14 03:21:55 +0300 |
| commit | 4f2c0a4acffbec01079c28f839422e64ddeff004 (patch) | |
| tree | 06ada4a8a6d94a94c93944806041b8c994cebfc5 /include/linux/cache.h | |
| parent | 88a309465b3f05a100c3b81966982c0f9f5d23a6 (diff) | |
| parent | 830b3c68c1fb1e9176028d02ef86f3cf76aa2476 (diff) | |
| download | linux-4f2c0a4acffbec01079c28f839422e64ddeff004.tar.xz | |
Merge branch 'main' into zstd-linus
Diffstat (limited to 'include/linux/cache.h')
| -rw-r--r-- | include/linux/cache.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/cache.h b/include/linux/cache.h index d742c57eaee5..5da1bbd96154 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h @@ -85,4 +85,17 @@ #define cache_line_size() L1_CACHE_BYTES #endif +/* + * Helper to add padding within a struct to ensure data fall into separate + * cachelines. + */ +#if defined(CONFIG_SMP) +struct cacheline_padding { + char x[0]; +} ____cacheline_internodealigned_in_smp; +#define CACHELINE_PADDING(name) struct cacheline_padding name +#else +#define CACHELINE_PADDING(name) +#endif + #endif /* __LINUX_CACHE_H */ |
