[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17618 - gnunet/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17618 - gnunet/src/fs |
Date: |
Wed, 19 Oct 2011 22:07:13 +0200 |
Author: grothoff
Date: 2011-10-19 22:07:13 +0200 (Wed, 19 Oct 2011)
New Revision: 17618
Modified:
gnunet/src/fs/gnunet-service-fs_pe.c
gnunet/src/fs/gnunet-service-fs_pr.c
gnunet/src/fs/perf_gnunet_service_fs_p2p.c
Log:
fixing 1830
Modified: gnunet/src/fs/gnunet-service-fs_pe.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pe.c 2011-10-19 18:04:01 UTC (rev
17617)
+++ gnunet/src/fs/gnunet-service-fs_pe.c 2011-10-19 20:07:13 UTC (rev
17618)
@@ -229,25 +229,25 @@
total_delay * 1000LL / plan_count, GNUNET_NO);
prd = GSF_pending_request_get_data_ (rp->prl_head->pr);
// FIXME: calculate 'rp->priority'!
-#if 0
- if (rp->transmission_counter < 32)
+ if (rp->transmission_counter < 8)
delay =
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
- 1LL << rp->transmission_counter);
- else
- delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX);
-#else
- if (rp->transmission_counter < 32)
- delay =
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
- rp->transmission_counter);
+ rp->transmission_counter);
else if (rp->transmission_counter < 32)
delay =
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
- 32 + (1LL << rp->transmission_counter));
+ 8 + (1LL << (rp->transmission_counter -
8)));
else
- delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX);
-#endif
+ delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
+ 8 + (1LL << 24));
+ delay.rel_value = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
+ delay.rel_value + 1);
+ if (rp->transmission_counter != 0)
+ delay.rel_value += TTL_DECREMENT;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Considering (re)transmission number %u in %llu ms\n",
+ (unsigned int) rp->transmission_counter,
+ (unsigned long long) delay.rel_value);
rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay);
#if DEBUG_FS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c 2011-10-19 18:04:01 UTC (rev
17617)
+++ gnunet/src/fs/gnunet-service-fs_pr.c 2011-10-19 20:07:13 UTC (rev
17618)
@@ -176,6 +176,12 @@
/**
+ * Size of the datastore queue we assume for common requests.
+ * Determined based on the network quota.
+ */
+static unsigned int datastore_queue_size;
+
+/**
* Heap with the request that will expire next at the top. Contains
* pointers of type "struct PendingRequest*"; these will *also* be
* aliased from the "requests_by_peer" data structures and the
@@ -1225,7 +1231,7 @@
/* queue priority */ ,
(0 !=
(GSF_PRO_PRIORITY_UNLIMITED &
- pr->public_data.options)) ? UINT_MAX : 16
+ pr->public_data.options)) ? UINT_MAX :
datastore_queue_size
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
@@ -1264,7 +1270,7 @@
/* queue priority */ ,
(0 !=
(GSF_PRO_PRIORITY_UNLIMITED &
- pr->public_data.options)) ? UINT_MAX : 16
+ pr->public_data.options)) ? UINT_MAX :
datastore_queue_size
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
@@ -1323,7 +1329,7 @@
/* queue priority */ ,
(0 !=
(GSF_PRO_PRIORITY_UNLIMITED & pr->
- public_data.options)) ? UINT_MAX : 16
+ public_data.options)) ? UINT_MAX :
datastore_queue_size
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
@@ -1399,7 +1405,7 @@
/* queue priority */ ,
(0 !=
(GSF_PRO_PRIORITY_UNLIMITED & pr->
- public_data.options)) ? UINT_MAX : 16
+ public_data.options)) ? UINT_MAX :
datastore_queue_size
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
@@ -1547,6 +1553,8 @@
void
GSF_pending_request_init_ ()
{
+ unsigned long long bps;
+
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (GSF_cfg, "fs",
"MAX_PENDING_REQUESTS",
@@ -1557,6 +1565,22 @@
("Configuration fails to specify `%s', assuming default
value."),
"MAX_PENDING_REQUESTS");
}
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_number (GSF_cfg,
+ "core",
+ "TOTAL_QUOTA_OUT",
+ &bps))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _
+ ("Configuration fails to specify `%s', assuming default
value."),
+ "TOTAL_QUOTA_IN");
+ bps = 65536;
+ }
+ /* queue size should be #queries we can have pending and satisfy within
+ a carry interval: */
+ datastore_queue_size = bps * GNUNET_CONSTANTS_MAX_BANDWIDTH_CARRY_S /
DBLOCK_SIZE;
+
active_to_migration =
GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, "FS", "CONTENT_CACHING");
datastore_put_load = GNUNET_LOAD_value_init (DATASTORE_LOAD_AUTODECLINE);
Modified: gnunet/src/fs/perf_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/perf_gnunet_service_fs_p2p.c 2011-10-19 18:04:01 UTC (rev
17617)
+++ gnunet/src/fs/perf_gnunet_service_fs_p2p.c 2011-10-19 20:07:13 UTC (rev
17618)
@@ -32,7 +32,7 @@
/**
* File-size we use for testing.
*/
-#define FILESIZE (1024 * 1024 * 10)
+#define FILESIZE (1024 * 1024 * 100)
/**
* How long until we give up on transmitting the message?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17618 - gnunet/src/fs,
gnunet <=