lkml.org 
[lkml]   [2021]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/1] mm/highmem: Remove deprecated kmap_atomic
On Fri, Nov 05, 2021 at 09:56:16AM -0700, Ira Weiny wrote:
> Also I wonder if memset_page could be used? It would end up mapping the page
> 2x sometimes.

That was the point of this function existing, to avoid the
double-mapping.

> As an aside I think flush_dcache_page() needs to be in memset_page() for
> completeness but I'm a bit afraid of adding it with the current controversy...
> :-/

Looks like we now have agreement that it does need to be added, and I
agree with you; send a patch.

At some point, I'm probably going to need to foliate the mem*_page
helpers. I've just added:

static inline void folio_zero_segments(struct folio *folio,
size_t start1, size_t end1, size_t start2, size_t end2)
{
zero_user_segments(&folio->page, start1, end1, start2, end2);
}

static inline void folio_zero_segment(struct folio *folio,
size_t start, size_t end)
{
zero_user_segments(&folio->page, start, end, 0, 0);
}

static inline void folio_zero_range(struct folio *folio,
size_t start, size_t length)
{
zero_user_segments(&folio->page, start, start + length, 0, 0);
}

but I imagine when we foliate btrfs, we'll need to expand the helpers.
I'll probably do something similar to zero_user_segments; have
out-of-line versions for HIGHMEM and inline versions for !HIGHMEM
(we can do the entire folio with HIGHMEM, but need to go page-by-page
on !HIGHMEM).

\
 
 \ /
  Last update: 2021-11-05 18:38    [W:0.073 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site