linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Todd Larason <jtl@molehill.org>
To: linux-kernel@vger.rutgers.edu, linux-mm@kvack.org
Subject: Re: Thread implementations...
Date: Thu, 25 Jun 1998 10:14:48 -0700	[thread overview]
Message-ID: <19980625101448.25859@molehill.org> (raw)
In-Reply-To: <m1pvfy3x8f.fsf@flinx.npwt.net>; from Eric W. Biederman on Wed, Jun 24, 1998 at 11:45:52PM -0500

On Wed, Jun 24, 1998 at 11:45:52PM -0500, Eric W. Biederman wrote:
> >>>>> "RG" == Richard Gooch <Richard.Gooch@atnf.CSIRO.AU> writes:
> 
> RG> Eric W. Biederman writes:
> >> >>>>> "RG" == Richard Gooch <Richard.Gooch@atnf.CSIRO.AU> writes:
> 
> Does someone have the Sun/sparc man page?




C Library Functions                                    madvise(3)



NAME
     madvise - provide advice to VM system

SYNOPSIS
     #include <sys/types.h>
     #include <sys/mman.h>

     int madvise(caddr_t _\ba_\bd_\bd_\br, size_t _\bl_\be_\bn, int _\ba_\bd_\bv_\bi_\bc_\be);

DESCRIPTION
     madvise() advises the kernel that a region  of  user  mapped
     memory in the range [_\ba_\bd_\bd_\br, _\ba_\bd_\bd_\br + _\bl_\be_\bn) will be accessed fol-
     lowing a type of pattern.  The kernel uses this  information
     to  optimize  the procedure for manipulating and maintaining
     the resources associated with the specified mapping range.

     Values for _\ba_\bd_\bv_\bi_\bc_\be are defined in <sys/mman.h> as:

     #define MADV_NORMAL        0x0     /* No further special treatment */
     #define MADV_RANDOM        0x1     /* Expect random page references */
     #define MADV_SEQUENTIAL    0x2     /* Expect sequential page references */
     #define MADV_WILLNEED      0x3     /* Will need these pages */
     #define MADV_DONTNEED      0x4     /* Don't need these pages */

     MADV_NORMAL
          The  default  system  characteristic  where   accessing
          memory  within  the  address range causes the system to
          read data from the mapped file.  The kernel  reads  all
          data  from  files  into  pages which are retained for a
          period of time as a "cache."  System  pages  can  be  a
          scarce  resource, so the kernel steals pages from other
          mappings when needed.  This is a likely occurrence, but
          adversely  affects  system  performance only if a large
          amount of memory is accessed.

     MADV_RANDOM
          Tells the kernel to read in a minimum  amount  of  data
          from a mapped file on any single particular access.  If
          MADV_NORMAL is in effect when an address  of  a  mapped
          file  is  accessed, the system tries to read in as much
          data from the file as reasonable,  in  anticipation  of
          other accesses within a certain locality.

     MADV_SEQUENTIAL
          Tells the system  that  addresses  in  this  range  are
          likely  to  be  accessed  only once, so the system will
          free the resources mapping the address range as quickly
          as  possible.   This  is  used  in the cat(1) and cp(1)
          utilities.

     MADV_WILLNEED
          Tells the  system  that  a  certain  address  range  is



SunOS 5.6           Last change: 29 Dec 1996                    1






C Library Functions                                    madvise(3)



          definitely  needed so the kernel will start reading the
          specified range into memory.  This can benefit programs
          wanting  to  minimize  the time needed to access memory
          the first time, as the kernel would  need  to  read  in
          from the file.

     MADV_DONTNEED
          Tells the kernel that the specified address range is no
          longer  needed,  so  the  system  starts  to  free  the
          resources associated with the address range.

     madvise() should be used by programs with specific knowledge
     of  their  access  patterns  over a memory object, such as a
     mapped file, to increase system performance.

RETURN VALUES
     madvise() returns:

     0    on success.

     -1   on failure and sets errno to indicate the error.

ERRORS
     EINVAL         _\ba_\bd_\bd_\br is not a multiple of the  page  size  as
                    returned by sysconf(3C).

                    The length of the specified address range  is
                    less  than  or  equal to 0, or the advice was
                    invalid.

     EIO            An I/O error occurred while reading  from  or
                    writing to the file system.

     ENOMEM         Addresses in the range [_\ba_\bd_\bd_\br, _\ba_\bd_\bd_\br + _\bl_\be_\bn) are
                    outside the valid range for the address space
                    of a process, or specify one  or  more  pages
                    that are not mapped.

     ESTALE         Stale nfs file handle.

ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     __________________________________
    | ATTRIBUTE TYPE|  ATTRIBUTE VALUE|
    |_\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b|\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b__\b|\b_
    | MT-Level      |  MT-Safe        |
    |________________\b|__________________\b|

SEE ALSO
     cat(1), cp(1), mmap(2), sysconf(3C), attributes(5)



SunOS 5.6           Last change: 29 Dec 1996                    2


No mention of conforming to any standard her.  HP-UX 10.20's manpage
claims conformance with AES and SVID3.  It defines a MADV_SPACEAVAIL
behavior too, but notes that it isn't implemented.

  reply	other threads:[~1998-06-25 17:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199806240915.TAA09504@vindaloo.atnf.CSIRO.AU>
     [not found] ` <Pine.LNX.3.96dg4.980624025515.26983E-100000@twinlark.arctic.org>
     [not found]   ` <199806241213.WAA10661@vindaloo.atnf.CSIRO.AU>
1998-06-24 22:00     ` Eric W. Biederman
1998-06-24 23:41       ` Richard Gooch
1998-06-25  4:45         ` Eric W. Biederman
1998-06-25 17:14           ` Todd Larason [this message]
1998-06-26  7:53           ` Christoph Rohland
1998-06-26 14:16             ` Eric W. Biederman
1998-06-29 10:19               ` Stephen C. Tweedie
1998-06-30  6:19                 ` Eric W. Biederman
1998-06-30 13:10                   ` Stephen C. Tweedie
1998-06-30 19:35                     ` Dean Gaudet
1998-07-01  9:09                       ` Stephen C. Tweedie
1998-06-25  4:12       ` Dean Gaudet
1998-06-25  3:53         ` Richard Gooch
1998-06-25 11:32           ` Stephen C. Tweedie
1998-06-25 21:24             ` Chris Wedgwood
1998-06-25 22:16             ` Richard Gooch
1998-06-25  4:56         ` Eric W. Biederman
1998-06-25 11:35           ` Stephen C. Tweedie
1998-06-25 20:31             ` Dean Gaudet
1998-06-30  6:40             ` Eric W. Biederman
1998-06-30 19:30 Larry McVoy
1998-07-01  8:50 ` Stephen C. Tweedie
1998-07-03 15:21   ` Rik van Riel
1998-07-03 20:05     ` Stephen C. Tweedie
1998-07-03 20:36       ` Rik van Riel
1998-07-04 16:37         ` Stephen C. Tweedie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980625101448.25859@molehill.org \
    --to=jtl@molehill.org \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox