Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Kirill A. Shutemov
On Mon, Oct 01, 2012 at 10:52:06AM -0700, H. Peter Anvin wrote: > On 10/01/2012 10:44 AM, Kirill A. Shutemov wrote: > > On Mon, Oct 01, 2012 at 10:37:23AM -0700, H. Peter Anvin wrote: > >> One can otherwise argue that if hzp doesn't matter for except in a small > >> number of cases that we shouldn'

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Andrea Arcangeli
On Mon, Oct 01, 2012 at 08:15:19PM +0300, Kirill A. Shutemov wrote: > I think performance is not the first thing we should look at. We need to > choose which implementation is easier to support. Having to introduce a special pmd bitflag requiring architectural support is actually making it less se

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Andrea Arcangeli
On Mon, Oct 01, 2012 at 10:33:12AM -0700, H. Peter Anvin wrote: > ... and I think it would be worthwhile to know which effect dominates > (or neither, in which case it doesn't matter). > > Overall, I'm okay with either as long as we don't lock down 2 MB when > there isn't a huge zero page in use.

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread H. Peter Anvin
On 10/01/2012 10:44 AM, Kirill A. Shutemov wrote: > On Mon, Oct 01, 2012 at 10:37:23AM -0700, H. Peter Anvin wrote: >> One can otherwise argue that if hzp doesn't matter for except in a small >> number of cases that we shouldn't use it at all. > > These small number of cases can easily trigger OOM

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Kirill A. Shutemov
On Mon, Oct 01, 2012 at 10:37:23AM -0700, H. Peter Anvin wrote: > One can otherwise argue that if hzp doesn't matter for except in a small > number of cases that we shouldn't use it at all. These small number of cases can easily trigger OOM if THP is enabled. :) -- Kirill A. Shutemov -- To unsu

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread H. Peter Anvin
On 10/01/2012 10:36 AM, Kirill A. Shutemov wrote: > On Mon, Oct 01, 2012 at 10:33:12AM -0700, H. Peter Anvin wrote: >> Overall, I'm okay with either as long as we don't lock down 2 MB when >> there isn't a huge zero page in use. > > Is shinker-reclaimable huge zero page okay for you? > Yes, I'm

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Kirill A. Shutemov
On Mon, Oct 01, 2012 at 10:33:12AM -0700, H. Peter Anvin wrote: > Overall, I'm okay with either as long as we don't lock down 2 MB when > there isn't a huge zero page in use. Is shinker-reclaimable huge zero page okay for you? -- Kirill A. Shutemov -- To unsubscribe from this list: send the lin

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread H. Peter Anvin
On 10/01/2012 10:26 AM, Andrea Arcangeli wrote: > >> It is well known that microbenchmarks can be horribly misleading. What >> led to Kirill investigating huge zero page in the first place was the >> fact that some applications/macrobenchmarks benefit, and I think those >> are the right thing to

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Andrea Arcangeli
On Mon, Oct 01, 2012 at 10:03:53AM -0700, H. Peter Anvin wrote: > Something isn't quite right about that. If you look at your numbers: > > 1,049,134,961 LLC-loads > 6,222 LLC-load-misses > > This is another way of saying in your benchmark the huge zero page is > parked in your LLC - usin

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Kirill A. Shutemov
On Mon, Oct 01, 2012 at 06:14:37PM +0200, Andrea Arcangeli wrote: > On Mon, Oct 01, 2012 at 04:49:48PM +0300, Kirill A. Shutemov wrote: > > On Sat, Sep 29, 2012 at 04:37:37PM +0200, Andrea Arcangeli wrote: > > > But I agree we need to verify it before taking a decision, and that > > > the numbers a

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Kirill A. Shutemov
On Mon, Oct 01, 2012 at 10:03:53AM -0700, H. Peter Anvin wrote: > On 10/01/2012 09:31 AM, Andrea Arcangeli wrote: > > On Mon, Oct 01, 2012 at 08:34:28AM -0700, H. Peter Anvin wrote: > >> On 09/29/2012 06:48 AM, Andrea Arcangeli wrote: > >>> > >>> There would be a small cache benefit here... but eve

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread H. Peter Anvin
On 10/01/2012 09:31 AM, Andrea Arcangeli wrote: > On Mon, Oct 01, 2012 at 08:34:28AM -0700, H. Peter Anvin wrote: >> On 09/29/2012 06:48 AM, Andrea Arcangeli wrote: >>> >>> There would be a small cache benefit here... but even then some first >>> level caches are virtually indexed IIRC (always phys

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Andrea Arcangeli
On Mon, Oct 01, 2012 at 08:34:28AM -0700, H. Peter Anvin wrote: > On 09/29/2012 06:48 AM, Andrea Arcangeli wrote: > > > > There would be a small cache benefit here... but even then some first > > level caches are virtually indexed IIRC (always physically tagged to > > avoid the software to notice)

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Andrea Arcangeli
On Mon, Oct 01, 2012 at 04:49:48PM +0300, Kirill A. Shutemov wrote: > On Sat, Sep 29, 2012 at 04:37:37PM +0200, Andrea Arcangeli wrote: > > But I agree we need to verify it before taking a decision, and that > > the numbers are better than theory, or to rephrase it "let's check the > > theory is ri

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread H. Peter Anvin
On 09/29/2012 06:48 AM, Andrea Arcangeli wrote: > > There would be a small cache benefit here... but even then some first > level caches are virtually indexed IIRC (always physically tagged to > avoid the software to notice) and virtually indexed ones won't get any > benefit. > Not quite. The v

Re: [PATCH 0/3] Virtual huge zero page

2012-10-01 Thread Kirill A. Shutemov
On Sat, Sep 29, 2012 at 04:37:37PM +0200, Andrea Arcangeli wrote: > But I agree we need to verify it before taking a decision, and that > the numbers are better than theory, or to rephrase it "let's check the > theory is right" :) Okay, microbenchmark: % cat test_memcmp.c #include #include #in

