[Linux-hls-devel] HLS errors appearing with cpu reservations
Status: Pre-Alpha
Brought to you by:
lucabe
|
From: Paul K. <pko...@au...> - 2003-08-28 09:53:29
|
Hi Luca (& John),
I'm perservering with HLS but still having limited success. In addition
to the HLS gensched patch to 2.4.18, I've also applied RML's variable-hz
(HZ=3D1000), preemption and lock breaking patches.
I compiled a monolithic module using=20
make CLI=3D1 INT_SCHED=3D1 CREATE=3D1 MULDIV=3D1 DEBUG=3D1
I'm seeing the following messages in /var/log/messages:
HLS MP initializing (HLS_DBG_PRINT_LEVEL =3D 1).
[-879068745], 1154 : sched 'ROOT' registered in slot 0
[-802493633], 1154 : sched 'JOIN' registered in slot 1
[-725930209], 1154 : sched 'TH' registered in slot 2
[-652093576], 1154 : sched 'RR' registered in slot 3
[-578256736], 1154 : sched 'PS' registered in slot 4
[-504418000], 1154 : sched 'RES' registered in slot 5
ProcFSed rr1 RR root
Creating rr1 of type RR and father root
ProcFSed res1 RES rr1
Creating res1 of type RES and father rr1
ProcFSed rr2 RR rr1
Creating rr2 of type RR and father rr1
ProcFSed ps1 PS rr1
Creating ps1 of type PS and father rr1
already PRIVATE_DATA !=3D NULL???
already PRIVATE_DATA !=3D NULL???
HLS Error: 1168 has private_data =3D NULL???
HLS Error: 1167 has private_data =3D NULL???
HLS Error: 1166 has private_data =3D NULL???
The last three relate to some experiments with John's hourglass program.
I'm trying to verify that CPU reservations are working with the kernel
I'm using and rather than using my real-time application I thought I'd
try hourglass.
I'm not much of a programmer but I looked at the hourglass code and
wrote a make_res_hls() function for HLS CPU reservations (see below). I
then modified hourglass.h, work.c to call this when WITH_HLS was
defined.
#include <hourglass.h>
#include "/usr/src/hls/include/sched.h"
#include "/usr/src/hls/include/hls.h"
#include "/usr/src/hls/include/rsv.h"
#include <signal.h>
#define MAX_SETS 100
struct sched_param *sp =3D NULL;
struct hls_param *hlsp =3D NULL;
struct CPU_RESERVATION *rsv =3D NULL;
=20
void make_res_hls (us_time amount,=20
us_time period,
int which,
pthread_t thrd)
{
int res;
if (!sp) {
sp =3D (struct sched_param *) xmalloc (MAX_SETS *=20
sizeof (struct sched_param));
memset (sp, 0, MAX_SETS * sizeof (struct sched_param));
hlsp =3D (struct hls_param *) xmalloc (MAX_SETS * sizeof (struct
hls_param));
memset (hlsp, 0, MAX_SETS * sizeof (struct hls_param));
rsv =3D (struct CPU_RESERVATION *) xmalloc=20
(MAX_SETS * sizeof (struct CPU_RESERVATION));
memset (rsv, 0, MAX_SETS * sizeof (struct CPU_RESERVATION)); =20
}
/*
printf("--- CPU reservation for thread %d (%ld)\n",which,thrd);
printf("amount =3D %lf, period =3D %lf, which =3D %d
(%d)\n",amount,period,which,
thrd);
printf("sp[which] =3D 0x%X\n",&sp[which]);
printf("hlsp[which] =3D 0x%X\n",&hlsp[which]);
printf("rsv[which] =3D 0x%X\n",&rsv[which]);
*/
printf ("thread %d res: amount =3D %d ms\n",=20
which, ((int)amount)/1000);
printf ("thread %d res: period =3D %d ms\n",
which, ((int)period)/1000);
sp[which].sched_size =3D sizeof(struct hls_param);
sp[which].sched_p =3D &hlsp[which];
hlsp[which].signature =3D HLS_SIGNATURE;
hlsp[which].command =3D 0;
hlsp[which].scheduler =3D "res1";
hlsp[which].sched_data_size =3D sizeof (struct CPU_RESERVATION);
hlsp[which].sched_data =3D &rsv[which];
rsv[which].Amount =3D (int)amount*10;
rsv[which].Period =3D (int)period*10;
rsv[which].Soft =3D 0;
res =3D pthread_setschedparam(thrd, SCHED_HLS, &sp[which]);
=20
if (res < 0) {
printf ("oops: could not create CPU reservation for thread %d
(%ld)\n",=20
which, thrd);
exit (-1);
}
}=20
I'm not seeing what I expected to see in the hourglass output when one
of the tasks has a cpu reservation: instead all hourglass threads get
about the same work done; they get ~40ms of CPU time each in a round
robin fashion.
Best regards,
Paul Koufalas
Senior Communications Engineer
AUSPACE Limited
Level 1 Innovation House
Technology Park MAWSON LAKES SA 5095
AUSTRALIA
T +61 8 8260 8236
F +61 8 8260 8226
M +61 404 837 122
www.auspace.com.au
This email is for the intended addressee only. If you have received this
e-mail in error, you are requested to contact the sender and delete the
e-mail. Nothing in this email shall bind Auspace Limited in any contract
or obligation.
|