Operating System - Tru64 Unix
1752810 Members
5871 Online
108789 Solutions
New Discussion юеВ

Meaning of 'L' in ps state output

 
Orjan Petersson
Frequent Advisor

Meaning of 'L' in ps state output

Hi,
what is the meaning of 'L' in the 2nd position of the process state field as displayed by ps?
$ ps -e -o state,cmd|grep /init
SL /sbin/init -a

"man ps" seems to be silent on that particular issue.
8 REPLIES 8
Hein van den Heuvel
Honored Contributor

Re: Meaning of 'L' in ps state output

L - has pages locked into memory (for real-time and custom IO)

Acccording to:

http://www.linofee.org/~jel/develop/ps/ps.html#procstatecodes

Found through:

Google:

+tru64 +ps +"process state"

Orjan Petersson
Frequent Advisor

Re: Meaning of 'L' in ps state output

That page seems to be for some Linux version so I don't know how applicable it is to Tru64. It says for example that state 'D' is 'Uninterruptible sleep (usually IO)' but on Tru64 an uninterruptible sleeping process has state 'U'.
Rani sawade
Occasional Advisor

Re: Meaning of 'L' in ps state output

Hi,
'L' represents the swap state of process/task. Unswappable tasks(ie tasks locked in memory) are denoted by 'L'.

Regards,
Rani.


Orjan Petersson
Frequent Advisor

Re: Meaning of 'L' in ps state output

This was the second answer claiming that 'L' means "locked into memory".
If that is the case, I suppose an 'L' should show up for a process that has called plock(PROCLOC) but that is not the case. (I just tried it on Tru64 5.1B PK2).
Do I miss something here?
Venkatesh BL
Honored Contributor

Re: Meaning of 'L' in ps state output

Basically, 'L' means that the process cannot be swapped out (as mentioned by other folks). This information is obtained by ps through table() calls. The particular flag is "TI_UNSWAPPABLE" whose definition can be found in sys/table.h header file.

One app that I know of which uses plock() is collect. But, I don't see that listed as 'L'. So, I think there is a slight difference.

Orjan Petersson
Frequent Advisor

Re: Meaning of 'L' in ps state output

I found the 'L' flag documented in the "System Configuration and Tuning" guide where it says:
"Process has been locked into memory and
cannot be swapped out."

Some more testing shows that mlockall() triggers the 'L' flag, but, as I said before, plock() does not.

So the doc seems incomplete in the sense that when an 'L' is shown, it indicates that the process is locked into memory, but not all processes locked into memory show up with 'L'.
Bug or feature?
Venkatesh BL
Honored Contributor

Re: Meaning of 'L' in ps state output

I think looking at both the manpages (mlockall and plock) should answer your question.

plock() locks text and/or data.
mlockall() locks *all* pages. I think this includes heap as well.
Orjan Petersson
Frequent Advisor

Re: Meaning of 'L' in ps state output

It does not seem to be that easy. Doing only mlockall(MCL_FUTURE) which locks only pages that will be allocated in the future also triggers the 'L' flag.