Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 69555 Details for
Bug 107635
sys-fs/convertfs eats 100% CPU for days on end
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
very ugly hack to fix 100% CPU problem
veryuglyhack.patch (text/plain), 3.14 KB, created by
Andreas Klauer
on 2005-09-30 07:11:35 UTC
(
hide
)
Description:
very ugly hack to fix 100% CPU problem
Filename:
MIME Type:
Creator:
Andreas Klauer
Created:
2005-09-30 07:11:35 UTC
Size:
3.14 KB
patch
obsolete
>--- convertfs/devremap.c 2002-03-01 16:16:45.000000000 +0100 >+++ convertfs2005/devremap.c 2005-09-30 15:57:24.000000000 +0200 >@@ -19,6 +19,7 @@ > #include <string.h> > #include <fcntl.h> > #include <unistd.h> >+#include <time.h> > > #include "convertfs.h" > >@@ -80,6 +81,15 @@ > static struct superblock super; > static struct info info; > >+ >+/* ULTRA UGLY HACK */ >+struct indexpage *hack_ip; >+struct chunk *hack_chunk = NULL; >+baddr_t *hack_physp; >+baddr_t hack_virt; >+int hack_i; >+ >+ > static void > die (const char *format, ...) > { >@@ -346,17 +356,63 @@ > baddr_t virt; > int i; > >+/* printf("find_cross_block\n"); */ >+ >+ if(hack_chunk != NULL) >+ { >+ if ((*hack_physp == bm->to) && (*hack_physp != hack_virt)) >+ { >+ >+ ip = hack_ip; >+ chunk = hack_chunk; >+ physp = hack_physp; >+ virt = hack_virt; >+ i = hack_i; >+ >+ goto VERY_UGLY_HACK; >+ } >+ } >+ > i = bm->i + 1; > chunk = bm->chunk; > for (ip = bm->ip; ip; ip = ip->next, chunk = ip->chunk) > for (; chunk; chunk = next_chunk(ip, chunk), i = 0) { >+ >+/* printf("chunk: %p bm->to: %lx\n", chunk, (long int)bm->to); */ >+ > virt = chunk->offset + i; > physp = &chunk->block[i]; >- for (; i < chunk->nblocks; i++, virt++, physp++) >+ for (; i < chunk->nblocks; i++, virt++, physp++) { >+ VERY_UGLY_HACK: >+ > if ((*physp == bm->to) && (*physp != virt)) { >+ >+ hack_ip = ip; >+ hack_chunk = chunk; >+ hack_physp = physp; >+ hack_virt = virt; >+ hack_i = i; >+ >+ hack_i++; >+ hack_virt++; >+ hack_physp++; >+ >+ if(hack_i >= chunk->nblocks) >+ { >+ hack_chunk = next_chunk(hack_ip, hack_chunk); >+ hack_i = 0; >+ >+ if(hack_chunk) >+ { >+ hack_virt = hack_chunk->offset + hack_i; >+ hack_physp = &hack_chunk->block[hack_i]; >+ } >+ } >+ > handle_cross_block(ip, bm, physp, virt); > return 1; > } >+ } > } > return 0; > } >@@ -606,6 +662,8 @@ > int > main (int argc, char *argv[]) > { >+ time_t t; >+ > selfname = argv[0]; > if (argc != 2) { > fprintf(stderr, "Usage: %s DEVICE\n", selfname); >@@ -621,9 +679,13 @@ > replay_log(); > load_index(); > while (info.ip) { >+ t = time(NULL); >+ > prepare_log(); > write_log(); > commit_log(); >+ >+ printf("...that took %d seconds.\n", (int)(time(NULL)-t)); > } > printf("And now the block0...\n"); > bmove(super.block0, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 107635
:
69517
| 69555