[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r18692 - gnunet/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r18692 - gnunet/src/fs |
Date: |
Mon, 19 Dec 2011 16:52:21 +0100 |
Author: grothoff
Date: 2011-12-19 16:52:21 +0100 (Mon, 19 Dec 2011)
New Revision: 18692
Modified:
gnunet/src/fs/gnunet-service-fs_cp.c
gnunet/src/fs/gnunet-service-fs_cp.h
gnunet/src/fs/gnunet-service-fs_pr.c
Log:
block data migration based on lowest discarded expiration of content in the
datastore to avoid wasting bandwidth on migrating content that is just
instantly discarded again anyway
Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c 2011-12-19 15:02:56 UTC (rev
18691)
+++ gnunet/src/fs/gnunet-service-fs_cp.c 2011-12-19 15:52:21 UTC (rev
18692)
@@ -1710,12 +1710,11 @@
*/
void
GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp,
- struct GNUNET_TIME_Relative block_time)
+ struct GNUNET_TIME_Absolute block_time)
{
- if (GNUNET_TIME_absolute_get_remaining (cp->last_migration_block).rel_value >
- block_time.rel_value)
+ if (cp->last_migration_block.abs_value > block_time.abs_value)
{
-#if DEBUG_FS && 0
+#if DEBUG_FS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Migration already blocked for another %llu ms\n",
(unsigned long long)
@@ -1726,9 +1725,9 @@
}
#if DEBUG_FS && 0
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %llu
ms\n",
- (unsigned long long) block_time.rel_value);
+ (unsigned long long) GNUNET_TIME_absolute_get_remaining
(block_time).rel_value);
#endif
- cp->last_migration_block = GNUNET_TIME_relative_to_absolute (block_time);
+ cp->last_migration_block = block_time;
if (cp->migration_pth != NULL)
GSF_peer_transmit_cancel_ (cp->migration_pth);
cp->migration_pth =
Modified: gnunet/src/fs/gnunet-service-fs_cp.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.h 2011-12-19 15:02:56 UTC (rev
18691)
+++ gnunet/src/fs/gnunet-service-fs_cp.h 2011-12-19 15:52:21 UTC (rev
18692)
@@ -140,10 +140,6 @@
*/
unsigned int pending_replies;
- /**
- * How many of the last blocks from migration were duplicates?
- */
- unsigned int migration_duplication;
};
@@ -339,7 +335,7 @@
*/
void
GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp,
- struct GNUNET_TIME_Relative block_time);
+ struct GNUNET_TIME_Absolute block_time);
/**
Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c 2011-12-19 15:02:56 UTC (rev
18691)
+++ gnunet/src/fs/gnunet-service-fs_pr.c 2011-12-19 15:52:21 UTC (rev
18692)
@@ -899,34 +899,12 @@
const char *msg)
{
struct PutMigrationContext *pmc = cls;
- struct GNUNET_TIME_Relative block_time;
struct GSF_ConnectedPeer *cp;
- struct GSF_PeerPerformanceData *ppd;
cp = GSF_peer_get_ (&pmc->origin);
- if ((GNUNET_OK != success) && (GNUNET_NO == pmc->requested))
- {
- /* block migration for a bit... */
- if (NULL != cp)
- {
- ppd = GSF_get_peer_performance_data_ (cp);
- ppd->migration_duplication++;
- block_time =
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
- 5 * ppd->migration_duplication +
- GNUNET_CRYPTO_random_u32
- (GNUNET_CRYPTO_QUALITY_WEAK, 5));
- GSF_block_peer_migration_ (cp, block_time);
- }
- }
- else
- {
- if (NULL != cp)
- {
- ppd = GSF_get_peer_performance_data_ (cp);
- ppd->migration_duplication = 0; /* reset counter */
- }
- }
+ if ((GNUNET_OK != success) && (GNUNET_NO == pmc->requested) &&
(min_expiration.abs_value > 0)&&
+ (NULL != cp) )
+ GSF_block_peer_migration_ (cp, min_expiration);
GNUNET_free (pmc);
/* on failure, increase the put load dramatically */
if (NULL != datastore_put_load)
@@ -1564,7 +1542,7 @@
GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_WEAK,
(unsigned int) (60000 * putl * putl)));
- GSF_block_peer_migration_ (cp, block_time);
+ GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute
(block_time));
}
return GNUNET_OK;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r18692 - gnunet/src/fs,
gnunet <=