Re: [PATCH v2] mm: honor FGP_NOWAIT for page cache page allocation

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

 



On Sat, Jul 02, 2022 at 09:43:32AM -0600, Jens Axboe wrote:
> +++ b/mm/filemap.c
> @@ -1988,6 +1988,10 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
>  			gfp |= __GFP_WRITE;
>  		if (fgp_flags & FGP_NOFS)
>  			gfp &= ~__GFP_FS;
> +		if (fgp_flags & FGP_NOWAIT) {
> +			gfp &= ~GFP_KERNEL;
> +			gfp |= GFP_NOWAIT | __GFP_NOWARN;
> +		}

Wouldn't it be simpler to write:

		if (fgp_flags & FGP_NOWAIT) {
			gfp &= ~__GFP_DIRECT_RECLAIM;
			gfp |= __GFP_NOWARN;
		}

(I'd prefer it if the caller passed in the GFP flags that it actually
wants, but looking at the patches that prompted this, that seems rather
annoying to do)




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

  Powered by Linux