Acked-by: Mel Gorman <mel at csn.ul.ie>
> ---
> include/linux/mm.h | 16 ++++++++
> mm/compaction.c | 110
+++++++++++++++++++++++++++++++++++++++++++---------
> mm/migrate.c | 30 +++++++++++++-
> 3 files changed, 136 insertions(+), 20 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index b36d08c..35568fc 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1629,5 +1629,21 @@ static inline unsigned int
debug_guardpage_minorder(void) { return 0; }
> static inline bool page_is_guard(struct page *page) { return false; }
> #endif /* CONFIG_DEBUG_PAGEALLOC */
>
> +#if (defined(CONFIG_VIRTIO_BALLOON) || \
> + defined(CONFIG_VIRTIO_BALLOON_MODULE)) &&
defined(CONFIG_COMPACTION)
> +extern bool isolate_balloon_page(struct page *);
> +extern bool putback_balloon_page(struct page *);
> +extern struct address_space *balloon_mapping;
> +
> +static inline bool is_balloon_page(struct page *page)
> +{
> + return (page->mapping == balloon_mapping) ? true : false;
> +}
> +#else
> +static inline bool is_balloon_page(struct page *page) { return
false; }
> +static inline bool isolate_balloon_page(struct page *page) { return
false; }
> +static inline bool putback_balloon_page(struct page *page) { return
false; }
> +#endif /* (VIRTIO_BALLOON || VIRTIO_BALLOON_MODULE) && COMPACTION
*/
> +
> #endif /* __KERNEL__ */
> #endif /* _LINUX_MM_H */
isolate_balloon_page is only used in compaction.c and could declared static
to compaction.c. You could move them all between struct compact_control
and release_pages to avoid forward declarations.
> <SNIP>
> +/* putback_lru_page() counterpart for a ballooned page */
> +bool putback_balloon_page(struct page *page)
> +{
> + if (WARN_ON(!is_balloon_page(page)))
> + return false;
> +
> + if (likely(trylock_page(page))) {
> + if(is_balloon_page(page)) {
Stick a space in there. Run checkpatch.pl if you haven't already. I suspect
it would have caught this.
As I said, not worth spinning a V3 for :)
--
Mel Gorman
SUSE Labs