linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <barrioskmc@gmail.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Minchan Kim <minchan.kim@gmail.com>,
	Hugh Dickins <hugh@veritas.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Rik van Riel <riel@redhat.com>, Izik Eidus <ieidus@redhat.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	chrisw@redhat.com, device@lanana.org, linux-mm@kvack.org,
	nickpiggin@yahoo.com.au
Subject: Re: [PATCH 2/6] ksm: dont allow overlap memory addresses registrations.
Date: Thu, 7 May 2009 21:01:30 +0900	[thread overview]
Message-ID: <44c63dc40905070501j1a468e16yde46403da19460e6@mail.gmail.com> (raw)
In-Reply-To: <20090507104635.GG16078@random.random>

>> Many embedded system is so I/O bouneded that we can use much CPU time in there.
>
> Embedded systems with >4G of ram should run 64bit these days, so I
> don't see a problem.

What I mean is that many embedded applications don't use so much cpu
time that we can use extra cpu time to scan identical pages for KSM.
:)

>> One more thing about interface.
>>
>> Ksm map regions are dynamic characteritic ?
>> I mean sometime A application calls ioctl(0x800000, 0x10000) and sometime it calls ioctl(0xb7000000, 0x20000);
>> Of course, It depends on application's behavior.
>
> Looks like the ioctl API is going away in favour of madvise so it'll
> function like madvise, if you munmap the region the KSM registration
> will go away.
>
>> ex) echo 'pid 0x8050000 0x100000' > sysfs or procfs or cgroup.
>
> This was answered by Chris, and surely this is feasible, as it is
> feasible for kksmd to scan the whole system regardless of any
> madvise. Some sysfs mangling should allow it.
>
> However regardless of the highmem issue (this applies to 64bit systems
> too) you've to keep in mind that for kksmd to keep track all pages
> under scan it has to build rbtree and allocate rmap_items and
> tree_items for each page tracked, those objects take some memory, so
> if there's not much ram sharing you may waste more memory in the kksmd
> allocations than in the amount of memory actually freed by KSM. This
> is why it's better to selectively only register ranges that we know in
> advance there's an high probability to free memory.

Indeed.

This interface can use for just simple test and profiling.
If it don't add memory pressure and latency, we can use it without
modifying source code.
Unfortunately, it's not in usual case. ;-)

So if KSM can provide profiling information, we can tune easily than now.

ex)
pfn : 0x12, shared [pid 103, vaddr 0x80010000] [pid 201, vaddr 0x800ac000] .....
pfn : 0x301, shared [pid 103, vaddr 0x80020000] [pid 203, vaddr
0x801ac000] .....
...
...

If KSM can provide this profiling information, firstly we try to use
ksm without madive and next we can add madvise call on most like
sharable vma range using profiling data.

> Thanks!
> Andrea
>



-- 
Thanks,
Minchan Kim

--
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-05-07 12:01 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 22:25 [PATCH 0/6] ksm changes (v2) Izik Eidus
2009-05-04 22:25 ` [PATCH 1/6] ksm: limiting the num of mem regions user can register per fd Izik Eidus
2009-05-04 22:25   ` [PATCH 2/6] ksm: dont allow overlap memory addresses registrations Izik Eidus
2009-05-04 22:25     ` [PATCH 3/6] ksm: change the KSM_REMOVE_MEMORY_REGION ioctl Izik Eidus
2009-05-04 22:25       ` [PATCH 4/6] ksm: change the prot handling to use the generic helper functions Izik Eidus
2009-05-04 22:25         ` [PATCH 5/6] ksm: build system make it compile for all archs Izik Eidus
2009-05-04 22:25           ` [PATCH 6/6] ksm: use another miscdevice minor number Izik Eidus
2009-05-06  0:55             ` Rik van Riel
2009-05-06  0:54           ` [PATCH 5/6] ksm: build system make it compile for all archs Rik van Riel
2009-05-06  0:54         ` [PATCH 4/6] ksm: change the prot handling to use the generic helper functions Rik van Riel
2009-05-06  0:53       ` [PATCH 3/6] ksm: change the KSM_REMOVE_MEMORY_REGION ioctl Rik van Riel
2009-05-06  8:38         ` Izik Eidus
2009-05-06 11:16           ` Hugh Dickins
2009-05-06 13:34             ` Andrea Arcangeli
2009-05-06 13:56               ` Izik Eidus
2009-05-06 16:41                 ` Hugh Dickins
2009-05-06 16:49                   ` Chris Wright
2009-05-06 16:57                     ` Hugh Dickins
2009-05-06 17:47                       ` Andrea Arcangeli
2009-05-06 16:59                     ` Izik Eidus
2009-05-07 11:31                     ` Andrea Arcangeli
2009-05-07 13:13                       ` Hugh Dickins
2009-05-07 13:23                         ` Andrea Arcangeli
2009-05-06 14:25               ` Hugh Dickins
2009-05-06 14:45                 ` Andrea Arcangeli
2009-05-06 15:36                   ` Chris Wright
2009-05-06 15:27             ` Izik Eidus
2009-05-06 16:14               ` Chris Wright
2009-05-06 16:36                 ` Hugh Dickins
2009-05-06 17:09                   ` Chris Wright
2009-05-06 17:54                     ` Hugh Dickins
2009-05-06 16:26               ` Hugh Dickins
2009-05-06 16:58                 ` Izik Eidus
2009-05-06 23:59                   ` Chris Wright
2009-05-07  2:41                     ` Rik van Riel
2009-05-06  0:43     ` [PATCH 2/6] ksm: dont allow overlap memory addresses registrations Rik van Riel
2009-05-06  9:46       ` Izik Eidus
2009-05-06 12:26         ` Rik van Riel
2009-05-06 12:39           ` Izik Eidus
2009-05-06 13:17           ` Andrea Arcangeli
2009-05-06 13:28             ` Hugh Dickins
2009-05-06 14:02               ` Izik Eidus
2009-05-06 17:11                 ` Hugh Dickins
2009-05-06 14:09               ` Andrea Arcangeli
2009-05-06 14:21                 ` Alan Cox
2009-05-06 14:46                   ` Hugh Dickins
2009-05-06 14:56                     ` Andrea Arcangeli
2009-05-06 23:55                       ` Minchan Kim
2009-05-07  0:19                         ` Chris Wright
2009-05-07 10:46                         ` Andrea Arcangeli
2009-05-07 12:01                           ` Minchan Kim [this message]
2009-05-06 14:57                     ` Izik Eidus
2009-05-06  0:40   ` [PATCH 1/6] ksm: limiting the num of mem regions user can register per fd Rik van Riel
  -- strict thread matches above, loose matches on Subject: below --
2009-05-02 22:16 [PATCH 0/6] ksm changes Izik Eidus
2009-05-02 22:16 ` [PATCH 1/6] ksm: limiting the num of mem regions user can register per fd Izik Eidus
2009-05-02 22:16   ` [PATCH 2/6] ksm: dont allow overlap memory addresses registrations Izik Eidus

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=44c63dc40905070501j1a468e16yde46403da19460e6@mail.gmail.com \
    --to=barrioskmc@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chrisw@redhat.com \
    --cc=device@lanana.org \
    --cc=hugh@veritas.com \
    --cc=ieidus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=riel@redhat.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;
as well as URLs for NNTP newsgroup(s).