From: David Howells <dhowells@redhat.com>
To: Daniel Axtens <dja@axtens.net>
Cc: dhowells@redhat.com, torvalds@linux-foundation.org,
Shantanu Goel <sgoel01@yahoo.com>,
Kiran Kumar Modukuri <kiran.modukuri@gmail.com>,
linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] cachefiles: Fix page leak in cachefiles_read_backing_file while vmscan is active
Date: Sat, 01 Dec 2018 13:36:26 +0000 [thread overview]
Message-ID: <32302.1543671386@warthog.procyon.org.uk> (raw)
In-Reply-To: <87r2f26qng.fsf@linkitivity.dja.id.au>
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
next prev parent reply other threads:[~2018-12-02 0:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 16:39 [PATCH 0/7] FS-Cache: Miscellaneous fixes David Howells
2018-11-30 16:39 ` [PATCH 1/7] cachefiles: Fix an assertion failure when trying to update a failed object David Howells
2018-11-30 16:40 ` [PATCH 2/7] fscache: Fix race in fscache_op_complete() due to split atomic_sub & read David Howells
2018-11-30 16:40 ` [PATCH 3/7] cachefiles: Fix page leak in cachefiles_read_backing_file while vmscan is active David Howells
2018-12-01 0:23 ` Daniel Axtens
2018-12-01 13:36 ` David Howells [this message]
2018-11-30 16:40 ` [PATCH 4/7] fscache: fix race between enablement and dropping of object David Howells
2018-11-30 16:40 ` [PATCH 5/7] cachefiles: Explicitly cast enumerated type in put_object David Howells
2018-11-30 16:41 ` [PATCH 6/7] cachefiles: avoid deprecated get_seconds() David Howells
2018-11-30 16:41 ` [PATCH 7/7] fscache, cachefiles: remove redundant variable 'cache' David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32302.1543671386@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=dja@axtens.net \
--cc=kiran.modukuri@gmail.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sgoel01@yahoo.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).