Re: [PATCH] mount_tmpfs command

2010-04-07 Thread Naoya Sugioka
Hi again,

Oops, it was not correct one. please use this version.

Silly me for confusion. thank you,
- Naoya

On 4/7/10, Naoya Sugioka naoya.sugi...@gmail.com wrote:
 Hi Matt,

 I just revise with a little better validation.
 Please use this one instead of previous post.

 thank you,
 -Naoya

 On Mon, Apr 5, 2010 at 9:22 AM, Matthew Dillon
 dil...@apollo.backplane.com wrote:
 :Hello,
 :
 :Here attached is the patch for latest tmpfs related command updates:
 :
 : 1. -f options for max filesize
 : 2. -o options now supports uid/gid/mode/inodes/size/maxfilesize
 :descriptive options
 : 3. corresponding tmpfs(5) mount_tmpfs(8) change.
 :
 :Please accept this patch for latest head.
 :
 :thank you,
 :-Naoya

Thanks Naoya, I'll incorporate it in a day or two after we get the
2.6 release officially out the door.

-Matt


diff --git a/sbin/mount_tmpfs/mount_tmpfs.8 b/sbin/mount_tmpfs/mount_tmpfs.8
index c3a9afc..d9fcfab 100644
--- a/sbin/mount_tmpfs/mount_tmpfs.8
+++ b/sbin/mount_tmpfs/mount_tmpfs.8
@@ -36,6 +36,7 @@
 .Nd mount an efficient memory file system
 .Sh SYNOPSIS
 .Nm
+.Op Fl f Ar maxfilesize
 .Op Fl g Ar group
 .Op Fl m Ar mode
 .Op Fl n Ar nodes
@@ -61,6 +62,8 @@ described below.
 .Pp
 The following options are supported:
 .Bl -tag -width XoXoptions
+.It Fl f Ar maxfilesize
+Specifies the maximum file size of the file system.
 .It Fl g Ar group
 Specifies the group name or GID of the root inode of the file system.
 Defaults to the mount point's GID.
@@ -78,9 +81,11 @@ Options are specified with a
 flag followed by a comma-separated string of options.
 See the
 .Xr mount 8
+and
+.Xr tmpfs 5
 man page for possible options and their meanings.
 .It Fl s Ar size
-Specifies the total file system size in bytes.
+Specifies the total file system size.
 If zero is given (the default), the available amount of memory (including
 main memory and swap space) will be used.
 Note that four megabytes are always reserved for the system and cannot
@@ -118,13 +123,14 @@ group, with a restricted 0700 mode:
 .Pp
 .Ic mount -t tmpfs -o -s20M -o -ujoe -o -gusers -o -m0700 tmpfs /mnt
 .Pp
-See
-.Pa /usr/share/examples/fstab/fstab.ramdisk
-for some examples on how to add tmpfs entries to
-.Pa /etc/fstab .
+or
+.Pp
+.Ic mount -t tmpfs -o size=20M,uid=joe,gid=users,mode=0700 tmpfs /mnt
+.Pp
 .Sh SEE ALSO
 .Xr fstab 5 ,
-.Xr mount 8
+.Xr mount 8 ,
+.Xr tmpfs 5
 .Sh HISTORY
 The
 .Nm
diff --git a/sbin/mount_tmpfs/mount_tmpfs.c b/sbin/mount_tmpfs/mount_tmpfs.c
index 98d221d..1d766ea 100644
--- a/sbin/mount_tmpfs/mount_tmpfs.c
+++ b/sbin/mount_tmpfs/mount_tmpfs.c
@@ -58,8 +58,18 @@
 
 /* - */
 
+#define MOPT_TMPFSOPTS \
+   { gid=,   0,  MNT_GID, 1},\
+   { uid=,   0,  MNT_UID, 1},\
+   { mode=,  0,  MNT_MODE, 1},   \
+   { inodes=,0,  MNT_INODES, 1}, \
+   { size=,  0,  MNT_SIZE, 1},   \
+   { maxfilesize=,   0,  MNT_MAXFSIZE, 1}
+
+
 static const struct mntopt mopts[] = {
MOPT_STDOPTS,
+   MOPT_TMPFSOPTS,
MOPT_NULL
 };
 
