Message ID | 20220505113354.202979-1-xu.xin16@zte.com.cn (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/shmem: fix build failure when CONFIG_TRANSPARENT_HUGEPAGE is not set | expand |
On Thu, 5 May 2022 11:33:55 +0000 cgel.zte@gmail.com wrote: > From: Yang Yang <yang.yang29@zte.com.cn> > > shmem_add_to_page_cache() use THP_FILE_FALLBACK even if > CONFIG_TRANSPARENT_HUGEPAGE is not set and triggers this > compile error. > > Add ifdef CONFIG_TRANSPARENT_HUGEPAGE in shmem_add_to_page_cache(). Thanks. > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -717,10 +717,12 @@ static int shmem_add_to_page_cache(struct folio *folio, > if (!folio_test_swapcache(folio)) { > error = mem_cgroup_charge(folio, charge_mm, gfp); > if (error) { > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > if (folio_test_large(folio)) { > count_vm_event(THP_FILE_FALLBACK); > count_vm_event(THP_FILE_FALLBACK_CHARGE); > } > +#endif > goto error; > } > } I believe Matthew address this in version 2 of "Folio patches for 5.19". I'm aiming to get that (and much more!) pushed out or Monday's linux-next.
diff --git a/mm/shmem.c b/mm/shmem.c index 107f1e4dd0aa..f01ceedf88c0 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -717,10 +717,12 @@ static int shmem_add_to_page_cache(struct folio *folio, if (!folio_test_swapcache(folio)) { error = mem_cgroup_charge(folio, charge_mm, gfp); if (error) { +#ifdef CONFIG_TRANSPARENT_HUGEPAGE if (folio_test_large(folio)) { count_vm_event(THP_FILE_FALLBACK); count_vm_event(THP_FILE_FALLBACK_CHARGE); } +#endif goto error; } }