linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Izik Eidus <ieidus@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Chris Wright <chrisw@redhat.com>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 5/9] ksm: share anon page without allocating
Date: Tue, 1 Dec 2009 09:02:01 +0900	[thread overview]
Message-ID: <20091201090201.7acb3d90.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0911301054230.20054@sister.anvils>

On Mon, 30 Nov 2009 11:18:51 +0000 (GMT)
Hugh Dickins <hugh.dickins@tiscali.co.uk> wrote:

> On Mon, 30 Nov 2009, KAMEZAWA Hiroyuki wrote:
> > 
> > Sorry for delayed response.
> 
> No, thank you very much for spending your time on it.
> 
> > 
> > On Tue, 24 Nov 2009 16:48:46 +0000 (GMT)
> > Hugh Dickins <hugh.dickins@tiscali.co.uk> wrote:
> > 
> > > When ksm pages were unswappable, it made no sense to include them in
> > > mem cgroup accounting; but now that they are swappable (although I see
> > > no strict logical connection)
> > I asked that for throwing away too complicated but wast of time things.
> 
> I'm sorry, I didn't understand that sentence at all!
> 
Sorry. At implementation of ksm. I don't want to consinder how to account it
because there was problems around swap accounting. So, I asked to
limit usage by itself.

> > If not on LRU, its own limitation (ksm's page limit) works enough.
> 
> Yes, I think it made sense the way it was before when unswappable,
> but that once they're swappable and that limitation is removed,
> they do then need to participate in mem cgroup accounting.
> 
> I _think_ you're agreeing, but I'm not quite sure!
> 
I agree. No objections.


> > > @@ -864,15 +865,24 @@ static int try_to_merge_one_page(struct
> ...
> > >  
> > > -	if ((vma->vm_flags & VM_LOCKED) && !err) {
> > > +	if ((vma->vm_flags & VM_LOCKED) && kpage && !err) {
> > >  		munlock_vma_page(page);
> > >  		if (!PageMlocked(kpage)) {
> > >  			unlock_page(page);
> > > -			lru_add_drain();
> > 
> > Is this related to memcg ?
> > 
> > >  			lock_page(kpage);
> > >  			mlock_vma_page(kpage);
> 
> Is the removal of lru_add_drain() related to memcg?  No, or only to
> the extent that reusing the original anon page is related to memcg.
> 
> I put lru_add_drain() in there before, because (for one of the calls
> to try_to_merge_one_page) the kpage had just been allocated an instant
> before, with lru_cache_add_lru putting it into the per-cpu array, so
> in that case mlock_vma_page(kpage) would need an lru_add_drain() to
> find it on the LRU (of course, we might be preempted to a different
> cpu in between, and lru_add_drain not be enough: but I think we've
> all come to the conclusion that lru_add_drain_all should be avoided
> unless there's a very strong reason for it).
> 
> But with this patch we're reusing the existing anon page as ksm page,
> and we know that it's been in place for at least one circuit of ksmd
> (ignoring coincidences like the jhash of the page happens to be 0),
> so we've every reason to believe that it will already be on its LRU:
> no need for lru_add_drain().
> 

Thank you for clarification.

Regards,
-Kame

--
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>

  reply	other threads:[~2009-12-01  0:05 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24 16:37 [PATCH 0/9] ksm: swapping Hugh Dickins
2009-11-24 16:40 ` [PATCH 1/9] ksm: fix mlockfreed to munlocked Hugh Dickins
2009-11-24 23:53   ` Rik van Riel
2009-11-26 16:20   ` Mel Gorman
2009-11-27 12:45     ` Hugh Dickins
2009-11-30  6:01       ` KOSAKI Motohiro
2009-11-30 12:26         ` Hugh Dickins
2009-11-30 21:27           ` Lee Schermerhorn
2009-12-01 11:14       ` Mel Gorman
2009-11-24 16:42 ` [PATCH 2/9] ksm: let shared pages be swappable Hugh Dickins
2009-11-30  0:46   ` KAMEZAWA Hiroyuki
2009-11-30  9:15     ` KOSAKI Motohiro
2009-11-30 12:38       ` Hugh Dickins
2009-12-01  4:14         ` KOSAKI Motohiro
2009-11-30 11:55     ` Hugh Dickins
2009-11-30 12:07     ` Andrea Arcangeli
2009-12-01  0:39       ` KAMEZAWA Hiroyuki
2009-12-01  6:32         ` Chris Wright
2009-12-01  9:11         ` Andrea Arcangeli
2009-12-01  9:28           ` KOSAKI Motohiro
2009-12-01  9:37             ` Andrea Arcangeli
2009-12-01  9:46               ` KOSAKI Motohiro
2009-12-01  9:59                 ` Andrea Arcangeli
2009-12-02  5:08                   ` Rik van Riel
2009-12-02 12:55                     ` Andrea Arcangeli
2009-12-03  5:15                       ` KOSAKI Motohiro
2009-12-04  5:06                         ` KOSAKI Motohiro
2009-12-04  5:16                           ` KAMEZAWA Hiroyuki
2009-12-04 14:49                             ` Andrea Arcangeli
2009-12-04 17:16                             ` Chris Wright
2009-12-04 18:53                               ` Andrea Arcangeli
2009-12-04 19:03                                 ` Chris Wright
2009-12-09  0:43                               ` KAMEZAWA Hiroyuki
2009-12-09  1:04                                 ` Chris Wright
2009-12-09 16:12                                 ` Andrea Arcangeli
2009-12-09 23:54                                   ` KAMEZAWA Hiroyuki
2009-12-04 14:45                           ` Andrea Arcangeli
2009-12-04 16:21                             ` Rik van Riel
2009-11-24 16:43 ` [PATCH 3/9] ksm: hold anon_vma in rmap_item Hugh Dickins
2009-11-24 16:45 ` [PATCH 4/9] ksm: take keyhole reference to page Hugh Dickins
2009-11-24 16:48 ` [PATCH 5/9] ksm: share anon page without allocating Hugh Dickins
2009-11-30  0:04   ` KAMEZAWA Hiroyuki
2009-11-30 11:18     ` Hugh Dickins
2009-12-01  0:02       ` KAMEZAWA Hiroyuki [this message]
2009-11-24 16:51 ` [PATCH 6/9] ksm: mem cgroup charge swapin copy Hugh Dickins
2009-11-25 14:23   ` Balbir Singh
2009-11-25 17:12     ` Hugh Dickins
2009-11-25 17:36       ` Balbir Singh
2009-11-30  0:13   ` KAMEZAWA Hiroyuki
2009-11-30 11:40     ` Hugh Dickins
2009-11-24 16:54 ` [PATCH 7/9] ksm: rmap_walk to remove_migation_ptes Hugh Dickins
2009-11-24 16:56 ` [PATCH 8/9] ksm: memory hotremove migration only Hugh Dickins
2009-11-24 16:57 ` [PATCH 9/9] ksm: remove unswappable max_kernel_pages Hugh Dickins

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=20091201090201.7acb3d90.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=chrisw@redhat.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=ieidus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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