[Xenomai] Switching to secondary mode despite of use of mmap

Umair Ali ali.umair at tut.fi
Tue Dec 15 17:03:58 CET 2015


Thanks Gilles for the reply.

>  The slackspot trace you show only contains calls to timerfd_create
and socket. Yes, timerfd_create and socket cause a switch to
secondary mode.

The slackspot output file shows that socket and timerfd_create is called again and again. But i have used these two once and then in the "while loop" timer is read and packet is send. Does it mean that timerfd_create and socket is calling every time once the one loop finish and start other loop until while loop condition is satisfied. Is there any way i can avoid the transition to secondary mode without using timerfd_create and socket. Can i use cobalt kernel timers service direclty in user space. Please guide me thanks.

BR 
Ali
________________________________________
From: Gilles Chanteperdrix [gilles.chanteperdrix at xenomai.org]
Sent: Tuesday, December 15, 2015 3:59 PM
To: Umair Ali
Cc: xenomai at xenomai.org
Subject: Re: [Xenomai] Switching to secondary mode despite of use of mmap

On Tue, Dec 15, 2015 at 11:28:02AM +0000, Umair Ali wrote:
> Hello,
>
> I am reading a file of size 600 MB using the mmap function and
> mlockall(). My question is that is it possible that mmap has not
> loaded whole file in the memory and if the whole file is not
> loaded then is it changing to secondary mode while reading the
> file.

Unless you have not passed MCL_CURRENT | MCL_FUTURE to mlockall or
did not check mlockall return value and mlockall in fact failed, this
is impossible.

>The size of system heap is 256KB in the menuconfig for the
> compiling kernel.

The size of the system heap has nothing to do with mlockall.

> If the problem, i think, i have is true then how
> i can load the such big files using mmap. The output of slackspot
> is attached with this email. My system specs are Memory 3.1GiB and
> processor is intel P4 3.2GHz x 2.

The slackspot trace you show only contains calls to timerfd_create
and socket. Yes, timerfd_create and socket cause a switch to
secondary mode.

--
                                            Gilles.
https://click-hack.org



More information about the Xenomai mailing list