dim: Move all rerere updating into helpers
PATCH 1/2 dim: Move all rerere updating into helpers
Just prep work.
--- dim | 61 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 27 deletions(-)
dim +34 -27
@@ -493,11 +493,41 @@ function rr_cache_dir function update_rerere_cache { - cd $DIM_PREFIX/drm-rerere/ + echo -n "Updating rerere cache... " + git pull mkdir $(rr_cache_dir) &> /dev/null || true - cp rr-cache/* $(rr_cache_dir) -r + cp rr-cache/* $(rr_cache_dir) -r --preserve=timestamps cd - > /dev/null + + echo "Done." +} + +function commit_rerere_cache +{ + echo -n "Updating rerere cache... " + + cd $DIM_PREFIX/drm-rerere/ + if git_is_current_branch rerere-cache ; then + remote=$(branch_to_remote rerere-cache) + + git pull >& /dev/null + rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true + cp $(rr_cache_dir)/* rr-cache -r + git add ./*.patch >& /dev/null || true + git add rr-cache/* > /dev/null + git rm rr-cache/rr-cache &> /dev/null || true + if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then + echo -n "New commit. " + else + echo -n "Nothing changed. " + fi + echo -n "Pushing rerere cache... " + git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done." + else + echo "Fail: Branch setup for the rerere-cache is borked." + exit 1 + fi } function dim_revert_rerere
@@ -528,9 +558,7 @@ function dim_rebuild_tip warn_or_fail "integration configuration file $integration_config not commited" fi - echo -n "Updating rerere cache... " - update_rerere_cache >& /dev/null - echo "Done." + update_rerere_cache echo -n "Reloading $integration_config... " read_integration_config
@@ -618,28 +646,7 @@ function dim_rebuild_tip echo -n "Pushing $integration_branch... " git push $DRY_RUN $remote +HEAD >& /dev/null && echo "Done." - echo -n "Updating rerere cache... " - cd $rerere - if git_is_current_branch rerere-cache ; then - remote=$(branch_to_remote rerere-cache) - - git pull >& /dev/null - rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true - cp $(rr_cache_dir)/* rr-cache -r - git add ./*.patch >& /dev/null || true - git add rr-cache/* > /dev/null - git rm rr-cache/rr-cache &> /dev/null || true - if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then - echo -n "New commit. " - else - echo -n "Nothing changed. " - fi - echo -n "Pushing rerere cache... " - git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done." - else - echo "Fail: Branch setup for the rerere-cache is borked." - exit 1 - fi + commit_rerere_cache } # additional patch checks before pushing, e.g. for r-b tags
Signature · 6 lines
2.13.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 dim: Try to gc the rr-cache
The problem is that we have a distributed cache - every committer has a copy. Which means even just a slight clock skew will make sure that a naive gc algorithm results in lots of thrashing around.
To fix this add a huge hysteresis: Only add files newer than 1 day, and only remove them when older than 60 days. As long as people have reasonable accurate clocks on their machines this should work.
A different problem is that we can't use filesystem timestamps (and hence can't use git rerere gc): When someone comes back from vacations and updates git rerere, all the files will have current timestamps, even when they've been pushed out weeks ago. To fix that, use the git log to judge old files to remove. Also, remove old files before adding new ones, to avoid confusion.
Also, we need to teach the cp -r to preserve timestamps, otherwise this won't work.
v2: Use git log to remove old files.
v3: Remove the debug uncommenting (Sean).
v4: Split out code movement and explain better what's going on (Jani).
--- dim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
dim +8 -2
@@ -513,9 +513,15 @@ function commit_rerere_cache git pull >& /dev/null rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true - cp $(rr_cache_dir)/* rr-cache -r + cp $(rr_cache_dir)/* rr-cache -r --preserve=timestamps git add ./*.patch >& /dev/null || true - git add rr-cache/* > /dev/null + for file in $(git ls-files); do + if ! git log --since="60 days ago" --name-only -- $file | grep $file &> /dev/null; then + git rm $file &> /dev/null + echo deleting $file + fi + done + find rr-cache/ -ctime -1 -type f -print0 | xargs -0 git add > /dev/null git rm rr-cache/rr-cache &> /dev/null || true if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then echo -n "New commit. "
Signature · 6 lines
2.13.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] dim: Try to gc the rr-cache
Quoted 15 lines · Daniel Vetter
The problem is that we have a distributed cache - every committer has a copy. Which means even just a slight clock skew will make sure that a naive gc algorithm results in lots of thrashing around.
To fix this add a huge hysteresis: Only add files newer than 1 day, and only remove them when older than 60 days. As long as people have reasonable accurate clocks on their machines this should work.
A different problem is that we can't use filesystem timestamps (and hence can't use git rerere gc): When someone comes back from vacations and updates git rerere, all the files will have current timestamps, even when they've been pushed out weeks ago. To fix that, use the git log to judge old files to remove. Also, remove old files before adding new ones, to avoid confusion.
Quoted 8 lines
Also, we need to teach the cp -r to preserve timestamps, otherwise this won't work.
v2: Use git log to remove old files.
v3: Remove the debug uncommenting (Sean).
v4: Split out code movement and explain better what's going on (Jani).
Yeah, much easier to digest with the split.
Quoted 35 lines
Signed-off-by Daniel Vetter <[email protected]>--- dim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)dim +8
-2@@ -513,9 +513,15 @@ function commit_rerere_cache git pull >& /dev/null rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true - cp $(rr_cache_dir)/* rr-cache -r + cp $(rr_cache_dir)/* rr-cache -r --preserve=timestamps git add ./*.patch >& /dev/null || true - git add rr-cache/* > /dev/null + for file in $(git ls-files); do + if ! git log --since="60 days ago" --name-only -- $file | grep $file &> /dev/null; then + git rm $file &> /dev/null + echo deleting $file + fi + done + find rr-cache/ -ctime -1 -type f -print0 | xargs -0 git add > /dev/null git rm rr-cache/rr-cache &> /dev/null || true if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then echo -n "New commit. "Signature · 6 lines
2.13.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] dim: Try to gc the rr-cache
Quoted 21 lines · Sean Paul
Quoted 20 lines · Daniel Vetter
The problem is that we have a distributed cache - every committer has a copy. Which means even just a slight clock skew will make sure that a naive gc algorithm results in lots of thrashing around.
To fix this add a huge hysteresis: Only add files newer than 1 day, and only remove them when older than 60 days. As long as people have reasonable accurate clocks on their machines this should work.
A different problem is that we can't use filesystem timestamps (and hence can't use git rerere gc): When someone comes back from vacations and updates git rerere, all the files will have current timestamps, even when they've been pushed out weeks ago. To fix that, use the git log to judge old files to remove. Also, remove old files before adding new ones, to avoid confusion.
Also, we need to teach the cp -r to preserve timestamps, otherwise this won't work.
v2: Use git log to remove old files.
Quoted 7 lines
Quoted 3 lines
v3: Remove the debug uncommenting (Sean).
v4: Split out code movement and explain better what's going on (Jani).
Yeah, much easier to digest with the split.
Reviewed-by Sean Paul <[email protected]>
I'll trust that and hope for the best. ;)
BR,
Jani.
Quoted 36 lines
Quoted 36 lines
Signed-off-by Daniel Vetter <[email protected]>--- dim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)dim +8
-2@@ -513,9 +513,15 @@ function commit_rerere_cache git pull >& /dev/null rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true - cp $(rr_cache_dir)/* rr-cache -r + cp $(rr_cache_dir)/* rr-cache -r --preserve=timestamps git add ./*.patch >& /dev/null || true - git add rr-cache/* > /dev/null + for file in $(git ls-files); do + if ! git log --since="60 days ago" --name-only -- $file | grep $file &> /dev/null; then + git rm $file &> /dev/null + echo deleting $file + fi + done + find rr-cache/ -ctime -1 -type f -print0 | xargs -0 git add > /dev/null git rm rr-cache/rr-cache &> /dev/null || true if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then echo -n "New commit. "Signature · 6 lines
2.13.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] dim: Try to gc the rr-cache
Quoted 24 lines · Jani Nikula
Quoted 23 lines · Sean Paul
Quoted 22 lines · Daniel Vetter
The problem is that we have a distributed cache - every committer has a copy. Which means even just a slight clock skew will make sure that a naive gc algorithm results in lots of thrashing around.
To fix this add a huge hysteresis: Only add files newer than 1 day, and only remove them when older than 60 days. As long as people have reasonable accurate clocks on their machines this should work.
A different problem is that we can't use filesystem timestamps (and hence can't use git rerere gc): When someone comes back from vacations and updates git rerere, all the files will have current timestamps, even when they've been pushed out weeks ago. To fix that, use the git log to judge old files to remove. Also, remove old files before adding new ones, to avoid confusion.
Also, we need to teach the cp -r to preserve timestamps, otherwise this won't work.
v2: Use git log to remove old files.
v3: Remove the debug uncommenting (Sean).
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
v4: Split out code movement and explain better what's going on (Jani).
Yeah, much easier to digest with the split.
Reviewed-by Sean Paul <[email protected]>I'll trust that and hope for the best. ;)
Pushed and asked everyone I managed to ping over irc to upgrade. Let's see how often we have to push out a revert until the old stuff is dead for good (I already screwed up twice locally ...).
-Daniel
Quoted 44 lines
BR,
Jani.Quoted 36 lines
Quoted 36 lines
Signed-off-by Daniel Vetter <[email protected]>--- dim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)dim +8
-2@@ -513,9 +513,15 @@ function commit_rerere_cache git pull >& /dev/null rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true - cp $(rr_cache_dir)/* rr-cache -r + cp $(rr_cache_dir)/* rr-cache -r --preserve=timestamps git add ./*.patch >& /dev/null || true - git add rr-cache/* > /dev/null + for file in $(git ls-files); do + if ! git log --since="60 days ago" --name-only -- $file | grep $file &> /dev/null; then + git rm $file &> /dev/null + echo deleting $file + fi + done + find rr-cache/ -ctime -1 -type f -print0 | xargs -0 git add > /dev/null git rm rr-cache/rr-cache &> /dev/null || true if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then echo -n "New commit. "Signature · 6 lines
2.13.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Daniel Vetter
Just prep work.
Signed-off-by Daniel Vetter <[email protected]>
Quoted 100 lines
--- dim | 61 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 27 deletions(-)dim +34
-27@@ -493,11 +493,41 @@ function rr_cache_dir function update_rerere_cache { - cd $DIM_PREFIX/drm-rerere/ + echo -n "Updating rerere cache... " + git pull mkdir $(rr_cache_dir) &> /dev/null || true - cp rr-cache/* $(rr_cache_dir) -r + cp rr-cache/* $(rr_cache_dir) -r --preserve=timestamps cd - > /dev/null + + echo "Done." +} + +function commit_rerere_cache +{ + echo -n "Updating rerere cache... " + + cd $DIM_PREFIX/drm-rerere/ + if git_is_current_branch rerere-cache ; then + remote=$(branch_to_remote rerere-cache) + + git pull >& /dev/null + rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true + cp $(rr_cache_dir)/* rr-cache -r + git add ./*.patch >& /dev/null || true + git add rr-cache/* > /dev/null + git rm rr-cache/rr-cache &> /dev/null || true + if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then + echo -n "New commit. " + else + echo -n "Nothing changed. " + fi + echo -n "Pushing rerere cache... " + git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done." + else + echo "Fail: Branch setup for the rerere-cache is borked." + exit 1 + fi } function dim_revert_rerere@@ -528,9 +558,7 @@ function dim_rebuild_tip warn_or_fail "integration configuration file $integration_config not commited" fi - echo -n "Updating rerere cache... " - update_rerere_cache >& /dev/null - echo "Done." + update_rerere_cache echo -n "Reloading $integration_config... " read_integration_config@@ -618,28 +646,7 @@ function dim_rebuild_tip echo -n "Pushing $integration_branch... " git push $DRY_RUN $remote +HEAD >& /dev/null && echo "Done." - echo -n "Updating rerere cache... " - cd $rerere - if git_is_current_branch rerere-cache ; then - remote=$(branch_to_remote rerere-cache) - - git pull >& /dev/null - rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true - cp $(rr_cache_dir)/* rr-cache -r - git add ./*.patch >& /dev/null || true - git add rr-cache/* > /dev/null - git rm rr-cache/rr-cache &> /dev/null || true - if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then - echo -n "New commit. " - else - echo -n "Nothing changed. " - fi - echo -n "Pushing rerere cache... " - git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done." - else - echo "Fail: Branch setup for the rerere-cache is borked." - exit 1 - fi + commit_rerere_cache } # additional patch checks before pushing, e.g. for r-b tagsSignature · 6 lines
2.13.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx