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


Groups > linux.kernel > #1575904

Re: memfill

From Matthew Wilcox <willy@infradead.org>
Newsgroups linux.kernel
Subject Re: memfill
Date 2017-02-07 18:30 +0100
Message-ID <t8hKy-5Nk-17@gated-at.bofh.it> (permalink)
References <t7SMb-6cu-31@gated-at.bofh.it> <t7wLE-AL-9@gated-at.bofh.it> <t8azo-16x-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 07, 2017 at 09:40:04AM +0000, David Howells wrote:
> Matthew Wilcox <willy@infradead.org> wrote:
> 
> > [adding linux-arch to see if anyone there wants to do an optimised
> > version of memfill for their CPU]
> 
> For mn10300, this is superfluous since the memset() implementation will do
> optimised filling of up to 8 x 4 bytes per loop if the alignments suit.
> 
> This is also superfluous for frv as that will do up to 8 x 8 bytes per loop.
> 
> So on both those arches, memfill() should probably just wrap memset().

You've misunderstood the purpose of memfill.  memfill allows the caller
to specify a pattern which is not a single byte in size, eg memfill(addr,
0x12345678, 64) would result in 0x12345678 being reproduced 16 times.
memset(addr, 0x12345678, 64) would result in 0x78 being reproduced
64 times.

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


Thread

[PATCH v4] zram: extend zero pages to same element pages Minchan Kim <minchan@kernel.org> - 2017-02-05 16:20 +0100
  memfill Matthew Wilcox <willy@infradead.org> - 2017-02-06 15:50 +0100
    Re: memfill zhouxianrong <zhouxianrong@huawei.com> - 2017-02-07 03:50 +0100
    Re: memfill Minchan Kim <minchan@kernel.org> - 2017-02-07 06:10 +0100
    Re: memfill David Howells <dhowells@redhat.com> - 2017-02-07 10:50 +0100
      Re: memfill Matthew Wilcox <willy@infradead.org> - 2017-02-07 18:30 +0100
        Re: memfill David Howells <dhowells@redhat.com> - 2017-02-07 18:40 +0100
          Re: memfill Matthew Wilcox <willy@infradead.org> - 2017-02-07 20:10 +0100
    Re: memfill James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-02-07 20:10 +0100
      Re: memfill James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-02-08 22:10 +0100
        Re: memfill Matthew Wilcox <willy@infradead.org> - 2017-02-08 23:00 +0100
      Re: memfill Matthew Wilcox <willy@infradead.org> - 2017-02-08 23:10 +0100
  Re: [PATCH v4] zram: extend zero pages to same element pages Minchan Kim <minchan@kernel.org> - 2017-02-07 08:00 +0100

csiph-web