All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs gfs_mkfs/fs_geometry.c gfs_mkfs/ma ...
Date: 29 Nov 2006 18:25:50 -0000	[thread overview]
Message-ID: <20061129182550.8228.qmail@sourceware.org> (raw)

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



             reply	other threads:[~2006-11-29 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 18:25 rpeterso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-11-29 18:28 [Cluster-devel] cluster/gfs gfs_mkfs/fs_geometry.c gfs_mkfs/ma rpeterso
2006-11-29 17:25 rpeterso

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=20061129182550.8228.qmail@sourceware.org \
    --to=rpeterso@sourceware.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.