LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-12-2011, 07:16 PM   #1
dtustudy68
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Rep: Reputation: 0
What is meaning of "has pages locked into memory (for real-time and custom IO) " ?


From ps aux I found that the program's stat is SL, it means :

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

What does this mean ?
How to avoid this ?

Thanks
 
Old 05-12-2011, 09:23 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,231

Rep: Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071
Let's talk about the computer hardware.

As in ... the physical chips that actually handle the task of taking bytes of data from that cable that's coming in from your disk drive, and placing those bytes (somewhere...) in the memory of your computer.

Those chips actually do the physical transfer, through a bit of magick called "DMA = Direct Memory Access." The transfer doesn't involve the CPU ... until the chips interrupt the CPU to notify it that the transfer is done.

If you've got a chip moving data into a particular place in the computer's memory, then you'd better be very sure that this particular block of memory is not going to be used for any other purpose by any bit of software. And that, in short, is precisely what "locking pages" is all about. The pages are locked in place, then commands are issued to the chips, and the pages are unlocked after the chips interrupt us to say that the transfer has been completed.

So it goes ...
 
Old 05-13-2011, 01:08 PM   #3
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by dtustudy68 View Post
has pages locked into memory (for real-time and custom IO)
What does this mean ?
It means the program has asked the kernel to keep those pages in memory. It is quite usual, if the program does time-sensitive I/O -- for example, if it streams important data to or from a disk, or a peripheral device like a sensor or something.

Like sundialsvcs wrote in the above post, in some cases (when using DMA to transfer data to or from a device) locking the memory is required for correct operation.

Quote:
Originally Posted by dtustudy68 View Post
How to avoid this ?
Normally there is no reason to try to avoid that. Most distributions set sensible memory locking limits by default.

If you insist, set the memlock resource limit. You can use the pam_limits module to set default limits; see man limits.conf and man pam_limits. You can also use the ulimit built-in command provided by most shells, to set the limit for a specific program before running that program:
Code:
ulimit -l 64
/usr/bin/whatever-command arguments...
which sets the limit at 64*1024 bytes (65536 bytes). See for example man bash-builtins to see the usage for ulimit when using Bash.

You can run
Code:
ulimit -a
in a newly started shell to see what limits are set by default. (Note that for system services, the limits are usually different.)

Finally, if the limit is set too low, programs that need to lock memory will usually refuse to run. If you don't want them to run, just disable them directly.

Last edited by Nominal Animal; 05-13-2011 at 01:09 PM.
 
  


Reply

Tags
locked, pages


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
capped-memory on zones: what is "locked memory"? AlucardZero Solaris / OpenSolaris 1 06-21-2010 04:12 PM
convert unix time to "real" time logicalfuzz Linux - Software 4 01-28-2010 12:33 PM
please explain meaning of "Good Memory Size" in AIX nagendrar AIX 1 12-17-2009 09:13 AM
How to display "real time" view of process running in openSUSE 10.1 ramirez.alex Suse/Novell 6 02-27-2007 03:48 AM
i got a problem: "REAL TIME CLOCK DRIVER v1.10e" ERROR Tyfn Linux - Software 1 02-01-2006 09:26 PM


All times are GMT -5. The time now is 03:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration