public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
To: Hugh Dickins <hugh@veritas.com>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH trivial] block: GFP_ATOMIC is __GFP_HIGH
Date: Sun, 29 Jun 2008 04:38:27 +0300	[thread overview]
Message-ID: <20080629043827.135f39d7@linux360.ro> (raw)
In-Reply-To: <Pine.LNX.4.64.0806290052350.18327@blonde.site>

On Sun, 29 Jun 2008 00:54:27 +0100 (BST)
Hugh Dickins <hugh@veritas.com> wrote:

> GFP_ATOMIC is __GFP_HIGH: no need for alloc_io_context() to add that.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> ---
> 
>  block/blk-ioc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next/block/blk-ioc.c	2008-05-12 02:01:05.000000000
> +0100 +++ linux/block/blk-ioc.c	2008-06-27 14:08:00.000000000
> +0100 @@ -98,7 +98,7 @@ struct io_context *alloc_io_context(gfp_
>  		ret->last_waited = jiffies; /* doesn't matter... */
>  		ret->nr_batch_requests = 0; /* because this is 0 */
>  		ret->aic = NULL;
> -		INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC |
> __GFP_HIGH);
> +		INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC);
>  		INIT_HLIST_HEAD(&ret->cic_list);
>  		ret->ioc_data = NULL;
>  	}

Hi,

I'm not sure this is a good idea: GFP_ATOMIC and __GFP_HIGH are
semantically different, even though they are equivalent at the moment.
Have you seen GFP_NOWAIT's definition?
/* This equals 0, but use constants in case they ever change */
#define GFP_NOWAIT      (GFP_ATOMIC & ~__GFP_HIGH)

I think it's best to look at what that code intends to do, not at what
it does at the moment. Definitions for gfp flags might change in the
future.

If the code does not _semantically_ need __GFP_HIGH, then your commit
message should indicate so, rather than comparing it with GFP_ATOMIC.


	Cheers,
	Eduard

  reply	other threads:[~2008-06-29  1:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-28 23:54 [PATCH trivial] block: GFP_ATOMIC is __GFP_HIGH Hugh Dickins
2008-06-29  1:38 ` Eduard - Gabriel Munteanu [this message]
2008-06-29  6:16   ` Hugh Dickins
2008-06-29 14:15     ` Eduard - Gabriel Munteanu
2008-06-29 18:23       ` Jens Axboe

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=20080629043827.135f39d7@linux360.ro \
    --to=eduard.munteanu@linux360.ro \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.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