* [Cluster-devel] cluster/gfs/gfs_fsck Makefile util.c
@ 2007-01-19 18:59 rpeterso
0 siblings, 0 replies; 3+ messages in thread
From: rpeterso @ 2007-01-19 18:59 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rpeterso at sourceware.org 2007-01-19 18:59:12
Modified files:
gfs/gfs_fsck : Makefile util.c
Log message:
Resolves: bz 223493 gfs_fsck runs slower than previous versions
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/util.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.5&r2=1.1.2.6
--- cluster/gfs/gfs_fsck/Makefile 2005/02/15 17:17:52 1.2.2.1
+++ cluster/gfs/gfs_fsck/Makefile 2007/01/19 18:59:12 1.2.2.2
@@ -25,7 +25,7 @@
inode_hash.c bitmap.c lost_n_found.c inode.c link.c metawalk.c \
eattr.c
-CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -g
+CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -O2
all: gfs_fsck
--- cluster/gfs/gfs_fsck/util.c 2006/11/17 16:15:39 1.1.2.5
+++ cluster/gfs/gfs_fsck/util.c 2007/01/19 18:59:12 1.1.2.6
@@ -318,20 +318,25 @@
/* doesn't think we hung. (This may take a long time). */
void warm_fuzzy_stuff(uint64_t block)
{
+ static uint64_t one_percent = 0;
static struct timeval tv;
static uint32_t seconds = 0;
- last_reported_block = block;
- gettimeofday(&tv, NULL);
- if (!seconds)
- seconds = tv.tv_sec;
- if (tv.tv_sec - seconds) {
- uint64_t percent;
-
- seconds = tv.tv_sec;
- if (last_fs_block) {
- percent = (block * 100) / last_fs_block;
- log_notice("\r%" PRIu64 " percent complete.\r", percent);
+ if (!one_percent)
+ one_percent = last_fs_block / 100;
+ if (block - last_reported_block >= one_percent) {
+ last_reported_block = block;
+ gettimeofday(&tv, NULL);
+ if (!seconds)
+ seconds = tv.tv_sec;
+ if (tv.tv_sec - seconds) {
+ static uint64_t percent;
+
+ seconds = tv.tv_sec;
+ if (last_fs_block) {
+ percent = (block * 100) / last_fs_block;
+ log_notice("\r%" PRIu64 " percent complete.\r", percent);
+ }
}
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread* [Cluster-devel] cluster/gfs/gfs_fsck Makefile util.c
@ 2007-01-19 19:01 rpeterso
0 siblings, 0 replies; 3+ messages in thread
From: rpeterso @ 2007-01-19 19:01 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2007-01-19 19:01:31
Modified files:
gfs/gfs_fsck : Makefile util.c
Log message:
Resolves: bz 222871 gfs_fsck runs slower than previous versions
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/Makefile.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/util.c.diff?cvsroot=cluster&r1=1.8&r2=1.9
--- cluster/gfs/gfs_fsck/Makefile 2006/08/11 15:18:10 1.6
+++ cluster/gfs/gfs_fsck/Makefile 2007/01/19 19:01:31 1.7
@@ -27,7 +27,7 @@
inode_hash.c bitmap.c lost_n_found.c inode.c link.c metawalk.c \
eattr.c
-CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -g
+CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -O2
all: ${TARGET}
--- cluster/gfs/gfs_fsck/util.c 2006/11/17 16:43:49 1.8
+++ cluster/gfs/gfs_fsck/util.c 2007/01/19 19:01:31 1.9
@@ -316,22 +316,31 @@
/* Put out a warm, fuzzy message every second so the user */
/* doesn't think we hung. (This may take a long time). */
+/* We only check whether to report every one percent because */
+/* checking every block kills performance. We only report */
+/* every second because we don't need 100 extra messages in */
+/* logs made from verbose mode. */
void warm_fuzzy_stuff(uint64_t block)
{
+ static uint64_t one_percent = 0;
static struct timeval tv;
static uint32_t seconds = 0;
- last_reported_block = block;
- gettimeofday(&tv, NULL);
- if (!seconds)
- seconds = tv.tv_sec;
- if (tv.tv_sec - seconds) {
- uint64_t percent;
-
- seconds = tv.tv_sec;
- if (last_fs_block) {
- percent = (block * 100) / last_fs_block;
- log_notice("\r%" PRIu64 " percent complete.\r", percent);
+ if (!one_percent)
+ one_percent = last_fs_block / 100;
+ if (block - last_reported_block >= one_percent) {
+ last_reported_block = block;
+ gettimeofday(&tv, NULL);
+ if (!seconds)
+ seconds = tv.tv_sec;
+ if (tv.tv_sec - seconds) {
+ static uint64_t percent;
+
+ seconds = tv.tv_sec;
+ if (last_fs_block) {
+ percent = (block * 100) / last_fs_block;
+ log_notice("\r%" PRIu64 " percent complete.\r", percent);
+ }
}
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread* [Cluster-devel] cluster/gfs/gfs_fsck Makefile util.c
@ 2007-01-19 19:03 rpeterso
0 siblings, 0 replies; 3+ messages in thread
From: rpeterso @ 2007-01-19 19:03 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rpeterso at sourceware.org 2007-01-19 19:03:46
Modified files:
gfs/gfs_fsck : Makefile util.c
Log message:
Resolves: bz 222871 gfs_fsck runs slower than previous versions
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/util.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.1&r2=1.7.2.2
--- cluster/gfs/gfs_fsck/Makefile 2006/08/11 15:18:10 1.6
+++ cluster/gfs/gfs_fsck/Makefile 2007/01/19 19:03:46 1.6.2.1
@@ -27,7 +27,7 @@
inode_hash.c bitmap.c lost_n_found.c inode.c link.c metawalk.c \
eattr.c
-CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -g
+CFLAGS+=-D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\" -Wall -O2
all: ${TARGET}
--- cluster/gfs/gfs_fsck/util.c 2006/11/17 17:00:09 1.7.2.1
+++ cluster/gfs/gfs_fsck/util.c 2007/01/19 19:03:46 1.7.2.2
@@ -316,22 +316,31 @@
/* Put out a warm, fuzzy message every second so the user */
/* doesn't think we hung. (This may take a long time). */
+/* We only check whether to report every one percent because */
+/* checking every block kills performance. We only report */
+/* every second because we don't need 100 extra messages in */
+/* logs made from verbose mode. */
void warm_fuzzy_stuff(uint64_t block)
{
+ static uint64_t one_percent = 0;
static struct timeval tv;
static uint32_t seconds = 0;
- last_reported_block = block;
- gettimeofday(&tv, NULL);
- if (!seconds)
- seconds = tv.tv_sec;
- if (tv.tv_sec - seconds) {
- uint64_t percent;
-
- seconds = tv.tv_sec;
- if (last_fs_block) {
- percent = (block * 100) / last_fs_block;
- log_notice("\r%" PRIu64 " percent complete.\r", percent);
+ if (!one_percent)
+ one_percent = last_fs_block / 100;
+ if (block - last_reported_block >= one_percent) {
+ last_reported_block = block;
+ gettimeofday(&tv, NULL);
+ if (!seconds)
+ seconds = tv.tv_sec;
+ if (tv.tv_sec - seconds) {
+ static uint64_t percent;
+
+ seconds = tv.tv_sec;
+ if (last_fs_block) {
+ percent = (block * 100) / last_fs_block;
+ log_notice("\r%" PRIu64 " percent complete.\r", percent);
+ }
}
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-19 19:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-19 18:59 [Cluster-devel] cluster/gfs/gfs_fsck Makefile util.c rpeterso
-- strict thread matches above, loose matches on Subject: below --
2007-01-19 19:01 rpeterso
2007-01-19 19:03 rpeterso
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).