Browse Prior Art Database

Zeroing Memory using Data Cache Line

IP.com Disclosure Number: IPCOM000118492D
Original Publication Date: 1997-Feb-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 2 page(s) / 56K

Publishing Venue

IBM

Related People

Aschenbrenner, JM: AUTHOR

Abstract

The time spent in zeroing large chunks of memory is critical for performance in some applications. The ability to zero a data cache block may cut the zeroing time in half compared to traditional zeroing methods.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 53% of the total text.

Zeroing Memory using Data Cache Line

      The time spent in zeroing large chunks of memory is critical
for performance in some applications.  The ability to zero a data
cache block may cut the zeroing time in half compared to traditional
zeroing methods.

Conventional methods of zeroing memory involve three steps:
  1.  copying memory into a cache block (or cache line)
  2.  writing zeros to the cache block
  3.  copying the cache block back out to memory

      When zeroing large amounts of data, memory-cache transfer time
is the gating factor.  Note that TWO transfers (into and out of
cache) are required.

      Using the dcbz (or dclz) assembly instruction on the RISC
System/6000* allows the memory-to-cache transfer to be omitted.  dcbz
(Data Cache Block Set to Zero) works as follows:  if the memory data
is already in cache, all bytes of the cache block are zeroed.  If it
is not in cache, the block of memory is established in the data cache
without reference to storage and all bytes are zeroed.

      In effect, this halves the amount of time required to zero
memory since only one (rather than two) memory-cache transfers are
required.

      The complete design for this approach is slightly more complex.

      If the memory to be zeroed does not start and end on
cache-block boundaries, zeroing of the extra bytes must be done using
conventional techniques.  The main loop then begins with an address
(dataP) which is on a block boundary...