Displaying 14 results from an estimated 14 matches for "pagediscarded".
2007 Apr 18
1
[patch 8/9] Guest page hinting: discarded page list.
...list_head pages_to_free = LIST_HEAD_INIT(pages_to_free);
+ struct page *page, *next;
+ unsigned long freed = 0;
+
+ if (!page_host_discards())
+ return 0;
+
+ on_each_cpu(__page_shrink_discards, &pages_to_free, 0, 1);
+
+ list_for_each_entry_safe(page, next, &pages_to_free, lru) {
+ ClearPageDiscarded(page);
+ free_cold_page(page);
+ freed++;
+ }
+ return freed;
+}
+#endif
+
/*
* Free a 0-order page
*/
@@ -795,6 +831,16 @@ static void fastcall free_hot_cold_page(
struct per_cpu_pages *pcp;
unsigned long flags;
+#if defined(CONFIG_PAGE_DISCARD_LIST)
+ if (page_host_discards() &&a...
2007 Apr 18
1
[patch 8/9] Guest page hinting: discarded page list.
...list_head pages_to_free = LIST_HEAD_INIT(pages_to_free);
+ struct page *page, *next;
+ unsigned long freed = 0;
+
+ if (!page_host_discards())
+ return 0;
+
+ on_each_cpu(__page_shrink_discards, &pages_to_free, 0, 1);
+
+ list_for_each_entry_safe(page, next, &pages_to_free, lru) {
+ ClearPageDiscarded(page);
+ free_cold_page(page);
+ freed++;
+ }
+ return freed;
+}
+#endif
+
/*
* Free a 0-order page
*/
@@ -795,6 +831,16 @@ static void fastcall free_hot_cold_page(
struct per_cpu_pages *pcp;
unsigned long flags;
+#if defined(CONFIG_PAGE_DISCARD_LIST)
+ if (page_host_discards() &&a...
2007 Apr 18
4
[patch 3/9] Guest page hinting: volatile page cache.
...mp;(page)->flags)
+#define PageStateChange(page) test_bit(PG_state_change, &(page)->flags)
+#define ClearPageStateChange(page) clear_bit(PG_state_change, &(page)->flags)
+#define TestSetPageStateChange(page) \
+ test_and_set_bit(PG_state_change, &(page)->flags)
+
+#define PageDiscarded(page) test_bit(PG_discarded, &(page)->flags)
+#define ClearPageDiscarded(page) clear_bit(PG_discarded, &(page)->flags)
+#define TestSetPageDiscarded(page) \
+ test_and_set_bit(PG_discarded, &(page)->flags)
+
struct page; /* forward declaration */
int test_clear_page_dirty(...
2007 Apr 18
4
[patch 3/9] Guest page hinting: volatile page cache.
...mp;(page)->flags)
+#define PageStateChange(page) test_bit(PG_state_change, &(page)->flags)
+#define ClearPageStateChange(page) clear_bit(PG_state_change, &(page)->flags)
+#define TestSetPageStateChange(page) \
+ test_and_set_bit(PG_state_change, &(page)->flags)
+
+#define PageDiscarded(page) test_bit(PG_discarded, &(page)->flags)
+#define ClearPageDiscarded(page) clear_bit(PG_discarded, &(page)->flags)
+#define TestSetPageDiscarded(page) \
+ test_and_set_bit(PG_discarded, &(page)->flags)
+
struct page; /* forward declaration */
int test_clear_page_dirty(...
2007 Jun 28
6
[patch 0/6] resend: guest page hinting version 5.
Greetings,
after Carsten pitched CMM2 on the kvm mini summit here is a repost
of version 5 of the guest page hinting patches. The code is still
the same but has been adapted to the latest git level.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
2007 Jun 28
6
[patch 0/6] resend: guest page hinting version 5.
Greetings,
after Carsten pitched CMM2 on the kvm mini summit here is a repost
of version 5 of the guest page hinting patches. The code is still
the same but has been adapted to the latest git level.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
2007 May 11
6
[patch 0/6] [rfc] guest page hinting version 5
After way to many months here is the fifth version of the guest page
hinting patches. Compared to version four a few improvements have been
added:
- Avoid page_host_discards() calls outside of page-states.h
- The discard list is now implemented via the page_free_discarded
hook and architecture specific code.
- PG_state_change page flag has been replaced with architecture
specficic
2007 May 11
6
[patch 0/6] [rfc] guest page hinting version 5
After way to many months here is the fifth version of the guest page
hinting patches. Compared to version four a few improvements have been
added:
- Avoid page_host_discards() calls outside of page-states.h
- The discard list is now implemented via the page_free_discarded
hook and architecture specific code.
- PG_state_change page flag has been replaced with architecture
specficic
2007 Apr 18
0
[patch 7/9] Guest page hinting: minor fault optimization.
..._swap_page(struct mm_struct
* Back out if somebody else already faulted in this pte.
*/
page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
- if (unlikely(!pte_same(*page_table, orig_pte)))
+ if (unlikely(!pte_same(*page_table, orig_pte) ||
+ (page_host_discards() && PageDiscarded(page))))
goto out_nomap;
if (unlikely(!PageUptodate(page))) {
@@ -2267,7 +2268,8 @@ retry:
* handle that later.
*/
/* Only go through if we didn't race with anybody else... */
- if (pte_none(*page_table)) {
+ if (pte_none(*page_table) &&
+ !unlikely(page_host_discards...
2007 Apr 18
0
[patch 7/9] Guest page hinting: minor fault optimization.
..._swap_page(struct mm_struct
* Back out if somebody else already faulted in this pte.
*/
page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
- if (unlikely(!pte_same(*page_table, orig_pte)))
+ if (unlikely(!pte_same(*page_table, orig_pte) ||
+ (page_host_discards() && PageDiscarded(page))))
goto out_nomap;
if (unlikely(!PageUptodate(page))) {
@@ -2267,7 +2268,8 @@ retry:
* handle that later.
*/
/* Only go through if we didn't race with anybody else... */
- if (pte_none(*page_table)) {
+ if (pte_none(*page_table) &&
+ !unlikely(page_host_discards...
2007 Apr 18
1
[patch 5/9] Guest page hinting: mlocked pages.
...discarded pages. This can happen if there have
+ * been discarded pages before a vma gets mlocked. The code
+ * in make_pages_present will force all discarded pages out
+ * and reload them. That happens after the VM_LOCKED bit
+ * has been set.
+ */
+ if (likely(!page_host_discards() || !PageDiscarded(page))) {
+ ret = SWAP_FAIL;
+ goto out_unmap;
+ }
}
/* Nuke the page table entry. */
2007 Apr 18
1
[patch 5/9] Guest page hinting: mlocked pages.
...discarded pages. This can happen if there have
+ * been discarded pages before a vma gets mlocked. The code
+ * in make_pages_present will force all discarded pages out
+ * and reload them. That happens after the VM_LOCKED bit
+ * has been set.
+ */
+ if (likely(!page_host_discards() || !PageDiscarded(page))) {
+ ret = SWAP_FAIL;
+ goto out_unmap;
+ }
}
/* Nuke the page table entry. */
2007 Apr 18
2
[patch 4/9] Guest page hinting: volatile swap cache.
...nlock.h>
#include <linux/buffer_head.h>
+#include <linux/swap.h>
#include "internal.h"
@@ -32,7 +33,8 @@ static inline int __page_discardable(str
*/
if (PageDirty(page) || PageReserved(page) || PageWriteback(page) ||
PageLocked(page) || PagePrivate(page) || PageDiscarded(page) ||
- !PageUptodate(page) || !PageLRU(page) || PageAnon(page))
+ !PageUptodate(page) || !PageLRU(page) ||
+ (PageAnon(page) && !PageSwapCache(page)))
return 0;
/*
@@ -149,15 +151,21 @@ static void __page_discard(struct page *
}
spin_unlock_irq(&zone->lru_l...
2007 Apr 18
2
[patch 4/9] Guest page hinting: volatile swap cache.
...nlock.h>
#include <linux/buffer_head.h>
+#include <linux/swap.h>
#include "internal.h"
@@ -32,7 +33,8 @@ static inline int __page_discardable(str
*/
if (PageDirty(page) || PageReserved(page) || PageWriteback(page) ||
PageLocked(page) || PagePrivate(page) || PageDiscarded(page) ||
- !PageUptodate(page) || !PageLRU(page) || PageAnon(page))
+ !PageUptodate(page) || !PageLRU(page) ||
+ (PageAnon(page) && !PageSwapCache(page)))
return 0;
/*
@@ -149,15 +151,21 @@ static void __page_discard(struct page *
}
spin_unlock_irq(&zone->lru_l...