Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - aps Problems: (8 Items)
   
aps Problems  
Hi all,

yesterday I wanted to use aps for a emergency console login.

After finding out, that I must use the "aps" tool and not the "ap" tool, I was able to  setup a 10% emergency Partion 
for my console access.

# aps
                    +---- CPU Time ----+-- Critical Time --
Partition name   id | Budget |    Used | Budget |      Used
--------------------+------------------+-------------------
System            0 |    90% |   4.01% |  100ms |   0.000ms
Emergency         1 |    10% |  92.76% |  100ms |   0.000ms
--------------------+------------------+-------------------
Total               |   100% |  96.77% |
# 

Ok, after that I have created a simple program with a while(1) loop, to test the emergency access.

After Startin this tool with "on -Xaps=System -p40 looper &"
My emergency console was frozen.

First problem: devc-pty seems not to inherit the partition.
So I started it in the Emergency partion.

After that my emergency console was partly working.

"echo Walter" works.
But starting a process (e.g. pidin or uname -a) results in a frozen console.

After digging into this with a countinous "pidin -l sched", started before the looper,
I found the process, started from the emergency shell in this state:
 307226   1 (Loading)          Emergency             10r WAITPAGE    480400f4                

There seems to be priority inversions or better partition inversions with the service threads from procnto.

Are this known problems or do I miss something here ?

Kind Regards 
Michael

















 

Re: aps Problems  
 >After Startin this tool with "on -Xaps=System -p40 looper &"
 >My emergency console was frozen.

Was the shell you were using to execute the "on" command running in the System partition? If so, you shell should have 
locked up.

Try "on -Xaps=Emergency sh" first.

-ad

Michael Tasche wrote:
> Hi all,
> 
> yesterday I wanted to use aps for a emergency console login.
> 
> After finding out, that I must use the "aps" tool and not the "ap" tool, I was able to  setup a 10% emergency Partion 
for my console access.
> 
> # aps
>                     +---- CPU Time ----+-- Critical Time --
> Partition name   id | Budget |    Used | Budget |      Used
> --------------------+------------------+-------------------
> System            0 |    90% |   4.01% |  100ms |   0.000ms
> Emergency         1 |    10% |  92.76% |  100ms |   0.000ms
> --------------------+------------------+-------------------
> Total               |   100% |  96.77% |
> # 
> 
> Ok, after that I have created a simple program with a while(1) loop, to test the emergency access.
> 
> After Startin this tool with "on -Xaps=System -p40 looper &"
> My emergency console was frozen.
> 
> First problem: devc-pty seems not to inherit the partition.
> So I started it in the Emergency partion.
> 
> After that my emergency console was partly working.
> 
> "echo Walter" works.
> But starting a process (e.g. pidin or uname -a) results in a frozen console.
> 
> After digging into this with a countinous "pidin -l sched", started before the looper,
> I found the process, started from the emergency shell in this state:
>  307226   1 (Loading)          Emergency             10r WAITPAGE    480400f4                
> 
> There seems to be priority inversions or better partition inversions with the service threads from procnto.
> 
> Are this known problems or do I miss something here ?
> 
> Kind Regards 
> Michael
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post36758
> 

Re: aps Problems  
> 
>  >After Startin this tool with "on -Xaps=System -p40 looper &"
>  >My emergency console was frozen.
> 
> Was the shell you were using to execute the "on" command running in the System
>  partition? If so, you shell should have 
> locked up.

No,  the  emergency shell runs in the emergency partition.
And it does not lock up. You can type for example "export -p" or some other buildin command.

-Michael

