All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakob Oestergaard <jakob@unthought.net>
To: linux-kernel@vger.kernel.org
Subject: NFS client regression, simple test program
Date: Fri, 31 Mar 2006 13:22:49 +0200	[thread overview]
Message-ID: <20060331112249.GG9811@unthought.net> (raw)
In-Reply-To: <20060331094850.GF9811@unthought.net>

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


Attached is a small test program that exposes the regression.

Kernel LEADING_EMPTY_SPACE wall-clock time to run
2.6.15    0                0.2s
2.6.15    1                29.3s
2.6.14.7  0                0.2s
2.6.14.7  1                0.2s

So it seems that if a file is repeatedly read from and written to, it
matters a lot for later kernels whether or not the blocks that are
worked on, are offset a single byte or not...

Any ideas?

-- 

 / jakob


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

/*
 * Tiny benchmark for Linux NFS client problem 2.6.14.7->2.6.15
 *
 * By Jakob Oestergaard, joe@unthought.net / joe@evalesco.com
 *
 * Compile as:
 *  gcc -o nfsbench -O3 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 nfsbench.c
 */

#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdint.h>

#define MYBLOCKSIZE 32768
#define MYSUBSIZE 1024

/* Set this define to non-zero to expose the regression */
#define LEADING_EMPTY_SPACE 1

int main(int argc, char **argv)
{
  int testfd = open("testfile", O_RDWR|O_CREAT|O_TRUNC, 0666);
  off_t blockoff;
  uint8_t garbage[MYBLOCKSIZE];

  memset(garbage, 42, sizeof garbage);

  for (blockoff = LEADING_EMPTY_SPACE;
       blockoff < 10 * 1024 * 1024;
       blockoff += MYBLOCKSIZE) {
    off_t inblockoff;
    lseek(testfd, blockoff, SEEK_SET);
    write(testfd, garbage, MYBLOCKSIZE);

    for (inblockoff = MYBLOCKSIZE / 4;
	 inblockoff < MYBLOCKSIZE * 3 / 4;
	 inblockoff += MYSUBSIZE * 2) {
      uint8_t gdata[MYBLOCKSIZE];
      lseek(testfd, blockoff, SEEK_SET);
      read(testfd, gdata, MYBLOCKSIZE);
      lseek(testfd, -inblockoff, SEEK_CUR);
      write(testfd, gdata + inblockoff, MYSUBSIZE);
    }
  }

  close(testfd);
}

  reply	other threads:[~2006-03-31 11:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-31  9:48 NFS client (10x) performance regression 2.6.14.7 -> 2.6.15 Jakob Oestergaard
2006-03-31 11:22 ` Jakob Oestergaard [this message]
2006-03-31 12:22 ` Trond Myklebust
2006-03-31 12:45   ` Jakob Oestergaard
2006-03-31 13:06     ` Trond Myklebust
2006-03-31 13:21       ` Jakob Oestergaard
2006-03-31 13:44         ` Trond Myklebust
2006-03-31 14:08           ` Jakob Oestergaard
2006-03-31 14:21             ` Trond Myklebust
2006-03-31 14:35               ` Jakob Oestergaard
2006-03-31 14:49                 ` Bill Rugolsky Jr.
2006-03-31 14:57                   ` Jakob Oestergaard
2006-03-31 15:04                     ` Bill Rugolsky Jr.
2006-03-31 15:24                       ` Jakob Oestergaard
2006-03-31 16:35                         ` Bill Rugolsky Jr.
2006-03-31 18:52                           ` Jakob Oestergaard
2006-03-31 15:55                 ` Trond Myklebust
2006-03-31 16:04                   ` Jakob Oestergaard
2006-04-03 15:26                     ` Jakob Oestergaard
2006-04-03 15:41                       ` Trond Myklebust
2006-04-03 15:45                         ` Jakob Oestergaard
2006-04-04  9:22                           ` Jakob Oestergaard
2006-04-24 22:03                             ` Trond Myklebust
2006-04-25  8:08                               ` Jakob Oestergaard

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=20060331112249.GG9811@unthought.net \
    --to=jakob@unthought.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.