Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642899

Re: [v3 0/9] parallelized "struct page" zeroing

From Benjamin Herrenschmidt <benh@au1.ibm.com>
Newsgroups linux.kernel
Subject Re: [v3 0/9] parallelized "struct page" zeroing
Date 2017-05-17 02:00 +0200
Message-ID <tHUxI-3Ud-3@gated-at.bofh.it> (permalink)
References <tG3vu-37w-65@gated-at.bofh.it> <tGm54-7o1-11@gated-at.bofh.it> <tGmy6-7Uc-37@gated-at.bofh.it> <tGmHM-7YH-5@gated-at.bofh.it>
Organization IBM Australia

Show all headers | View raw


On Fri, 2017-05-12 at 13:37 -0400, David Miller wrote:
> > Right now it is larger, but what I suggested is to add a new optimized
> > routine just for this case, which would do STBI for 64-bytes but
> > without membar (do membar at the end of memmap_init_zone() and
> > deferred_init_memmap()
> > 
> > #define struct_page_clear(page)                                 \
> >          __asm__ __volatile__(                                   \
> >          "stxa   %%g0, [%0]%2\n"                                 \
> >          "stxa   %%xg0, [%0 + %1]%2\n"                           \
> >          : /* No output */                                       \
> >          : "r" (page), "r" (0x20), "i"(ASI_BLK_INIT_QUAD_LDD_P))
> > 
> > And insert it into __init_single_page() instead of memset()
> > 
> > The final result is 4.01s/T which is even faster compared to current
> > 4.97s/T
> 
> Ok, indeed, that would work.

On ppc64, that might not. We have a dcbz instruction that clears an
entire cache line at once. That's what we use for memset's and page
clearing. However, 64 bytes is half a cache line on modern processors
so we can't use it with that semantic and would have to fallback to the
slower stores.

Cheers,
Ben.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [v3 0/9] parallelized "struct page" zeroing Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-05-11 22:50 +0200
  Re: [v3 0/9] parallelized "struct page" zeroing Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-05-11 23:10 +0200
    Re: [v3 0/9] parallelized "struct page" zeroing David Miller <davem@davemloft.net> - 2017-05-12 19:00 +0200
      Re: [v3 0/9] parallelized "struct page" zeroing Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-05-12 19:30 +0200
        Re: [v3 0/9] parallelized "struct page" zeroing David Miller <davem@davemloft.net> - 2017-05-12 19:40 +0200
          Re: [v3 0/9] parallelized "struct page" zeroing Benjamin Herrenschmidt <benh@au1.ibm.com> - 2017-05-17 02:00 +0200
  Re: [v3 0/9] parallelized "struct page" zeroing David Miller <davem@davemloft.net> - 2017-05-12 19:00 +0200

csiph-web