@@ -68,6 +78,7 @@ static const struct mntopt mopts[] = {
 static gid_t   a_gid(char *);
 static uid_t   a_uid(char *);
 static mode_t  a_mask(char *);
+static int64_t a_number(char *s);
 static voidusage(void) __dead2;
 
 /* - */
@@ -82,14 +93,16 @@ mount_tmpfs_parseargs(int argc, char *argv[],
gid_t gid;
uid_t uid;
mode_t mode;
-   int64_t tmpnumber;
struct stat sb;
+   int extend_flags = 0;
+   char *ptr, *delim;
 
/* Set default values for mount point arguments. */
memset(args, 0, sizeof(*args));
args-ta_version = TMPFS_ARGS_VERSION;
args-ta_size_max = 0;
args-ta_nodes_max = 0;
+   args-ta_maxfsize_max = 0;
*mntflags = 0;
 
gidset = 0; gid = 0;
@@ -97,8 +110,12 @@ mount_tmpfs_parseargs(int argc, char *argv[],
modeset = 0; mode = 0;
 
optind = optreset = 1;
-   while ((ch = getopt(argc, argv, g:m:n:o:s:u:)) != -1 ) {
+   while ((ch = getopt(argc, argv, f:g:m:n:o:s:u:)) != -1 ) {
switch (ch) {
+   case 'f':
+   args-ta_maxfsize_max = a_number(optarg);
+   break;
+
case 'g':
gid = a_gid(optarg);
gidset = 1;
@@ -110,23 +127,97 @@ mount_tmpfs_parseargs(int argc, char *argv[],
break;
 
case 'n':
-   if (dehumanize_number(optarg, tmpnumber)  0) {
-   fprintf(stderr, bad number for -n\n);
-   usage();
-   }
-   args-ta_nodes_max = tmpnumber;
+   args-ta_nodes_max = a_number(optarg);
   

Re: How to use hammer volume-add and volume-del

2010-04-07 Thread lhmwzy
# uname -a
DragonFly . 2.6-RELEASE DragonFly v2.6.1-RELEASE #1: Sun Apr  4
19:50:41 PDT 2010
r...@test28.backplane.com:/usr/obj/usr/src-misc/sys/GENERIC  i386

# hammer volume-del /dev/da1 /usr
hammer volume-del ioctl: Invalid argument

when added a disk,can't be removed.

another question,the same disk(/dev/da1 for example) can be added for
many times using hammer volume-add /dev/da1 /usr,is this normal?

2010/4/7 Michael Neumann michaelne...@googlemail.com:


 2010/4/6 lhmwzy lhm...@gmail.com

 Could anyone write a artilce about how to use hammer volume-add and
 volume-del step by step?
 I can't do it well.

 You used it correctly and discovered a bug. It's really as easy as:
   hammer volume-add /dev/ad1 /
 You can use whatever device, partition, slice etc. you want instead of
 /dev/ad1.
 Note that if you extend you root filesystem, you'd also need to change
 your /boot/loader.conf vfs.root.mountfrom setting to include ad1:
 Before volume-add:
   vfs.root.mountfrom=hammer:ad0s1d
 After volume-add:
   vfs.root.mountfrom=hammer:ad0s1d:ad1
 Always keep in mind that volume-add and volume-del is still experimental,
 which means that it needs more testing!
 Regards,
   Michael



Re: How to use hammer volume-add and volume-del

2010-04-07 Thread Michael Neumann
2010/4/7 lhmwzy lhm...@gmail.com

 # uname -a
 DragonFly . 2.6-RELEASE DragonFly v2.6.1-RELEASE #1: Sun Apr  4
 19:50:41 PDT 2010
 r...@test28.backplane.com:/usr/obj/usr/src-misc/sys/GENERIC  i386

 # hammer volume-del /dev/da1 /usr
 hammer volume-del ioctl: Invalid argument


/usr is not a valid HAMMER filesystem! You must specify the path you
use in mount, not a PFS.

For example:

  mount_hammer /dev/ad1 /mnt
  hammer volume-add /dev/ad2 /mnt



 when added a disk,can't be removed.

 another question,the same disk(/dev/da1 for example) can be added for
 many times using hammer volume-add /dev/da1 /usr,is this normal?


What does hammer info /usr show? I am sure it is not added, but maybe no
error is shown.

Regards,

  Michael


sysbench threading performance problems

2010-04-07 Thread elekktretterr
Hi,

Im trying to benchmark DF with sysbench and got 2 issues:

The cpu and OLTP (using mysql) benchmarks are ridiculously slow. ie. with
one thread they take minutes to complete while on freebsd its a matter of
seconds. Can someone verify this? I dont know if its sysbench or DragonFly
bug.

Petr



Re: sysbench threading performance problems

2010-04-07 Thread elekktretterr
However whats interesting is DF performance in the fileio/seqrd benchmark
with one thread. DF seems to be about 4 times slower. But when you add 2nd
thread it almost catches up with FBSD.



UPDATE: HAMMER and PostgreSQL Performance

2010-04-07 Thread Jan Lentfer
Attached is the latest (again not yet finished) version of the
benchmarking I am doing on DF/HAMMER with PostgreSQL. I am compiling new
numbers atm based on the SILI based adapter I just got donated from Matt.
But as there was auite some interest on IRC I decided to put this
intermediate version out.

Jan

-- 
professional: http://www.oscar-consult.de
private: http://neslonek.homeunix.org/drupal/

HAMMER and PostgreSQL Performance.pdf
Description: Adobe PDF document


Re: UPDATE: HAMMER and PostgreSQL Performance

2010-04-07 Thread Matthew Dillon
Yah, lets see how it fares now that the random I/O read-ahead
issue in cluster_read() has been fixed.  Just stick with fsync_mode=3
(which is equivalent to what UFS does but requires even fewer
discrete media writes).  The fsync modes have been completely revamped
as of late 2.5 and mode 3 (REDO and wait for IO completion but no media
sync) is now the default.

I suspect random I/O crossing 64K data block boundaries will still
have issues even with nohistory because on-media data blocks are not
immediately reused.  An overwrite writes out a new datablock and
changes the B-Tree record to point at it in order to guarantee that
the old data block can be recovered by the crash recovery code.
Reblocking the file will help there but it still presents a problem
for a database which does a lot of writing.

-Matt



Re: sysbench threading performance problems

2010-04-07 Thread Matthew Dillon

:However whats interesting is DF performance in the fileio/seqrd benchmark
:with one thread. DF seems to be about 4 times slower. But when you add 2nd
:thread it almost catches up with FBSD.

What parameters to sysbench are you using and is the data set being
tested large enough to blow out the system caches?

-Matt
Matthew Dillon 
dil...@backplane.com


Re: [PATCH] mount_tmpfs command

2010-04-07 Thread Matthew Dillon

:Hi again,
:
:Oops, it was not correct one. please use this version.
:
:Silly me for confusion. thank you,
:- Naoya

Committed!

-Matt


First file to look at in dragonfly src tree

2010-04-07 Thread Vivek Ayer
Hi guys,

I just checked out the dragonfly src tree from avalon and was
wondering which source file you all would recommend to look at first
to get a feel for how the kernel and system works. I supposed wherever
'int main' is, right?

Thanks in advance,
Vivek


Re: sysbench threading performance problems

2010-04-07 Thread Petr Janda
  What parameters to sysbench are you using and is the data set being
 tested large enough to blow out the system caches?


Pretty much defaullt:

sysbench --num-threads=1 --test=fileio --file-test-mode=seqrd run

Im not sure if the defaults are sane or insane. The only difference between 
these 2 boxes is the OS and the DF box has 2Gb but the FBSD has 4Gb RAM.

Petr