linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Poetzl <herbert@13thfloor.at>
To: Wu Fengguang <wfg@linux.intel.com>
Cc: Shaohua Li <shaohua.li@intel.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Tejun Heo <tj@kernel.org>
Subject: Re: Bad SSD performance with recent kernels
Date: Tue, 31 Jan 2012 07:36:28 +0100	[thread overview]
Message-ID: <20120131063628.GR29272@MAIL.13thfloor.at> (raw)
In-Reply-To: <20120130142837.GA21750@localhost>

On Mon, Jan 30, 2012 at 10:28:37PM +0800, Wu Fengguang wrote:
> On Mon, Jan 30, 2012 at 06:31:34PM +0800, Li, Shaohua wrote:

>> Looks the 2.6.39 block plug introduces some latency here. deleting
>> blk_start_plug/blk_finish_plug in generic_file_aio_read seems
>> workaround
>> the issue. The plug seems not good for sequential IO, because readahead
>> code already has plug and has fine grained control.

> Why not remove the generic_file_aio_read() plug completely? It
> actually prevents unplugging immediately after the readahead IO is
> submitted and in turn stalls the IO pipeline as showed by Eric's
> blktrace data.

> Eric, will you test this patch? Thank you.

> --- linux.orig/mm/filemap.c	2012-01-30 22:27:11.000000000 +0800
> +++ linux/mm/filemap.c	2012-01-30 22:27:25.000000000 +0800
> @@ -1414,15 +1414,12 @@ generic_file_aio_read(struct kiocb *iocb
>  	unsigned long seg = 0;
>  	size_t count;
>  	loff_t *ppos = &iocb->ki_pos;
> -	struct blk_plug plug;

>  	count = 0;
>  	retval = generic_segment_checks(iov, &nr_segs, &count, VERIFY_WRITE);
>  	if (retval)
>  		return retval;

> -	blk_start_plug(&plug);
> -
>  	/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
>  	if (filp->f_flags & O_DIRECT) {
>  		loff_t size;
> @@ -1495,7 +1492,6 @@ generic_file_aio_read(struct kiocb *iocb
>  			break;
>  	}
>  out:
> -	blk_finish_plug(&plug);
>  	return retval;
>  }
>  EXPORT_SYMBOL(generic_file_aio_read);

I can confirm, this seems to fix the issue here as well:

kernel    ------------ read /dev/sda -------------
          --- noop ---  - deadline -  ---- cfs ---
          [MB/s]  %CPU  [MB/s]  %CPU  [MB/s]  %CPU
--------------------------------------------------
3.2.2      45.82   3.7   44.85   3.6   45.04   3.4
3.2.2i     45.59   2.3   51.78   2.6   46.03   2.2
3.2.2i128 250.24  20.9  252.68  21.3  250.00  21.6
3.2.2p    250.88  20.8  249.69  20.7  252.34  21.4
3.2.2p128 249.36  20.7  251.47  20.9  249.03  21.2

3.2.2 ... unmodified 3.2.2 kernel 1M
3.2.2i .. unmodified 3.2.2 kernel with idle=poll, 1M
3.2.2i128 unmodified 3.2.2 kernel with idle=poll, 128k 
3.2.2p .. unmodified 3.2.2 kernel with patch, 1M
3.2.2p128 unmodified 3.2.2 kernel with patch, 128k

thanks again,
Herbert


  parent reply	other threads:[~2012-01-31  6:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  6:00 Bad SSD performance with recent kernels Herbert Poetzl
2012-01-27  6:44 ` Eric Dumazet
2012-01-28 12:51 ` Wu Fengguang
2012-01-28 13:33   ` Eric Dumazet
2012-01-29  5:59     ` Wu Fengguang
2012-01-29  8:42       ` Herbert Poetzl
2012-01-29  9:28         ` Wu Fengguang
2012-01-29 10:03       ` Eric Dumazet
2012-01-29 11:16         ` Wu Fengguang
2012-01-29 13:13           ` Eric Dumazet
2012-01-29 15:52             ` Pádraig Brady
2012-01-29 16:10             ` Wu Fengguang
2012-01-29 20:15               ` Herbert Poetzl
2012-01-30 11:18                 ` Wu Fengguang
2012-01-30 12:34                   ` Eric Dumazet
2012-01-30 14:01                     ` Wu Fengguang
2012-01-30 14:05                       ` Wu Fengguang
2012-01-30  3:17               ` Shaohua Li
2012-01-30  5:31                 ` Eric Dumazet
2012-01-30  5:45                   ` Shaohua Li
2012-01-30  7:13                 ` Herbert Poetzl
2012-01-30  7:22                   ` Shaohua Li
2012-01-30  7:36                     ` Herbert Poetzl
2012-01-30  8:12                       ` Shaohua Li
2012-01-30 10:31                         ` Shaohua Li
2012-01-30 14:28                           ` Wu Fengguang
2012-01-30 14:51                             ` Eric Dumazet
2012-01-30 22:26                               ` Vivek Goyal
2012-01-31  0:14                                 ` Shaohua Li
2012-01-31  1:07                                   ` Wu Fengguang
2012-01-31  3:00                                     ` Shaohua Li
2012-01-31  2:17                                 ` Eric Dumazet
2012-01-31  8:46                                 ` Eric Dumazet
2012-01-31  6:36                             ` Herbert Poetzl [this message]
2012-01-30 14:48         ` Wu Fengguang
2012-01-28 17:01   ` Herbert Poetzl

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=20120131063628.GR29272@MAIL.13thfloor.at \
    --to=herbert@13thfloor.at \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=tj@kernel.org \
    --cc=wfg@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).