linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/1] ksm: check and skip page, if it is already scanned
@ 2014-03-04  2:48 Pradeep Sawlani
  0 siblings, 0 replies; 3+ messages in thread
From: Pradeep Sawlani @ 2014-03-04  2:48 UTC (permalink / raw)
  To: Hugh Dickins, Izik Eidus, Andrea Arcangeli, Chris Wright
  Cc: LKML, MEMORY MANAGEMENT, Dave Hansen, Arjan van de Ven,
	Maddhula Suri, Matt Wilson, Anthony Liguori, Pradeep Sawlani

From: Pradeep Sawlani <sawlani@amazon.com>

Patch uses two bits to detect if page is scanned, one bit for odd cycle
and other for even cycle. This adds one more bit in page flags and
overloads existing bit (PG_owner_priv_1).
Changes are based of 3.4.79 kernel, since I have used that for verification.
Detail discussion can be found at https://lkml.org/lkml/2014/2/13/624
Suggestion(s) are welcome for alternative solution in order to avoid one more
bit in page flags.

Pradeep Sawlani (1):
  ksm: check and skip page, if it is already scanned

 include/linux/page-flags.h |   11 +++++++++++
 mm/Kconfig                 |   10 ++++++++++
 mm/ksm.c                   |   33 +++++++++++++++++++++++++++++++--
 3 files changed, 52 insertions(+), 2 deletions(-)

-- 
1.7.9.5

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH RFC 0/1] ksm: check and skip page, if it is already scanned
@ 2014-03-04  2:48 Pradeep Sawlani
  2014-03-04 17:11 ` Dave Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Pradeep Sawlani @ 2014-03-04  2:48 UTC (permalink / raw)
  To: Hugh Dickins, Izik Eidus, Andrea Arcangeli, Chris Wright
  Cc: LKML, MEMORY MANAGEMENT, Dave Hansen, Arjan van de Ven,
	Suri Maddhula, Matt Wilson, Anthony Liguori, Pradeep Sawlani

From: Pradeep Sawlani <sawlani@amazon.com>

Patch uses two bits to detect if page is scanned, one bit for odd cycle
and other for even cycle. This adds one more bit in page flags and
overloads existing bit (PG_owner_priv_1).
Changes are based of 3.4.79 kernel, since I have used that for verification.
Detail discussion can be found at https://lkml.org/lkml/2014/2/13/624
Suggestion(s) are welcome for alternative solution in order to avoid one more
bit in page flags.

Pradeep Sawlani (1):
  ksm: check and skip page, if it is already scanned

 include/linux/page-flags.h |   11 +++++++++++
 mm/Kconfig                 |   10 ++++++++++
 mm/ksm.c                   |   33 +++++++++++++++++++++++++++++++--
 3 files changed, 52 insertions(+), 2 deletions(-)

-- 
1.7.9.5

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC 0/1] ksm: check and skip page, if it is already scanned
  2014-03-04  2:48 Pradeep Sawlani
@ 2014-03-04 17:11 ` Dave Hansen
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Hansen @ 2014-03-04 17:11 UTC (permalink / raw)
  To: Pradeep Sawlani, Hugh Dickins, Izik Eidus, Andrea Arcangeli,
	Chris Wright
  Cc: LKML, MEMORY MANAGEMENT, Arjan van de Ven, Suri Maddhula,
	Matt Wilson, Anthony Liguori, Pradeep Sawlani

On 03/03/2014 06:48 PM, Pradeep Sawlani wrote:
> Patch uses two bits to detect if page is scanned, one bit for odd cycle
> and other for even cycle. This adds one more bit in page flags and
> overloads existing bit (PG_owner_priv_1).
> Changes are based of 3.4.79 kernel, since I have used that for verification.
> Detail discussion can be found at https://lkml.org/lkml/2014/2/13/624
> Suggestion(s) are welcome for alternative solution in order to avoid one more
> bit in page flags.

Allocate a big bitmap (depends on how many pages you are scanning).
Hash the page's pfn and index in to the bitmap.  If the bit is set,
don't scan the page.  If not set, then set it.  Vary the hash for each
scanning pass to reduce the same collision happening repeatedly.  Clear
the bitmap before each scan.

You'll get plenty of collisions, especially for a small table, but who
cares?

The other option is to bloat anon_vma instead, and only do one scan for
each anon_vma that shares the same root.  That's a bit more invasive though.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-04 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04  2:48 [PATCH RFC 0/1] ksm: check and skip page, if it is already scanned Pradeep Sawlani
  -- strict thread matches above, loose matches on Subject: below --
2014-03-04  2:48 Pradeep Sawlani
2014-03-04 17:11 ` Dave Hansen

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