From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <50129F1F.5030205@xenomai.org> Date: Fri, 27 Jul 2012 16:01:03 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <50129907.5040306@siemens.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] cpu usage List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederik Bayart Cc: xenomai@xenomai.org On 07/27/2012 03:58 PM, Frederik Bayart wrote: > The use case is : we are using an i7 processor. We noticed that > internally, the processor is shifting frequency to minimize idle time. > (This is not done by linux, we used cpufreq to avoid that but there is > still some software on the processor that is shifting frequency). This > has as consequence that the required rate of our realtime process, > which is a periodic task, becomes to fast for the processor. > To avoid downscaling of the cpu frequency, we had the idea to run > additionally a busywait loop at priority 0 so that the processor is > always running at 100%, there is no idle time and the frequency will > not scale down. > > We want only 1 core running at 100% for temperature reasons. Then simply put the busy loop in a task not running with real-time priority. A plain Linux task. You should also use the SCHED_IDLE policy in order to avoid it to delay other non real-time task. -- Gilles.