{"thread":{"id":"3603","subject":"endless loop: ?","startedAt":"2006-03-08T20:04:28Z","lastAt":"2006-03-09T10:20:52Z","messageCount":4,"participants":["Matthias Urlichs","Linus Torvalds","smurf@smurf.noris.de"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"17343","messageId":"pan.2006.03.08.20.04.24.62170@smurf.noris.de","threadId":"3603","inReplyTo":null,"subject":"endless loop: ?","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2006-03-08T20:04:28Z","receivedAt":"2006-03-08T20:04:28Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hmmm...\n\n# ps axurw\nsmurf    26367 84.1  0.2   3200  2068 pts/1    R    20:08  40:30 /usr/bin/git-rev-list --objects 5771c72e2908fb68906020d07d4e0cb77d2\n\n# strace -p 26367\nstat64(\"/daten/src/noris/kundet.git/.git/objects/23/ae4dd0bab2f05dba8a3c77d4c792542b07b73e\", {st_mode=S_IFREG|0644, st_size=204, ...}) = 0\n[ lots of different filenames, however ..:]\n\n# strace -p 26367 | grep ae4dd\nstat64(\"/daten/src/noris/kundet.git/.git/objects/23/ae4dd0bab2f05dba8a3c77d4c792542b07b73e\", {st_mode=S_IFREG|0644, st_size=204, ...}) = 0\n[ lots of repetitions of the same filename => we're in a bad loop of some sort ]\n\n# gdb /daten/src/git/git/git-rev-list 26367\n(gdb) whe\n#0  0xffffe410 in __kernel_vsyscall ()\n#1  0xb7ec08f8 in _xstat () from /lib/tls/i686/cmov/libc.so.6\n#2  0x0804e2f0 in find_sha1_file (\n    sha1=0x81ddb20 \"#\\uffffM\\u043a\\uffff\\uffff]\\uffff\\212<w\\uffff\\uffff\\222T+\\a\\uffff>\\uffffr\\005\\b\\uffff\\uffff\\035\\b\",\n    st=0xbf87b450) at stat.h:366\n#3  0x0804e752 in has_sha1_file (\n    sha1=0x81ddb20 \"#\\uffffM\\u043a\\uffff\\uffff]\\uffff\\212<w\\uffff\\uffff\\222T+\\a\\uffff>\\uffffr\\005\\b\\uffff\\uffff\\035\\b\")\n    at sha1_file.c:1600\n#4  0x080514f8 in mark_parents_uninteresting (commit=0x0) at revision.c:106\n#5  0x080514ed in mark_parents_uninteresting (commit=0x0) at revision.c:96\n[ bah ]\n#104 0x080514ed in mark_parents_uninteresting (commit=0x0) at revision.c:96\n#105 0x080516d8 in prepare_revision_walk (revs=0x8066560) at revision.c:347\n#106 0x08049ab4 in main (argc=1, argv=0xbf87c294) at rev-list.c:352\n\nI'll dig further tomorrow...\n"},{"id":"17356","messageId":"pan.2006.03.09.04.04.34.617873@smurf.noris.de","threadId":"3603","inReplyTo":"pan.2006.03.08.20.04.24.62170@smurf.noris.de","subject":"[PATCH] Don't recurse into parents marked uninteresting.","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2006-03-09T04:04:36Z","receivedAt":"2006-03-09T04:04:36Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"revision.c:make_parents_uninteresting() is exponential with the number\nof merges in the tree. That's fine -- unless some other part of git\nalready has pulled the whole commit tree into memory ...\n\n---\n\n... or, in other words, \"Don't do that, please.\"\n\nWith this patch, all tests still succeed, and the \"git push\" which\ntriggered the problem takes 5min instead of an estimated 10mio years.\n\n---\n\n revision.c |   24 +++++++++++++-----------\n 1 files changed, 13 insertions(+), 11 deletions(-)\n\n32c9750691d1ef225ca1641fdf6902e53c25fe5b\ndiff --git a/revision.c b/revision.c\nindex 2a33637..713f27e 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -82,18 +82,20 @@ void mark_parents_uninteresting(struct c\n \n \twhile (parents) {\n \t\tstruct commit *commit = parents->item;\n-\t\tcommit->object.flags |= UNINTERESTING;\n+\t\tif (!(commit->object.flags & UNINTERESTING)) {\n+\t\t\tcommit->object.flags |= UNINTERESTING;\n \n-\t\t/*\n-\t\t * Normally we haven't parsed the parent\n-\t\t * yet, so we won't have a parent of a parent\n-\t\t * here. However, it may turn out that we've\n-\t\t * reached this commit some other way (where it\n-\t\t * wasn't uninteresting), in which case we need\n-\t\t * to mark its parents recursively too..\n-\t\t */\n-\t\tif (commit->parents)\n-\t\t\tmark_parents_uninteresting(commit);\n+\t\t\t/*\n+\t\t\t * Normally we haven't parsed the parent\n+\t\t\t * yet, so we won't have a parent of a parent\n+\t\t\t * here. However, it may turn out that we've\n+\t\t\t * reached this commit some other way (where it\n+\t\t\t * wasn't uninteresting), in which case we need\n+\t\t\t * to mark its parents recursively too..\n+\t\t\t */\n+\t\t\tif (commit->parents)\n+\t\t\t\tmark_parents_uninteresting(commit);\n+\t\t}\n \n \t\t/*\n \t\t * A missing commit is ok iff its parent is marked\n-- \nMatthias Urlichs\n"},{"id":"17358","messageId":"Pine.LNX.4.64.0603082144450.32577@g5.osdl.org","threadId":"3603","inReplyTo":"pan.2006.03.09.04.04.34.617873@smurf.noris.de","subject":"Re: [PATCH] Don't recurse into parents marked uninteresting.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-03-09T05:48:00Z","receivedAt":"2006-03-09T05:48:00Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 9 Mar 2006, Matthias Urlichs wrote:\n>\n> revision.c:make_parents_uninteresting() is exponential with the number\n> of merges in the tree. That's fine -- unless some other part of git\n> already has pulled the whole commit tree into memory ...\n\nGood call.\n\nHowever, I would have expected the normal case to be that we haven't even \nparsed the parent yet (as per the comment), so the parent normally \nshouldn't even have the parent pointer (due to not having been parsed).\n\nSo what was it that triggered this \"parents had already been parsed\" \nsituation? Is it because we've generated a huge list of \"I have it\" \nobjects when pulling? That would explain it..\n\n\t\tLinus\n"},{"id":"17363","messageId":"20060309102052.GD18478@smurf.noris.de","threadId":"3603","inReplyTo":"Pine.LNX.4.64.0603082144450.32577@g5.osdl.org","subject":"Re: [PATCH] Don't recurse into parents marked uninteresting.","fromName":"","fromEmail":"smurf@smurf.noris.de","sentAt":"2006-03-09T10:20:52Z","receivedAt":"2006-03-09T10:20:52Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nLinus Torvalds:\n> So what was it that triggered this \"parents had already been parsed\" \n> situation? Is it because we've generated a huge list of \"I have it\" \n> objects when pulling? That would explain it..\n> \nSomething like that. I've converted a large number of older heads\n(ranging from a few months to a few years) from $EVIL_SCM to git,\nand tried to push them up to our main repository, which contains the\ncurrent development.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\n:read-only user: n. Describes a {luser} who uses computers almost\n   exclusively for reading Usenet, bulletin boards, and/or email, rather\n   than writing code or purveying useful information. See {twink},\n   {terminal junkie}, {lurker}.\n"}]}