linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: regression in DIO write behavior
Date: Tue, 24 Jan 2017 10:44:19 -0500	[thread overview]
Message-ID: <1485272659.3143.18.camel@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

I've noticed a probable regression in recent kernels. When you run the
attached program on an older kernel (I used 2.6.32-642.6.2.el6.x86_64),
I see the kernel generate wsize WRITE calls on the wire.

When I run the same program on a more modern kernel (mainline as of
today), it generates a ton of page-sized I/Os instead. I've verified
that iov_iter_get_pages_alloc is returning a wsize array of pages, it
just seems like the request handling code isn't stitching them together
like it should.

Is this an expected change or a regression? I'm guessing the latter, and
that it might have crept in during the pageio rework from a couple of
years ago.

Any idea where the bug might be?
-- 
Jeff Layton <jlayton@redhat.com>

[-- Attachment #2: diotest2.c --]
[-- Type: text/x-csrc, Size: 814 bytes --]

#define _GNU_SOURCE

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/uio.h>
#include <unistd.h>
#include <stdlib.h>

#define	NUM_PAGES	(256)

int main(int argc, char **argv)
{
	int ret, fd;
	long pagesize;
	struct iovec	iov;

	if (argc < 2) {
		fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
		return 1;
	}

	pagesize = sysconf(_SC_PAGESIZE);
	if (pagesize < 0) {
		perror("sysconf");
		return 1;
	}

	fd = open(argv[1], O_CREAT|O_WRONLY|O_DIRECT, 0666);
	if (fd < 0) {
		perror("open");
		return 1;
	}

	ret = posix_memalign(&iov.iov_base, pagesize, pagesize * NUM_PAGES);
	if (ret) {
		perror("posix_memalign");
		return 1;
	}
	iov.iov_len = pagesize * NUM_PAGES;

	ret = writev(fd, &iov, 1);
	if (ret < 0) {
		perror("writev");
		return 1;
	}

	return 0;
}

             reply	other threads:[~2017-01-24 15:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 15:44 Jeff Layton [this message]
2017-01-24 17:23 ` regression in DIO write behavior Weston Andros Adamson
2017-01-24 17:50   ` Jeff Layton
2017-01-24 19:46   ` Jeff Layton

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=1485272659.3143.18.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=linux-nfs@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;
as well as URLs for NNTP newsgroup(s).