Re: [PATCH] mm: get rid of radix tree gfp mask for pagecache_get_page (was: Re: How to handle TIF_MEMDIE stalls?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So I think this patch is definitely going in the right direction, but
at least the __GFP_WRITE handling is insane:

(Patch edited to show the resulting code, without the old deleted lines)

On Mon, Dec 29, 2014 at 9:40 AM, Michal Hocko <mhocko@xxxxxxx> wrote:
> @@ -1105,13 +1102,11 @@ no_page:
>         if (!page && (fgp_flags & FGP_CREAT)) {
>                 int err;
>                 if ((fgp_flags & FGP_WRITE) && mapping_cap_account_dirty(mapping))
> +                       gfp_mask |= __GFP_WRITE;
> +               if (fgp_flags & FGP_NOFS)
> +                       gfp_mask &= ~__GFP_FS;
>
> +               page = __page_cache_alloc(gfp_mask);
>                 if (!page)
>                         return NULL;
>
> @@ -1122,7 +1117,7 @@ no_page:
>                 if (fgp_flags & FGP_ACCESSED)
>                         __SetPageReferenced(page);
>
> +               err = add_to_page_cache_lru(page, mapping, offset, gfp_mask);

Passing __GFP_WRITE into the radix tree allocation routines is not
sane. So you'd have to mask the bit out again here (unconditionally is
fine).

But other than that this seems to be a sane cleanup.

                            Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]