[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120806192418.GB3968@t510.redhat.com>
Date: Mon, 6 Aug 2012 16:24:18 -0300
From: Rafael Aquini <aquini@...hat.com>
To: Rik van Riel <riel@...hat.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
Rusty Russell <rusty@...tcorp.com.au>,
"Michael S. Tsirkin" <mst@...hat.com>, Mel Gorman <mel@....ul.ie>,
Andi Kleen <andi@...stfloor.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Minchan Kim <minchan@...nel.org>
Subject: Re: [PATCH v5 1/3] mm: introduce compaction and migration for virtio
ballooned pages
On Mon, Aug 06, 2012 at 03:06:49PM -0400, Rik van Riel wrote:
>
> Just a plain rename would work.
>
Ok, I will rename it.
> >+static inline bool is_balloon_page(struct page *page)
> >+{
> >+ return (page->mapping && page->mapping == balloon_mapping);
> >+}
>
> As an aside, since you are only comparing page->mapping and
> not dereferencing it, it can be simplified to just:
>
> return (page->mapping == balloon_mapping);
>
We really need both comparisons to avoid potential NULL pointer dereferences at
__isolate_balloon_page() & __putback_balloon_page() while running at bare metal
with no balloon driver loaded, since balloon_mapping itself is a pointer which
each balloon driver can set to its own structure.
Thanks, Rik, for taking the time to look at this patch and provide (always)
valuable feedback.
I'll shortly respin a v6 with your suggestions.
-- Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists