lkml.org 
[lkml]   [2018]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/7] cachefiles: Fix page leak in cachefiles_read_backing_file while vmscan is active
Date
Daniel Axtens <dja@axtens.net> wrote:

> > [dhowells: Note that I've removed the clearance and put of newpage as
> > they aren't attested in the commit message and don't appear to actually
> > achieve anything since a new page is only allocated is newpage!=NULL and
> > any residual new page is cleared before returning.]
>
> Sorry I hadn't got back to you on this; I think we also discussed this
> with the Ubuntu kernel team and concluded - as you did - that these
> didn't fix any bugs but did make things seem more consistent.

The idea is that if it fails to use the new page it caches it for the next
iteration of the loop rather than going to the allocator twice. But making
the change you proposed, you should also remove the bit that discards the page
on the way out of the function and probably shouldn't initialise newpage at
the top of the function so that the compiler will let you know about paths
that don't handle it.

David

\
 
 \ /
  Last update: 2018-12-01 14:36    [W:0.069 / U:7.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site