linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: "Javier Cabezas �" <jcabezas@ac.upc.edu>
Cc: linux-mm@kvack.org
Subject: Re: Selective swap out of processes
Date: Thu, 30 Aug 2007 17:09:52 +1000	[thread overview]
Message-ID: <46D66D40.4040302@yahoo.com.au> (raw)
In-Reply-To: <1188383827.11270.36.camel@bastion-laptop>

Javier Cabezas RodrA-guez wrote:
> El miA(C), 29-08-2007 a las 12:37 +1000, Nick Piggin escribiA3:
> 
>>Simplest will be just to set referenced to 0 right after calling
>>page_referenced, in the case you want to forcefully swap out the
>>page.
>>
>>try_to_unmap will get called later in the same function.
> 
> 
> I have tried this solution, but 0 pages are freed...
> 
> - RO/EXEC pages mapped from the executable are now skipped due to this
> check:
> 
> if (!mapping || !remove_mapping(mapping, page))
> 	goto keep_locked;
> 
> The offender is this check in remove_mapping:
> 
> if (unlikely(page_count(page) != 2))
> 	goto cannot_free;
> 
> - RW pages mapped from the executable are skipped because pageout
> returns PAGE_KEEP.
> 
> - Other pages are skipped because try_to_unmap returns SWAP_FAIL.

You still actually have to call page_referenced to clear the young
bits in the ptes, right? That should prevent try_to_unmap returning
SWAP_FAIL. It can be mapped by multiple processes, so just clearing
the young bit for one pte won't help (especially for exec pages,
which are very likely to be used by more than one process).

If your page_count is elevated after the page has been unmapped,
then there is something else using the page or your function isn't
doing the correct refcounting.

-- 
SUSE Labs, Novell Inc.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2007-08-30  7:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-28 16:54 Javier Cabezas Rodríguez
2007-08-29  2:37 ` Nick Piggin
2007-08-29 10:37   ` Javier Cabezas Rodríguez
2007-08-29 18:06     ` Javier Cabezas Rodríguez
2007-08-29 22:01       ` Dave Hansen
2007-08-30  7:13       ` Nick Piggin
2007-08-30 23:41         ` Javier Cabezas Rodríguez
2007-08-30 23:47           ` Javier Cabezas Rodríguez
2007-08-30 23:50           ` Javier Cabezas Rodríguez
2007-08-31  0:34             ` Nick Piggin
2007-08-31 16:40             ` Dave Hansen
2007-09-08  1:45               ` Nick Piggin
2007-08-30  7:09     ` Nick Piggin [this message]
2007-08-29  5:18 ` Christoph Lameter

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=46D66D40.4040302@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=jcabezas@ac.upc.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