Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Oct 2020 13:05:40 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        SHAMANTHA KRISHNA K G <shamanthkrishna23@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: swap vm object
Message-ID:  <20201007170540.GB92185@raichu>
In-Reply-To: <CACc2HZkcJM__5ebukAweDPaXwQ%2BqQsDX%2B0as7Rq0iU2RaZtSrQ@mail.gmail.com>
References:  <CACc2HZ=ZsNjoL5kbL=iJD52_WB5%2BDQwr3q%2BsHBu-sgwbCCqmjQ@mail.gmail.com> <20201007122452.GA92185@raichu> <CACc2HZkcJM__5ebukAweDPaXwQ%2BqQsDX%2B0as7Rq0iU2RaZtSrQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 07, 2020 at 10:19:12PM +0530, SHAMANTHA KRISHNA K G wrote:
> Hello Mark,
>         Thank you very much for the heads up,may you please tell how it
> differs from a default vm object.

An OBJT_DEFAULT VM object is just a swap object for which the swap pager
holds no blocks.  The first time that the system pages out from a
default object, it gets converted to a proper swap object; see the
beginning of swap_pager_putpages().

Default objects only exist as an optimization: certain operations on
default objects are cheaper because the kernel knows it can avoid
interrogating the swap pager.  In many cases default objects are
short-lived and never undergo a pageout operation.  This optimization
may be less important now than it used to be: r322913 replaced a global
object+pindex->swap block hash table with per-object trees mapping page
indices to swap blocks.

> On Wed, 7 Oct 2020, 19:00 Mark Johnston, <markj@freebsd.org> wrote:
> 
> > On Wed, Oct 07, 2020 at 01:28:34PM +0530, SHAMANTHA KRISHNA K G wrote:
> > > Hello All ,
> > >
> > >     What is a swap vm object in case of /proc/<pid>/map ?
> >
> > It represents memory that is backed by the swap device.  If the system
> > is forced to reclaim memory from this object, it will first use the swap
> > pager to write the pages' contents to a swap device.  Then, a subsequent
> > access can recover the data by paging in from the swap device.
> >
> > Often such objects contain anonymous pages, such as those allocated
> > using malloc().  They are also used for certain persistent objects, such
> > as tmpfs or shared memory files.
> >



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201007170540.GB92185>