All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: paging behavior in Linux
@ 2001-02-28 21:35 Manfred Spraul
  2001-02-28 21:54 ` David Mansfield
  0 siblings, 1 reply; 4+ messages in thread
From: Manfred Spraul @ 2001-02-28 21:35 UTC (permalink / raw)
  To: neelam_saboo; +Cc: linux-kernel

> 
> When I run my program on a readhat linux machine, I dont get results as 
> expected, work thread seems to be stuck when prefetch thread is waiting on 
> a page fault
>
That's a known problem:

The paging io for a process is controlled with a per-process semaphore.
The semaphore is held while waiting for the actual io. Thus the paging
in multi threaded applications is single threaded.
Probably your prefetch thread is waiting for disk io, and the worker
thread causes a minor pagefault --> worker thread sleeps until the disk
io is completed.

--
	Manfred

^ permalink raw reply	[flat|nested] 4+ messages in thread
* paging behavior in Linux
@ 2001-02-28 17:58 Neelam Saboo
  0 siblings, 0 replies; 4+ messages in thread
From: Neelam Saboo @ 2001-02-28 17:58 UTC (permalink / raw)
  To: linux-kernel

Hi,

I am a graduate student at Univ Of Illinois at Urbana-Champaign.
Regarding my thesis, I need some help with running a multithreaded program on
red hat linux. I am experimenting with paging behavior. I use a machine where
swap space is large compared to available memory. I run two threads, worker
thread & prefetch thread.
prefetch thread prefetches data in memory by accessing it which worker
thread will use later. Expected result is prefetch thread should take
most of the page faults leaving worker thread time to do actual work.
So, paging time in prefetch thread and work time in worker thread should
overlap and total time taken should be less.
In a PThreads book I found out that when one thread is waiting on a page
fault, other thread continues to work.

When I run my program on a readhat linux machine, I dont get results as
expected, work thread seems to be stuck when prefetch thread is waiting on
a page fault. Is it because, when one thread waits on a page fault, page
table is locked for the other thread also. This is linux specific, as I
get expected results on solaris. 

Can you please provide some explanations ?

Thanks
Neelam  
 


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

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

end of thread, other threads:[~2001-02-28 23:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-28 21:35 paging behavior in Linux Manfred Spraul
2001-02-28 21:54 ` David Mansfield
2001-02-28 23:00   ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2001-02-28 17:58 Neelam Saboo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.