lkml.org 
[lkml]   [2023]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC PATCH 05/11] shmem: account for large order folios
On Sat, Oct 28, 2023 at 09:15:42PM +0000, Daniel Gomez wrote:
> @@ -856,16 +856,16 @@ unsigned long shmem_partial_swap_usage(struct address_space *mapping,
> pgoff_t start, pgoff_t end)
> {
> XA_STATE(xas, &mapping->i_pages, start);
> - struct page *page;
> + struct folio *folio;
> unsigned long swapped = 0;
> unsigned long max = end - 1;
>
> rcu_read_lock();
> - xas_for_each(&xas, page, max) {
> - if (xas_retry(&xas, page))
> + xas_for_each(&xas, folio, max) {
> + if (xas_retry(&xas, folio))
> continue;
> - if (xa_is_value(page))
> - swapped++;
> + if (xa_is_value(folio))
> + swapped += folio_nr_pages(folio);

... you can't call folio_nr_pages() if xa_is_value().

\
 
 \ /
  Last update: 2023-10-29 21:41    [W:0.127 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site