tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Very slow transfers to/from micro SD card on a RPi B+
Nobody having an idea about DIRHASH? I´ve also seen that tmpfs has the
same regression.
I corrected 2 minor flaws in my tool, if it´s useful to somebody:
------8<---------------------------------
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
int main(int argc, char **argv) {
struct timeval tv_start, tv_finish;
unsigned long duration;
int i;
char filename[16];
if (argc < 2) { printf("Usage: %s <count>\n", argv[0]); exit(1); }
int howmany = atoi(argv[1]);
for (i = 0; i < howmany; i++)
{
snprintf(filename, sizeof(filename), "%d", i);
gettimeofday(&tv_start, NULL);
int fd = open(filename, O_CREAT);
gettimeofday(&tv_finish, NULL);
close(fd);
duration = (tv_finish.tv_sec * 1000000 + tv_finish.tv_usec) -
(tv_start.tv_sec * 1000000 + tv_start.tv_usec);
printf("Duration: %lu\n", duration);
}
return 0;
}
2015-08-20 18:16 GMT+02:00 Stephan <stephanwib%googlemail.com@localhost>:
> 2015-08-19 15:51 GMT+02:00 Thor Lancelot Simon <tls%panix.com@localhost>:
>> We should be shipping with DIRHASH turned on.
>
>
> That´s it - top speed!
>
> /root/test/files> time seq 1 30000|xargs touch
> 1.05s real 0.03s user 0.84s system
>
> Is DIRHASH still considered experimental? It fixes one of NetBSD´s
> most annoying shortcomings.
>
> FreeBSD received dynamic memory allocation for DIRHASH which might be
> even better.
>
>
>
> (re-sending this as my editor intermittently distributes HTML mails)
>
>
>>
>> On Tue, Aug 18, 2015 at 04:19:57PM +0000, Michael van Elst wrote:
>>> stephanwib%googlemail.com@localhost (Stephan) writes:
>>>
>>> >This is from an amd64 server box with an aac raid controller.
>>>
>>> >/root/test/files> time seq 1 10000|xargs touch
>>> > 3.10s real 0.01s user 3.07s system
>>> >/root/test/files> rm *
>>> >/root/test/files> time seq 1 20000|xargs touch
>>> > 9.88s real 0.01s user 8.51s system
>>> >/root/test/files> rm *
>>> >/root/test/files> time seq 1 30000|xargs touch
>>> > 23.45s real 0.04s user 20.41s system
>>> >/root/test/files> time seq 1 40000|xargs touch
>>> > 43.35s real 0.05s user 38.32s system
>>>
>>> >That is clearly not linear.
>>>
>>> Each lookup is linear (unless you use DIRHASH), so the total
>>> time goes with n^2.
>>>
>>> --
>>> --
>>> Michael van Elst
>>> Internet: mlelstv%serpens.de@localhost
>>> "A potential Snark may lurk in every tree."
>>
>> --
>> Thor Lancelot Simon tls%panix.com@localhost
>>
>> "We cannot usually in social life pursue a single value or a single moral
>> aim, untroubled by the need to compromise with others." - H.L.A. Hart
Home |
Main Index |
Thread Index |
Old Index