diff options
| author | Takashi Iwai <tiwai@suse.de> | 2022-09-22 13:47:09 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2022-09-22 13:47:09 +0200 |
| commit | cbdac8bc2cbf91b42a92869dc938b809054d4fae (patch) | |
| tree | 06118f3dc9ea6dab868ebc89aad68e19cd4c7800 /include/linux/memcontrol.h | |
| parent | 79764ec772bc1346441ae1c4b1f3bd1991d634e8 (diff) | |
| parent | 0a0342ede303fc420f3a388e1ae82da3ae8ff6bd (diff) | |
Merge tag 'asoc-fix-v6.0-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.0
A few device specific fixes, nothing too large, and a new device
ID for a Dell laptop.
Diffstat (limited to 'include/linux/memcontrol.h')
| -rw-r--r-- | include/linux/memcontrol.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 4d31ce55b1c0..6257867fbf95 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -987,19 +987,30 @@ static inline void mod_memcg_page_state(struct page *page, static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx) { - return READ_ONCE(memcg->vmstats.state[idx]); + long x = READ_ONCE(memcg->vmstats.state[idx]); +#ifdef CONFIG_SMP + if (x < 0) + x = 0; +#endif + return x; } static inline unsigned long lruvec_page_state(struct lruvec *lruvec, enum node_stat_item idx) { struct mem_cgroup_per_node *pn; + long x; if (mem_cgroup_disabled()) return node_page_state(lruvec_pgdat(lruvec), idx); pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); - return READ_ONCE(pn->lruvec_stats.state[idx]); + x = READ_ONCE(pn->lruvec_stats.state[idx]); +#ifdef CONFIG_SMP + if (x < 0) + x = 0; +#endif + return x; } static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec, |
