public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Nikanth Karthikesan <knikanth@suse.de>
Cc: jens.axboe@oracle.com, David.Woodhouse@intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix discard requests accounting in the diskstats
Date: Thu, 23 Apr 2009 12:50:40 -0700	[thread overview]
Message-ID: <20090423125040.57db9968.akpm@linux-foundation.org> (raw)
In-Reply-To: <200904171144.49448.knikanth@suse.de>

On Fri, 17 Apr 2009 11:44:49 +0530
Nikanth Karthikesan <knikanth@suse.de> wrote:

> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -667,7 +667,9 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync)
>  	(REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
>  #define rq_mergeable(rq)	\
>  	(!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
> -	 (blk_discard_rq(rq) || blk_fs_request((rq))))
> +	 (blk_discard_rq(rq) || blk_fs_request(rq)))
> +#define rq_accountable(rq)	\
> +	(blk_discard_rq(rq) || blk_fs_request(rq))

Both these macros reference their argument multiple times and are
potentially buggy and/or inefficient if passed an expression with
side-effects.

There was (afaict) no reason for them to have been implemented as
macros.


      parent reply	other threads:[~2009-04-23 19:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17  6:14 [PATCH] Fix discard requests accounting in the diskstats Nikanth Karthikesan
2009-04-17  6:49 ` Jens Axboe
2009-04-17  7:55   ` Nikanth Karthikesan
2009-04-17  8:59     ` David Woodhouse
2009-04-17  9:08       ` Jens Axboe
2009-04-23 19:50 ` Andrew Morton [this message]

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=20090423125040.57db9968.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=David.Woodhouse@intel.com \
    --cc=jens.axboe@oracle.com \
    --cc=knikanth@suse.de \
    --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