> 
> Try "on -Xaps=Emergency sh" first.
> 
> -ad
> 
> Michael Tasche wrote:
> > Hi all,
> > 
> > yesterday I wanted to use aps for a emergency console login.
> > 
> > After finding out, that I must use the "aps" tool and not the "ap" tool, I 
> was able to  setup a 10% emergency Partion for my console access.
> > 
> > # aps
> >                     +---- CPU Time ----+-- Critical Time --
> > Partition name   id | Budget |    Used | Budget |      Used
> > --------------------+------------------+-------------------
> > System            0 |    90% |   4.01% |  100ms |   0.000ms
> > Emergency         1 |    10% |  92.76% |  100ms |   0.000ms
> > --------------------+------------------+-------------------
> > Total               |   100% |  96.77% |
> > # 
> > 
> > Ok, after that I have created a simple program with a while(1) loop, to test
>  the emergency access.
> > 
> > After Startin this tool with "on -Xaps=System -p40 looper &"
> > My emergency console was frozen.
> > 
> > First problem: devc-pty seems not to inherit the partition.
> > So I started it in the Emergency partion.
> > 
> > After that my emergency console was partly working.
> > 
> > "echo Walter" works.
> > But starting a process (e.g. pidin or uname -a) results in a frozen console.
> 
> > 
> > After digging into this with a countinous "pidin -l sched", started before 
> the looper,
> > I found the process, started from the emergency shell in this state:
> >  307226   1 (Loading)          Emergency             10r WAITPAGE    
> 480400f4                
> > 
> > There seems to be priority inversions or better partition inversions with 
> the service threads from procnto.
> > 
> > Are this known problems or do I miss something here ?
> > 
> > Kind Regards 
> > Michael
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > 
> > OSTech
> > http://community.qnx.com/sf/go/post36758
> > 
> 


Re: aps Problems  
Hi Michael,

Neutrino is a microkernel OS - in this case, what that means is that you still have "essential" services running in the 
System partition: for example, the disk controller driver.   When you try to run a command in your emergency partition, 
the shell must first (a) search the PATH for the command, then (b) load the binary into memory - both of which typically
 require disk access.   Since your disk controller driver is in the system partition running at a default priority of 21
, it is CPU starved and cannot answer the request from your emergency shell.

The details are a bit more complicated, though.  Yes, it is true that the message from your emergency partition will 
cause the answering disk controller driver thread to operate under the emergency partition's budget.  Unfortunately, the
 thread in the disk controller driver that actually responds to disk controller interrupts when an I/O event completes 
is separate from the threads that answer I/O requests for other processes, and thus it will NOT inherit the partition - 
leaving you stuck.

-Will
Re: aps Problems  
I find that the best thing to do is to start only the mircokernel, the essential services, and your Emergency console, 
all in the System partition. Once that is running fine, create your application partitions, and change the default 
partition to one of the new partitions. That way, the kernel services cannot be blocked by your while(1) test program.

- Ed
Re: aps Problems  
Hi Will,

thanks for answering, but I concidered the problems.
The system is a diskless embedded target with root filesystem per nfs.
I put the networking stuff in the Emergency partition, too.
First problem was devc-pty, which did not inherit the partion from the telnetd.
It runs in the System Partition at Prio 20. Why? There should not be an Irq inside devc-pty, right?

Ok, then I started devc-pty in the Emergency partition, but an "uname"  on the console will never come back. It is reply
 blocked waiting for procnto.
A simple "echo test" is working.

Where is the problem here?

-Michael
Attachment: Text Pidin.txt 5.52 KB
Re: aps Problems  
I have been through a similar scenario, trying to create an emergency partition, and ran into exactly the same problems.


In my experience, it works much better the other way round. I think in a way that a partition should 'encapsulate' wild 
processes. So, I create partitions for those process(es) that potentially run crazy on high priorities. The idea is that
 if it happens, the rest of the system still works. So, in other words, instead of emergency partition, create an 
application partition. Inside, start the problematic application.


- Malte
RE: aps Problems  
Sounds like something worth mentioning in the documentation. Would you
like to create a PR?


Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Malte Mundt [mailto:community-noreply@qnx.com] 
> Sent: Thursday, September 03, 2009 11:29 AM
> To: ostech-core_os
> Subject: Re: aps Problems
> 
> I have been through a similar scenario, trying to create an 
> emergency partition, and ran into exactly the same problems.
> 
> In my experience, it works much better the other way round. I 
> think in a way that a partition should 'encapsulate' wild 
> processes. So, I create partitions for those process(es) that 
> potentially run crazy on high priorities. The idea is that if 
> it happens, the rest of the system still works. So, in other 
> words, instead of emergency partition, create an application 
> partition. Inside, start the problematic application.
> 
> 
> - Malte
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post37273
> 
>