public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: page fault fastpath: Increasing SMP scalability by introducing pte
@ 2004-08-15 14:17 Manfred Spraul
  2004-08-15 15:10 ` William Lee Irwin III
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Manfred Spraul @ 2004-08-15 14:17 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-kernel

Christoph wrote:

>Well this is more an idea than a real patch yet. The page_table_lock
>becomes a bottleneck if more than 4 CPUs are rapidly allocating and using
>memory. "pft" is a program that measures the performance of page faults on
>SMP system. It allocates memory simultaneously in multiple threads thereby
>causing lots of page faults for anonymous pages.
>
>  
>
Very odd. Why do you see a problem with the page_table_lock but no 
problem from the mmap semaphore?
The page fault codepath acquires both.
How often is the page table lock acquired per page fault? Just once or 
multiple spin_lock calls per page fault? Is the problem contention or 
cache line trashing?

Do you have profile/lockmeter output? Is the down_read() in 
do_page_fault() a hot spot, too?

--
    Manfred

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

* Re: page fault fastpath: Increasing SMP scalability by introducing pte
  2004-08-15 14:17 page fault fastpath: Increasing SMP scalability by introducing pte Manfred Spraul
@ 2004-08-15 15:10 ` William Lee Irwin III
  2004-08-15 19:36 ` Christoph Lameter
  2004-08-15 20:06 ` Christoph Lameter
  2 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2004-08-15 15:10 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Christoph Lameter, linux-kernel

Christoph wrote:
>> Well this is more an idea than a real patch yet. The page_table_lock
>> becomes a bottleneck if more than 4 CPUs are rapidly allocating and using
>> memory. "pft" is a program that measures the performance of page faults on
>> SMP system. It allocates memory simultaneously in multiple threads thereby
>> causing lots of page faults for anonymous pages.

On Sun, Aug 15, 2004 at 04:17:11PM +0200, Manfred Spraul wrote:
> Very odd. Why do you see a problem with the page_table_lock but no 
> problem from the mmap semaphore?
> The page fault codepath acquires both.
> How often is the page table lock acquired per page fault? Just once or 
> multiple spin_lock calls per page fault? Is the problem contention or 
> cache line trashing?
> Do you have profile/lockmeter output? Is the down_read() in 
> do_page_fault() a hot spot, too?

->mmap_sem would likely be useful to address as well. A different
structure for vma trees, more amenable to finegrained locking or
lockfree algorithms, would likely be useful there.


-- wli

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

* Re: page fault fastpath: Increasing SMP scalability by introducing pte
  2004-08-15 14:17 page fault fastpath: Increasing SMP scalability by introducing pte Manfred Spraul
  2004-08-15 15:10 ` William Lee Irwin III
@ 2004-08-15 19:36 ` Christoph Lameter
  2004-08-15 20:06 ` Christoph Lameter
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Lameter @ 2004-08-15 19:36 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel

On Sun, 15 Aug 2004, Manfred Spraul wrote:

> Very odd. Why do you see a problem with the page_table_lock but no
> problem from the mmap semaphore?

I will have a look at that...

> The page fault codepath acquires both.
> How often is the page table lock acquired per page fault? Just once or
> multiple spin_lock calls per page fault? Is the problem contention or
> cache line trashing?

The page table lock seems to be acquired at least 2 times and up to 5
times per page fault.

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

* Re: page fault fastpath: Increasing SMP scalability by introducing pte
  2004-08-15 14:17 page fault fastpath: Increasing SMP scalability by introducing pte Manfred Spraul
  2004-08-15 15:10 ` William Lee Irwin III
  2004-08-15 19:36 ` Christoph Lameter
@ 2004-08-15 20:06 ` Christoph Lameter
  2004-08-16  5:23   ` Manfred Spraul
  2 siblings, 1 reply; 5+ messages in thread
From: Christoph Lameter @ 2004-08-15 20:06 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel

On Sun, 15 Aug 2004, Manfred Spraul wrote:

> Very odd. Why do you see a problem with the page_table_lock but no
> problem from the mmap semaphore?

Because there is a only a down_read() call for the mmap semaphore before
invoking handle_mm_fault. This is a rw semaphore which means that multiple
processors/processes may be entering handle_mm_fault with a read lock on
the mmap semaphore.

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

* Re: page fault fastpath: Increasing SMP scalability by introducing pte
  2004-08-15 20:06 ` Christoph Lameter
@ 2004-08-16  5:23   ` Manfred Spraul
  0 siblings, 0 replies; 5+ messages in thread
From: Manfred Spraul @ 2004-08-16  5:23 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-kernel

Christoph Lameter wrote:

>On Sun, 15 Aug 2004, Manfred Spraul wrote:
>
>  
>
>>Very odd. Why do you see a problem with the page_table_lock but no
>>problem from the mmap semaphore?
>>    
>>
>
>Because there is a only a down_read() call for the mmap semaphore before
>invoking handle_mm_fault. This is a rw semaphore which means that multiple
>processors/processes may be entering handle_mm_fault with a read lock on
>the mmap semaphore.
>  
>
As far as I can see the actual hold times on the page_table_lock are not 
that long and down_read() causes a cache line transfer, too.
But you have answered my question in your first mail: There are 2-5 
spin_lock calls per page fault but only one down_read call.

--
    Manfred

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

end of thread, other threads:[~2004-08-16  5:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-15 14:17 page fault fastpath: Increasing SMP scalability by introducing pte Manfred Spraul
2004-08-15 15:10 ` William Lee Irwin III
2004-08-15 19:36 ` Christoph Lameter
2004-08-15 20:06 ` Christoph Lameter
2004-08-16  5:23   ` Manfred Spraul

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