mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: locking pages into a processes` working set
@ 2004-03-27 18:41 Carl Spalletta
  0 siblings, 0 replies; 2+ messages in thread
From: Carl Spalletta @ 2004-03-27 18:41 UTC (permalink / raw)
  To: linux-kernel

> I have been trying to lock pages down so I can get
> a stable bench-mark without a bunch of paging.
> I have tried mlock(), mlockall(), etc., but both
> the RSS and SIZE entries shown by `top` vary all
> over the place when the process is active.

  Did you check the return value from mlock?
  Did you check the kernel source to make sure no cases have been
left out of the manpage?
  Have you taken account of the "imbedded" arch you're using?
  Have you checked the source for top and verified that the numbers
really mean what you suppose?
  Have you considered using some other tool for measurement or rolling
your own?






__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

^ permalink raw reply	[flat|nested] 2+ messages in thread
* locking pages into a processes` working set
@ 2004-03-26 14:19 Richard B. Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard B. Johnson @ 2004-03-26 14:19 UTC (permalink / raw)
  To: Linux kernel


I have been trying to lock pages down so I can get
a stable bench-mark without a bunch of paging.
I have tried mlock(), mlockall(), etc., but both
the RSS and SIZE entries shown by `top` vary all
over the place when the process is active.

`strace` of an attempt to keep some shared memory
resident. It seems to work as far as `strace`
shows.

munmap(0x400cc000, 4096)                = 0
shmget(4277009102, 1052672, IPC_CREAT|IPC_EXCL|0x180|0600) = 425984
shmctl(425984, IPC_STAT, 0xbffff698)    = 0
shmat(425984, 0, 0)                     = 0x400cc000
shmctl(425984, IPC_RMID, 0xbffff698)    = 0
mlock(0x400cc000)                       = 0

However, it doesn't.

Also, there are bugs in `strace`. This version (4.2) doesn't show
the length parameter passed to mlock() and the version distributed
with RH (4.4) shows two '0's instead of the length parameter.

Maybe mlock() and friends don't prevent paging, but
only prevent the pages from being written to swap?
Could somebody tell me how to keep memory from being
paged, i.e., in the processes` working-set all the time.

I have an application on an imbedded system that almost
works. It's frustrating. If I could keep the application's
pages resident it would work fine. If I mmap physical pages
the kernel doesn't know about, it works fine. But if I
try to do more "standard" stuff and use shared RAM, the
application gets far behind the data-rate and I'm screwed.

The kernel version is 2.4.24. Maybe it's broken?

Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-27 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-27 18:41 locking pages into a processes` working set Carl Spalletta
  -- strict thread matches above, loose matches on Subject: below --
2004-03-26 14:19 Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®