public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: Matt Mackall <mpm@selenic.com>
Cc: Andrew Morton OSDL <akpm@osdl.org>,
	Albert Cahalan <albert@users.sourceforge.net>,
	linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] eliminate nswap and cnswap
Date: 13 Apr 2004 00:47:31 -0400	[thread overview]
Message-ID: <1081831651.1587.251.camel@cube> (raw)
In-Reply-To: <20040413042710.GC1175@waste.org>

On Tue, 2004-04-13 at 00:27, Matt Mackall wrote:
> On Mon, Apr 12, 2004 at 08:42:23PM -0700, Andrew Morton wrote:
> > Albert Cahalan <albert@users.sourceforge.net> wrote:
> > >
> > > > The nswap and cnswap variables counters have never
> > > > been incremented as Linux doesn't do task swapping.
> > > 
> > > I'm pretty sure they were used for paging activity.
> > > We don't eliminate support for "swap space", do we?
> > > 
> > > Somebody must have broken nswap and cnswap while
> > > hacking on some vm code. I hate to see the variables
> > > get completely ripped out of the kernel instead of
> > > getting fixed.
> > 
> > There's nothing in 2.4 which increments these, nor was there in 2.6.  Which
> > tends to imply that they weren't very important.
> > 
> > We could sort-of do this - move them into mm_struct (doing it in
> > task_struct was always wrong) and increment them in the VM.  But we'd need
> > some reason why these statistics are interesting, and we'd need an
> > explanation of what nswap and cnswap are actually supposed to represent.  
> 
> It's used in 2.0 and 2.2 to satisfy the getrusage(2) syscall. The
> getrusage page only documents it as 'swaps', but says:
> 
>        The above struct was taken from BSD 4.3 Reno. Not all fields
>        are meaningful under Linux. Right now (Linux 2.4) only the
>        fields ru_utime, ru_stime, ru_minflt, ru_majflt, and ru_nswap
>        are maintained.
> 
> the BSD manpage says:
> 
> ru_nswap
>     the number of times a process was swapped out of main memory.
> 
> Which means it's a count of full process swaps like ancestral UNIX,
> which Linux has never had.

Well, that's the BSD man page.

I've always considered "swapped" to mean "paged"
when dealing with Linux. We still have our swap
partitions and swapon command, not paging partitions
and pageon command.

I suppose "paged out the area with the stack pointer"
would be a good approximation to the BSD behavior.

> So the 2.0/2.2 attempt to increment said variables was actually bogus.

If the variables counted paging, I consider them
correct for Linux.



  reply	other threads:[~2004-04-13  4:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13  3:31 [PATCH] eliminate nswap and cnswap Albert Cahalan
2004-04-13  3:42 ` Andrew Morton
2004-04-13  4:27   ` Matt Mackall
2004-04-13  4:47     ` Albert Cahalan [this message]
2004-04-13 16:56 ` Bill Davidsen
  -- strict thread matches above, loose matches on Subject: below --
2004-04-03  4:18 Matt Mackall

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=1081831651.1587.251.camel@cube \
    --to=albert@users.sf.net \
    --cc=akpm@osdl.org \
    --cc=albert@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /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