Re: [PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4

2023-11-09 Thread Andreas Gruenbacher
Hi Willy, On Tue, Nov 7, 2023 at 10:27 PM Matthew Wilcox (Oracle) wrote: > Instead of unmapping the folio after copying the data to it, then mapping > it again to zero the tail, provide folio_zero_tail() to zero the tail > of an already-mapped folio. > > Signed-off-by: Matthew Wilcox (Oracle) >

Re: [PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4

2023-11-09 Thread Matthew Wilcox
On Wed, Nov 08, 2023 at 03:06:06PM -0800, Andrew Morton wrote: > > > > +/** > > + * folio_zero_tail - Zero the tail of a folio. > > + * @folio: The folio to zero. > > + * @kaddr: The address the folio is currently mapped to. > > + * @offset: The byte offset in the folio to start zeroing at. > >

Re: [PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4

2023-11-09 Thread Andrew Morton
On Thu, 9 Nov 2023 01:12:15 +0100 Andreas Grünbacher wrote: > Andrew, > > Andrew Morton schrieb am Do., 9. Nov. 2023, 00:06: > > > + > > > + if (folio_test_highmem(folio)) { > > > + size_t max = PAGE_SIZE - offset_in_page(offset); > > > + > > > + while (len > max)

Re: [PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4

2023-11-08 Thread Andreas Grünbacher
Andrew, Andrew Morton schrieb am Do., 9. Nov. 2023, 00:06: > > + > > + if (folio_test_highmem(folio)) { > > + size_t max = PAGE_SIZE - offset_in_page(offset); > > + > > + while (len > max) { > > Shouldn't this be `while (len)'? AFAICT this code can fail to clear >

Re: [PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4

2023-11-08 Thread Andrew Morton
On Tue, 7 Nov 2023 21:26:40 + "Matthew Wilcox (Oracle)" wrote: > Instead of unmapping the folio after copying the data to it, then mapping > it again to zero the tail, provide folio_zero_tail() to zero the tail > of an already-mapped folio. > > ... > > --- a/include/linux/highmem.h > +++

[PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4

2023-11-07 Thread Matthew Wilcox (Oracle)
Instead of unmapping the folio after copying the data to it, then mapping it again to zero the tail, provide folio_zero_tail() to zero the tail of an already-mapped folio. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/inline.c| 3 +-- include/linux/highmem.h | 38