From mboxrd@z Thu Jan 1 00:00:00 1970 From: rpeterso@sourceware.org Date: 29 Nov 2006 18:25:50 -0000 Subject: [Cluster-devel] cluster/gfs gfs_mkfs/fs_geometry.c gfs_mkfs/ma ... Message-ID: <20061129182550.8228.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL5 Changes by: rpeterso at sourceware.org 2006-11-29 18:25:50 Modified files: gfs/gfs_mkfs : fs_geometry.c main.c mkfs_gfs.h gfs/man : gfs_mkfs.8 Log message: Resolves: bz213763: mkdir takes more time on larger file systems. Made gfs_mkfs use RG sizes based on size of file system to maximize performance. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_mkfs/fs_geometry.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3&r2=1.3.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_mkfs/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5&r2=1.5.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_mkfs/mkfs_gfs.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/man/gfs_mkfs.8.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3&r2=1.3.2.1 --- cluster/gfs/gfs_mkfs/fs_geometry.c 2006/08/21 19:11:22 1.3 +++ cluster/gfs/gfs_mkfs/fs_geometry.c 2006/11/29 18:25:50 1.3.2.1 @@ -42,13 +42,23 @@ uint64 nrgrp; unsigned int min = (comline->expert) ? 1 : 4; - nrgrp = DIV_RU(sdev->length, (comline->rgsize << 20) / comline->bsize); + while (TRUE) { + nrgrp = DIV_RU(sdev->length, (comline->rgsize << 20) / comline->bsize); - if (nrgrp < min) - nrgrp = min; + if (nrgrp < min) + nrgrp = min; + + if (comline->rgsize_specified || /* If user specified an rg size or */ + nrgrp <= MKFS_EXCESSIVE_RGS || /* not an excessive # of rgs or */ + comline->rgsize >= 2048) /* we've reached the max rg size */ + break; + + comline->rgsize += MKFS_DEFAULT_RGSIZE; /* Try again w/bigger rgs */ + } if (comline->debug) - printf(" nrgrp = %"PRIu64"\n", nrgrp); + printf(" rg sz = %"PRIu32"\n nrgrp = %"PRIu64"\n", comline->rgsize, + nrgrp); return nrgrp; } @@ -118,9 +128,9 @@ for (tmp = rlist->next; tmp != rlist; tmp = tmp->next) { rl = osi_list_entry(tmp, rgrp_list_t, list); - printf("subdevice %u: rg_o = %"PRIu64", rg_l = %"PRIu64"\n", - rl->subdevice, - rl->rg_offset, rl->rg_length); + printf("subdevice %u: rg_o = %"PRIu64", rg_l = %"PRIu64" blocks (%"PRIu64"MB)\n", + rl->subdevice, rl->rg_offset, rl->rg_length, + rl->rg_length * comline->bsize / (1024 * 1024)); } } } --- cluster/gfs/gfs_mkfs/main.c 2006/08/21 19:11:22 1.5 +++ cluster/gfs/gfs_mkfs/main.c 2006/11/29 18:25:50 1.5.2.1 @@ -82,7 +82,6 @@ int cont = TRUE; int optchar; - while (cont) { optchar = getopt(argc, argv, OPTION_STRING); @@ -133,6 +132,7 @@ case 'r': + comline->rgsize_specified = TRUE; comline->rgsize = atoi(optarg); break; @@ -303,6 +303,7 @@ comline.seg_size = MKFS_DEFAULT_SEG_SIZE; comline.jsize = MKFS_DEFAULT_JSIZE; comline.rgsize = MKFS_DEFAULT_RGSIZE; + comline.rgsize_specified = FALSE; decode_arguments(argc, argv, &comline); --- cluster/gfs/gfs_mkfs/mkfs_gfs.h 2006/07/10 23:39:35 1.4 +++ cluster/gfs/gfs_mkfs/mkfs_gfs.h 2006/11/29 18:25:50 1.4.2.1 @@ -102,6 +102,7 @@ uint32 journals; /* Number of journals */ uint32 jsize; /* Size of journals */ uint32 rgsize; /* The Resource Group size */ + int rgsize_specified; /* Did the user specify a rg size? */ int debug; /* Print out debugging information? */ int quiet; /* No messages */ @@ -156,7 +157,7 @@ #define MKFS_DEFAULT_SEG_SIZE (16) #define MKFS_DEFAULT_JSIZE (128) #define MKFS_DEFAULT_RGSIZE (256) - +#define MKFS_EXCESSIVE_RGS (10000) /* device_geometry.c */ --- cluster/gfs/man/gfs_mkfs.8 2005/04/20 05:26:37 1.3 +++ cluster/gfs/man/gfs_mkfs.8 2006/11/29 18:25:50 1.3.2.1 @@ -52,8 +52,12 @@ Be quiet. Don't print anything. .TP \fB-r\fP \fIMegaBytes\fR -gfs_mkfs will try to make Resource Groups about this big. -The default is 256 MB. +gfs_mkfs will try to make Resource Groups (RGs) about this big. +Minimum RG size is 32 MB. Maximum RG size is 2048 MB. +A large RG size may increase performance on very large file systems. +If not specified, gfs_mkfs will choose the RG size based on the size +of the file system: average size file systems will have 256 MB RGs, and +bigger file systems will have bigger RGs for better performance. .TP \fB-s\fP \fIBlocks\fR Journal segment size in filesystem blocks. This value must be at