![]() A compression tool compresses and decompresses data, e.g.A file archiver combines several files into one archive file, e.g.#define _swp_type(x) (((x).The traditional Unix archiving and compression tools are separated according to the Unix philosophy: #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > 5) #define SWP_OFFSET_SHIFT (SWP_OFFSET_FIRST_BIT + SWP_TYPE_BITS) * We always extract/encode the offset by shifting it all the way up, and then down again */ a/arch/x86/include/asm/pgtable-3level.h Replace all the magic "5" with the macro.Īrch/x86/include/asm/pgtable-3level.h | 8 ++++-ġ file changed, 4 insertions(+), 4 deletions(-)ĭiff -git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h ` (5 subsequent siblings) 6 siblings, 1 reply 27+ messages in thread 22:00 ` mm/swap: Comment all the ifdef in swapops.h Peter Xu 22:00 mm: Remember a/d bits for migration entries Peter 22:00 ` Peter Xu * mm/x86: Use SWP_TYPE_BITS in 3-level swap macros.Mm/swap: Cache swap migration A/D bits supportĪrch/x86/include/asm/pgtable-3level.h | 8 +. Mm/swap: Cache maximum swapfile size when init swap Mm: Remember young/dirty bit for page migrations Mm/thp: Carry over dirty bit when thp splits on pmd Mm/swap: Add swp_offset_pfn() to fetch PFN from swap entry ![]() Mm/swap: Comment all the ifdef in swapops.h Mm/x86: Use SWP_TYPE_BITS in 3-level swap macros Patch 6-7: Cache relevant fields to make migration_entry_supports_ad() fast. Patch 5: The core patch to remember young/dirty bit in swap offsets. Patch 3-4: Prepare for the introduction of migration A/D bits Patch 1-2: Cleanups from either previous versions or on swapops.h macros. Migrated will perform similarly like before migration happened. Similar effect can also be measured when writting the memory the 1st timeĪfter applying the patchset, both initial immediate read/write after page Test is with Intel(R) Xeon(R) CPU E5-2630 v4 2.20GHz. Moving 1G pages from node 0->1->0 then read it in page size jumps. Results for it and also swap_migration_ad_supported as a whole.Īfter the patchset applied, the immediate read access test of above 1GĬhunk after migration can shrink from 99ms to 4ms. Since max_swapfile_size() can be slow, the last two patches cache the Have enough swp offset field to keep both the PFN and the extra bits. We'll automatically remember the A/D bits when we find that we Max_swapfile_size() is used here to detect per-arch offset length in swpĮntries. Things like A/D bits, and that's how this series tried to approach this It means we do have some free bits in swp offset that we can use to store While the PFN is normally not as large as swp offset and normally smaller. Migration entries use swp offset to store PFN only, ![]() We have the chance to do so because in many systems the swap offset is not In the migration entries and carry them over when recovering the ptes. To solve this problem, this patchset tries to remember the young/dirty bits This issue is originally reported by Andrea Arcangeli. jumping in page size intervals - could take 99ms just because of theĮxtra setting on the young bit on a generic x86_64 system, comparing to 4ms In my test case, reading 1G chunk of memory Many of the recent upstream works showed that (2) is not something trivialĪnd actually very measurable. (2) There can be always extra overhead on the immediate next access toĪny migrated page, because hardware MMU needs cycles to set the youngīit again for reads, and dirty bits for write, as long as the That information shouldn't change even if the backing page is changed (1) We lost the real hot/cold information while we could have persisted. However that could lead to at least two problems: Rfc: migrate a page, right now we always mark the migrated page as old & ![]() Added two patches to cache both max_swapfile_size and Separate the dirty bit carry-over of pmd split to separate patch Added one ascii table for migration swp offset layout One more patch to add comment for "ifdef"s ` (6 more replies) 0 siblings, 7 replies 27+ messages in threadĬc: peterx, Minchan Kim, David Hildenbrand, Nadav Amit,Īndrew Morton, Hugh Dickins, Vlastimil Babka, Andrea Arcangeli,Īndi Kleen, Huang Ying, Kirill A. 22:00 ` mm/x86: Use SWP_TYPE_BITS in 3-level swap macros Peter Xu Mm: Remember a/d bits for migration entries LKML Archive on help / color / mirror / Atom feed * mm: Remember a/d bits for migration entries 22:00 Peter Xu
0 Comments
Leave a Reply. |