Re: [PATCH 16/21] mm/shmem: Convert shmem_add_to_page_cache to take a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-04-29 20:23:24 [+0100], Matthew Wilcox (Oracle) wrote:
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 3461bdec6b38..4331a4daac01 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -736,16 +735,16 @@ static int shmem_add_to_page_cache(struct page *page,
>  			xas_set_err(&xas, -EEXIST);
>  			goto unlock;
>  		}
> -		xas_store(&xas, page);
> +		xas_store(&xas, folio);
>  		if (xas_error(&xas))
>  			goto unlock;
> -		if (PageTransHuge(page)) {
> +		if (folio_test_large(folio)) {
>  			count_vm_event(THP_FILE_ALLOC);
> -			__mod_lruvec_page_state(page, NR_SHMEM_THPS, nr);
> +			__lruvec_stat_mod_folio(folio, NR_SHMEM_THPS, nr);
>  		}

|  CC      mm/shmem.o
|In file included from <command-line>:
|mm/shmem.c: In function ‘shmem_add_to_page_cache’:
|include/linux/compiler_types.h:352:45: error: call to ‘__compiletime_assert_262’ declared with attribute error: BUILD_BUG failed
|  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
|      |                                             ^
…
|mm/shmem.c:743:40: note: in expansion of macro ‘THP_FILE_ALLOC’
|  743 |                         count_vm_event(THP_FILE_ALLOC);
|      |                                        ^~~~~~~~~~~~~~
|

and 

| $ git grep THP_FILE_ALLOC
| include/linux/vm_event_item.h:          THP_FILE_ALLOC,
| include/linux/vm_event_item.h:#define THP_FILE_ALLOC ({ BUILD_BUG(); 0; })
| mm/shmem.c:                     count_vm_event(THP_FILE_ALLOC);
| $ grep CONFIG_TRANSPARENT_HUGEPAGE .config
| # CONFIG_TRANSPARENT_HUGEPAGE is not set

Sebastian





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux