From mboxrd@z Thu Jan 1 00:00:00 1970 References: <877d9qho0c.fsf@xenomai.org> From: Philippe Gerum Subject: Re: [External] - Re: In-band Context Switch on oob_ioctl() call Date: Mon, 21 Feb 2022 18:32:29 +0100 In-reply-to: Message-ID: <87tucsf7l2.fsf@xenomai.org> MIME-Version: 1.0 Content-Type: text/plain List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Russell Johnson Cc: "xenomai@xenomai.org" Russell Johnson writes: > I verified this, and the thread is under the FIFO scheduling policy. > > CPU PID SCHED PRIO ISW CTXSW SYS RWA STAT TIMEOUT %CPU CPUTIME NAME > 9 12344 fifo 98 14 14 14 0 X - 0.0 00:000.289 evl_dma_thread:12100 > ^^^ Means "relaxed", in-band mode. So the thread does switch out of oob mode voluntarily for some reason. > - Russell > > -----Original Message----- > From: Philippe Gerum > Sent: Saturday, February 19, 2022 8:29 AM > To: Russell Johnson > Cc: xenomai@xenomai.org > Subject: [External] - Re: In-band Context Switch on oob_ioctl() call > > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. > > > Russell Johnson via Xenomai writes: > >> Hello, >> >> I have added the oob_ioctl file descriptor to my driver, and I have >> made sure that I call the necessary evl functions in the open() >> function in the driver as well. I have a test app in userspace that is >> simply opening the driver and issuing an oob_ioctl every second. What >> I am seeing in the output from "evl ps -l" is that the "ISW" and >> "CTXSW" fields are incrementing with every oob_ioctl call. I added in >> the O_OOB flag to my open call, and I am still seeing the same >> behavior. I don't get why it would be switching to in-band every time >> the oob_ioctl() is called. Any ideas on what I could be doing wrong? >> >> Thanks, >> Russell > > It looks like the calling thread is undergoing the so-called weak scheduling policy, see [1]. > > [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__evlproject.org_core_user-2Dapi_scheduling_-23SCHED-5FWEAK&d=DwIBAg&c=zeCCs5WLaN-HWPHrpXwbFoOqeS0G3NH2_2IQ_bzV13g&r=-WrlDvHLmZCY7pl-EOIRaJl9uZvKbG-G8KkkUcIDh2F7Jr6SYxS_pdf-orjkExnI&m=0Ytm_g4N1lnCdUHifknw-Mckrpzq2gJlG2oKvQ543DBHhDfXPgbp5TWf-00etMCB&s=HKJUpkhAExaAqj5CUY7bze1EqRKRy8x6RHRKCl4OWH4&e= -- Philippe.