mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mulyadi Santosa <mulyadi.santosa@gmail.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] accounting per process swapped out pages
Date: Sat, 5 Aug 2006 08:00:16 +0700	[thread overview]
Message-ID: <200608050800.16584.mulyadi.santosa@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0608041616330.10681@blonde.wat.veritas.com>

Hi ...

> To be honest, I don't think there's much interest in this particular
> VmSwp statistic; and if there's little interest in it, we'd rather
> not spend the time and space on collecting it.  But I could be wrong:
> let's see who speaks up for it.

I got the same impression too, but I do think this statistic is 
important if someone wants to know which program suffers most when 
(heavy) swapping happens. Some programs like "top" would also get 
benefit since  its "swapped" accounting is just based on virtual-rss, 
which is wrong (just showing parts that haven't been brought to RAM)

> You waste space in every vm_area_struct for your swapped_out count,
> then /proc/<pid>/status has to loop over the vmas adding them up.
> Much better to make it an mm_counter like anon_rss, then you only
> use space in mm_struct, and don't have to add them up at the end,
> and avoid dirtying (vma) cachelines unnecessarily, and (in some
> cases) avoid the atomic operations.

Let's see if I can adapt this idea. Actually, in the first place, I was 
thinking this way but sometimes it is easier to get pointer to 
vm_area_struct rather than to mm_struct. I'll take a deeper look...

Avoiding atomic operation is also my another primary target....

> While you've caught the main places where you'd need to adjust
> swapped_out, you've missed a couple (maybe I've missed more):
> copy_pte_range (fork) needs to increment the count, zap_pte_range
> (munmap or truncate or exit) needs to decrement it.  Check wherever
> anon_rss is adjusted, some not all would need swapped_out adjusted.

Yes, I use anon_rss a the "guidance" on where I probably put the 
swapped_out accounting and decide whether it  actually has anything to 
do with swapping or not. Hmmmm, looks like I still miss a lot...

> Oh, you are doing something in zap_pte_range, but I'm sorry to say
> what you do there is nonsense: the number you're subtracting has
> nothing to do with the number of swapped out pages.

:( OK, re-checking...

> And you probably wouldn't want that printk in your final patch!

Perfect closing, i forgot to clean that printk(). Thanks for reminding 
me...

Refined patch will follow ASAP..

regards,

Mulyadi


      reply	other threads:[~2006-08-05  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04  6:51 Mulyadi Santosa
2006-08-04 15:47 ` Hugh Dickins
2006-08-05  1:00   ` Mulyadi Santosa [this message]

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=200608050800.16584.mulyadi.santosa@gmail.com \
    --to=mulyadi.santosa@gmail.com \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®