Re: [PATCH 0/3] Virtual huge zero page

2012-09-29 Thread Andrea Arcangeli
On Sat, Sep 29, 2012 at 07:30:06AM -0700, Andi Kleen wrote: > On Sat, Sep 29, 2012 at 03:48:11PM +0200, Andrea Arcangeli wrote: > > On Sat, Sep 29, 2012 at 02:37:18AM +0300, Kirill A. Shutemov wrote: > > > Cons: > > > - increases TLB pressure; > > > > I generally don't like using 4k tlb entries e

Re: [PATCH 0/3] Virtual huge zero page

2012-09-29 Thread Andi Kleen
On Sat, Sep 29, 2012 at 03:48:11PM +0200, Andrea Arcangeli wrote: > On Sat, Sep 29, 2012 at 02:37:18AM +0300, Kirill A. Shutemov wrote: > > Cons: > > - increases TLB pressure; > > I generally don't like using 4k tlb entries ever. This only has the >From theory I would also prefer the 2MB huge pa

Re: [PATCH 0/3] Virtual huge zero page

2012-09-29 Thread Andrea Arcangeli
On Sat, Sep 29, 2012 at 02:37:18AM +0300, Kirill A. Shutemov wrote: > Cons: > - increases TLB pressure; I generally don't like using 4k tlb entries ever. This only has the advantage of saving 2MB-4KB RAM (globally), and a chpxchg at the first system-wide zero page fault. I like apps to only use 2

[PATCH 0/3] Virtual huge zero page

2012-09-28 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" Here's alternative implementation of huge zero page: virtual huge zero page. Virtual huge zero page is a PMD table with all entries set to zero page. H. Peter Anvin asked to evaluate this implementation option. Pros: - cache friendly (not yet benchmarked); - less ch