diff for duplicates of <1489536859.2733.53.camel@linux.intel.com> diff --git a/a/1.txt b/N1/1.txt index bbb903b..53b50e9 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -2,15 +2,15 @@ On Wed, 2017-03-08 at 15:26 +0800, Huang, Ying wrote: > From: Huang Ying <ying.huang@intel.com> > > __swapcache_free() is added to support to clear the SWAP_HAS_CACHE flag -> for the huge page.A A This will free the specified swap cluster now. +> for the huge page. This will free the specified swap cluster now. > Because now this function will be called only in the error path to free -> the swap cluster just allocated.A A So the corresponding swap_map[i] == -> SWAP_HAS_CACHE, that is, the swap count is 0.A A This makes the +> the swap cluster just allocated. So the corresponding swap_map[i] == +> SWAP_HAS_CACHE, that is, the swap count is 0. This makes the > implementation simpler than that of the ordinary swap entry. > > This will be used for delaying splitting THP (Transparent Huge Page) -> during swapping out.A A Where for one THP to swap out, we will allocate a -> swap cluster, add the THP into the swap cache, then split the THP.A A If +> during swapping out. Where for one THP to swap out, we will allocate a +> swap cluster, add the THP into the swap cache, then split the THP. If > anything fails after allocating the swap cluster and before splitting > the THP successfully, the swapcache_free_trans_huge() will be used to > free the swap space allocated. @@ -23,54 +23,54 @@ On Wed, 2017-03-08 at 15:26 +0800, Huang, Ying wrote: > Cc: Rik van Riel <riel@redhat.com> > Signed-off-by: "Huang, Ying" <ying.huang@intel.com> > --- -> A include/linux/swap.h |A A 9 +++++++-- -> A mm/swapfile.cA A A A A A A A | 34 ++++++++++++++++++++++++++++++++-- -> A 2 files changed, 39 insertions(+), 4 deletions(-) +> include/linux/swap.h | 9 +++++++-- +> mm/swapfile.c | 34 ++++++++++++++++++++++++++++++++-- +> 2 files changed, 39 insertions(+), 4 deletions(-) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index e3a7609a8989..2f2a6c0363aa 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -394,7 +394,7 @@ extern void swap_shmem_alloc(swp_entry_t); -> A extern int swap_duplicate(swp_entry_t); -> A extern int swapcache_prepare(swp_entry_t); -> A extern void swap_free(swp_entry_t); +> extern int swap_duplicate(swp_entry_t); +> extern int swapcache_prepare(swp_entry_t); +> extern void swap_free(swp_entry_t); > -extern void swapcache_free(swp_entry_t); > +extern void __swapcache_free(swp_entry_t entry, bool huge); -> A extern void swapcache_free_entries(swp_entry_t *entries, int n); -> A extern int free_swap_and_cache(swp_entry_t); -> A extern int swap_type_of(dev_t, sector_t, struct block_device **); +> extern void swapcache_free_entries(swp_entry_t *entries, int n); +> extern int free_swap_and_cache(swp_entry_t); +> extern int swap_type_of(dev_t, sector_t, struct block_device **); > @@ -456,7 +456,7 @@ static inline void swap_free(swp_entry_t swp) -> A { -> A } -> A +> { +> } +> > -static inline void swapcache_free(swp_entry_t swp) > +static inline void __swapcache_free(swp_entry_t swp, bool huge) -> A { -> A } -> A +> { +> } +> > @@ -544,6 +544,11 @@ static inline swp_entry_t get_huge_swap_page(void) -> A } -> A #endif -> A +> } +> #endif +> > +static inline void swapcache_free(swp_entry_t entry) > +{ > + __swapcache_free(entry, false); > +} > + -> A #ifdef CONFIG_MEMCG -> A static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) -> A { +> #ifdef CONFIG_MEMCG +> static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) +> { > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 7241c937e52b..6019f94afbaf 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -855,6 +855,29 @@ static void swap_free_huge_cluster(struct swap_info_struct *si, -> A _swap_entry_free(si, offset, true); -> A } -> A +> _swap_entry_free(si, offset, true); +> } +> > +static void swapcache_free_trans_huge(struct swap_info_struct *si, -> + A A A A A A swp_entry_t entry) +> + swp_entry_t entry) > +{ > + unsigned long offset = swp_offset(entry); > + unsigned long idx = offset / SWAPFILE_CLUSTER; @@ -86,15 +86,9 @@ On Wed, 2017-03-08 at 15:26 +0800, Huang, Ying wrote: > + map[i] &= ~SWAP_HAS_CACHE; Nitpicking a bit: -map[i] = 0 A is more readable if map[i] == SWAP_HAS_CACHE here. +map[i] = 0 is more readable if map[i] == SWAP_HAS_CACHE here. Thanks. Tim - --- -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> diff --git a/a/content_digest b/N1/content_digest index 809a481..68a6926 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -20,15 +20,15 @@ "> From: Huang Ying <ying.huang@intel.com>\n" "> \n" "> __swapcache_free() is added to support to clear the SWAP_HAS_CACHE flag\n" - "> for the huge page.A A This will free the specified swap cluster now.\n" + "> for the huge page.\302\240\302\240This will free the specified swap cluster now.\n" "> Because now this function will be called only in the error path to free\n" - "> the swap cluster just allocated.A A So the corresponding swap_map[i] ==\n" - "> SWAP_HAS_CACHE, that is, the swap count is 0.A A This makes the\n" + "> the swap cluster just allocated.\302\240\302\240So the corresponding swap_map[i] ==\n" + "> SWAP_HAS_CACHE, that is, the swap count is 0.\302\240\302\240This makes the\n" "> implementation simpler than that of the ordinary swap entry.\n" "> \n" "> This will be used for delaying splitting THP (Transparent Huge Page)\n" - "> during swapping out.A A Where for one THP to swap out, we will allocate a\n" - "> swap cluster, add the THP into the swap cache, then split the THP.A A If\n" + "> during swapping out.\302\240\302\240Where for one THP to swap out, we will allocate a\n" + "> swap cluster, add the THP into the swap cache, then split the THP.\302\240\302\240If\n" "> anything fails after allocating the swap cluster and before splitting\n" "> the THP successfully, the swapcache_free_trans_huge() will be used to\n" "> free the swap space allocated.\n" @@ -41,54 +41,54 @@ "> Cc: Rik van Riel <riel@redhat.com>\n" "> Signed-off-by: \"Huang, Ying\" <ying.huang@intel.com>\n" "> ---\n" - "> A include/linux/swap.h |A A 9 +++++++--\n" - "> A mm/swapfile.cA A A A A A A A | 34 ++++++++++++++++++++++++++++++++--\n" - "> A 2 files changed, 39 insertions(+), 4 deletions(-)\n" + "> \302\240include/linux/swap.h |\302\240\302\2409 +++++++--\n" + "> \302\240mm/swapfile.c\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240| 34 ++++++++++++++++++++++++++++++++--\n" + "> \302\2402 files changed, 39 insertions(+), 4 deletions(-)\n" "> \n" "> diff --git a/include/linux/swap.h b/include/linux/swap.h\n" "> index e3a7609a8989..2f2a6c0363aa 100644\n" "> --- a/include/linux/swap.h\n" "> +++ b/include/linux/swap.h\n" "> @@ -394,7 +394,7 @@ extern void swap_shmem_alloc(swp_entry_t);\n" - "> A extern int swap_duplicate(swp_entry_t);\n" - "> A extern int swapcache_prepare(swp_entry_t);\n" - "> A extern void swap_free(swp_entry_t);\n" + "> \302\240extern int swap_duplicate(swp_entry_t);\n" + "> \302\240extern int swapcache_prepare(swp_entry_t);\n" + "> \302\240extern void swap_free(swp_entry_t);\n" "> -extern void swapcache_free(swp_entry_t);\n" "> +extern void __swapcache_free(swp_entry_t entry, bool huge);\n" - "> A extern void swapcache_free_entries(swp_entry_t *entries, int n);\n" - "> A extern int free_swap_and_cache(swp_entry_t);\n" - "> A extern int swap_type_of(dev_t, sector_t, struct block_device **);\n" + "> \302\240extern void swapcache_free_entries(swp_entry_t *entries, int n);\n" + "> \302\240extern int free_swap_and_cache(swp_entry_t);\n" + "> \302\240extern int swap_type_of(dev_t, sector_t, struct block_device **);\n" "> @@ -456,7 +456,7 @@ static inline void swap_free(swp_entry_t swp)\n" - "> A {\n" - "> A }\n" - "> A \n" + "> \302\240{\n" + "> \302\240}\n" + "> \302\240\n" "> -static inline void swapcache_free(swp_entry_t swp)\n" "> +static inline void __swapcache_free(swp_entry_t swp, bool huge)\n" - "> A {\n" - "> A }\n" - "> A \n" + "> \302\240{\n" + "> \302\240}\n" + "> \302\240\n" "> @@ -544,6 +544,11 @@ static inline swp_entry_t get_huge_swap_page(void)\n" - "> A }\n" - "> A #endif\n" - "> A \n" + "> \302\240}\n" + "> \302\240#endif\n" + "> \302\240\n" "> +static inline void swapcache_free(swp_entry_t entry)\n" "> +{\n" "> +\t__swapcache_free(entry, false);\n" "> +}\n" "> +\n" - "> A #ifdef CONFIG_MEMCG\n" - "> A static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)\n" - "> A {\n" + "> \302\240#ifdef CONFIG_MEMCG\n" + "> \302\240static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)\n" + "> \302\240{\n" "> diff --git a/mm/swapfile.c b/mm/swapfile.c\n" "> index 7241c937e52b..6019f94afbaf 100644\n" "> --- a/mm/swapfile.c\n" "> +++ b/mm/swapfile.c\n" "> @@ -855,6 +855,29 @@ static void swap_free_huge_cluster(struct swap_info_struct *si,\n" - "> A \t_swap_entry_free(si, offset, true);\n" - "> A }\n" - "> A \n" + "> \302\240\t_swap_entry_free(si, offset, true);\n" + "> \302\240}\n" + "> \302\240\n" "> +static void swapcache_free_trans_huge(struct swap_info_struct *si,\n" - "> +\t\t\t\tA A A A A A swp_entry_t entry)\n" + "> +\t\t\t\t\302\240\302\240\302\240\302\240\302\240\302\240swp_entry_t entry)\n" "> +{\n" "> +\tunsigned long offset = swp_offset(entry);\n" "> +\tunsigned long idx = offset / SWAPFILE_CLUSTER;\n" @@ -104,17 +104,11 @@ "> +\t\tmap[i] &= ~SWAP_HAS_CACHE;\n" "\n" "Nitpicking a bit:\n" - "map[i] = 0 A is more readable if map[i] == SWAP_HAS_CACHE here.\n" + "map[i] = 0 \302\240is more readable if map[i] == SWAP_HAS_CACHE here.\n" "\n" "\n" "Thanks.\n" "\n" - "Tim\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + Tim -3e2064a7add751f77bbad5505a0f89875846458a39ab369f6f9f16eca299ae9f +266c1aca7c3c09a1f8bd20f8066fba5e1fc7e9cde0d0bef84c4c02ba6cfc1128
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.