diff for duplicates of <87bmt1yboz.fsf@yhuang-dev.intel.com> diff --git a/a/1.txt b/N1/1.txt index 302bd84..700ff92 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -9,10 +9,10 @@ Tim Chen <tim.c.chen@linux.intel.com> writes: >> > > From: Huang Ying <ying.huang@intel.com> >> > > >> > > The swap cluster allocation/free functions are added based on the ->> > > existing swap cluster management mechanism for SSD.A A These functions +>> > > existing swap cluster management mechanism for SSD. These functions >> > > don't work for the rotating hard disks because the existing swap cluster ->> > > management mechanism doesn't work for them.A A The hard disks support may ->> > > be added if someone really need it.A A But that needn't be included in +>> > > management mechanism doesn't work for them. The hard disks support may +>> > > be added if someone really need it. But that needn't be included in >> > > this patchset. >> > > >> > > This will be used for the THP (Transparent Huge Page) swap support. @@ -26,17 +26,17 @@ Tim Chen <tim.c.chen@linux.intel.com> writes: >> > > Cc: Rik van Riel <riel@redhat.com> >> > > Signed-off-by: "Huang, Ying" <ying.huang@intel.com> >> > > --- ->> > > A mm/swapfile.c | 217 +++++++++++++++++++++++++++++++++++++++++----------------- ->> > > A 1 file changed, 156 insertions(+), 61 deletions(-) +>> > > mm/swapfile.c | 217 +++++++++++++++++++++++++++++++++++++++++----------------- +>> > > 1 file changed, 156 insertions(+), 61 deletions(-) >> > > >> > > diff --git a/mm/swapfile.c b/mm/swapfile.c >> > > index a744604384ff..91876c33114b 100644 >> > > --- a/mm/swapfile.c >> > > +++ b/mm/swapfile.c >> > > @@ -378,6 +378,14 @@ static void swap_cluster_schedule_discard(struct swap_info_struct *si, ->> > > A schedule_work(&si->discard_work); ->> > > A } ->> > > A +>> > > schedule_work(&si->discard_work); +>> > > } +>> > > >> > > +static void __free_cluster(struct swap_info_struct *si, unsigned long idx) >> > > +{ >> > > + struct swap_cluster_info *ci = si->cluster_info; @@ -45,38 +45,38 @@ Tim Chen <tim.c.chen@linux.intel.com> writes: >> > > + cluster_list_add_tail(&si->free_clusters, ci, idx); >> > > +} >> > > + ->> > > A /* ->> > > A * Doing discard actually. After a cluster discard is finished, the cluster ->> > > A * will be added to free cluster list. caller should hold si->lock. +>> > > /* +>> > > * Doing discard actually. After a cluster discard is finished, the cluster +>> > > * will be added to free cluster list. caller should hold si->lock. >> > > @@ -398,10 +406,7 @@ static void swap_do_scheduled_discard(struct swap_info_struct *si) ->> > > A ->> > > A spin_lock(&si->lock); ->> > > A ci = lock_cluster(si, idx * SWAPFILE_CLUSTER); +>> > > +>> > > spin_lock(&si->lock); +>> > > ci = lock_cluster(si, idx * SWAPFILE_CLUSTER); >> > > - cluster_set_flag(ci, CLUSTER_FLAG_FREE); >> > > - unlock_cluster(ci); >> > > - cluster_list_add_tail(&si->free_clusters, info, idx); >> > > - ci = lock_cluster(si, idx * SWAPFILE_CLUSTER); >> > > + __free_cluster(si, idx); ->> > > A memset(si->swap_map + idx * SWAPFILE_CLUSTER, ->> > > A 0, SWAPFILE_CLUSTER); ->> > > A unlock_cluster(ci); +>> > > memset(si->swap_map + idx * SWAPFILE_CLUSTER, +>> > > 0, SWAPFILE_CLUSTER); +>> > > unlock_cluster(ci); >> > The __free_cluster definition and the above change to eliminate >> > the extra unlock_cluster and lock_cluster can perhaps be broken up ->> > as a separate patch. A It can be independent of THP changes. +>> > as a separate patch. It can be independent of THP changes. >> I think the change may have no value by itself without THP changes. >> There will be only 1 user of __free_cluster() and the lock change is ->> trivial too.A A So I think it may be better just to keep it as that? +>> trivial too. So I think it may be better just to keep it as that? >> > > Seems like the extra unlock and lock of cluster in existing code should be taken out > irrespective of the THP changes: -> A +> > cluster_set_flag(ci, CLUSTER_FLAG_FREE); > - unlock_cluster(ci); > cluster_list_add_tail(&si->free_clusters, info, idx); > - ci = lock_cluster(si, idx * SWAPFILE_CLUSTER); > memset(si->swap_map + idx * SWAPFILE_CLUSTER, -> A A 0, SWAPFILE_CLUSTER); +> 0, SWAPFILE_CLUSTER); > This is not a functionality fix or performance optimization. Because @@ -87,9 +87,3 @@ code a little simpler. Is this deserved a separate patch? Best Regards, Huang, Ying - --- -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 96593d4..52079cf 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -7,11 +7,11 @@ "Subject\0Re: [PATCH -mm -v6 3/9] mm, THP, swap: Add swap cluster allocate/free functions\0" "Date\0Thu, 16 Mar 2017 14:31:40 +0800\0" "To\0Tim Chen <tim.c.chen@linux.intel.com>\0" - "Cc\0Huang" + "Cc\0Huang\\" Ying <ying.huang@intel.com> Andrew Morton <akpm@linux-foundation.org> - linux-mm@kvack.org - linux-kernel@vger.kernel.org + <linux-mm@kvack.org> + <linux-kernel@vger.kernel.org> Andrea Arcangeli <aarcange@redhat.com> Kirill A . Shutemov <kirill.shutemov@linux.intel.com> Hugh Dickins <hughd@google.com> @@ -31,10 +31,10 @@ ">> > > From: Huang Ying <ying.huang@intel.com>\n" ">> > > \n" ">> > > The swap cluster allocation/free functions are added based on the\n" - ">> > > existing swap cluster management mechanism for SSD.A A These functions\n" + ">> > > existing swap cluster management mechanism for SSD.\302\240\302\240These functions\n" ">> > > don't work for the rotating hard disks because the existing swap cluster\n" - ">> > > management mechanism doesn't work for them.A A The hard disks support may\n" - ">> > > be added if someone really need it.A A But that needn't be included in\n" + ">> > > management mechanism doesn't work for them.\302\240\302\240The hard disks support may\n" + ">> > > be added if someone really need it.\302\240\302\240But that needn't be included in\n" ">> > > this patchset.\n" ">> > > \n" ">> > > This will be used for the THP (Transparent Huge Page) swap support.\n" @@ -48,17 +48,17 @@ ">> > > Cc: Rik van Riel <riel@redhat.com>\n" ">> > > Signed-off-by: \"Huang, Ying\" <ying.huang@intel.com>\n" ">> > > ---\n" - ">> > > A mm/swapfile.c | 217 +++++++++++++++++++++++++++++++++++++++++-----------------\n" - ">> > > A 1 file changed, 156 insertions(+), 61 deletions(-)\n" + ">> > > \302\240mm/swapfile.c | 217 +++++++++++++++++++++++++++++++++++++++++-----------------\n" + ">> > > \302\2401 file changed, 156 insertions(+), 61 deletions(-)\n" ">> > > \n" ">> > > diff --git a/mm/swapfile.c b/mm/swapfile.c\n" ">> > > index a744604384ff..91876c33114b 100644\n" ">> > > --- a/mm/swapfile.c\n" ">> > > +++ b/mm/swapfile.c\n" ">> > > @@ -378,6 +378,14 @@ static void swap_cluster_schedule_discard(struct swap_info_struct *si,\n" - ">> > > A \tschedule_work(&si->discard_work);\n" - ">> > > A }\n" - ">> > > A \n" + ">> > > \302\240\tschedule_work(&si->discard_work);\n" + ">> > > \302\240}\n" + ">> > > \302\240\n" ">> > > +static void __free_cluster(struct swap_info_struct *si, unsigned long idx)\n" ">> > > +{\n" ">> > > +\tstruct swap_cluster_info *ci = si->cluster_info;\n" @@ -67,38 +67,38 @@ ">> > > +\tcluster_list_add_tail(&si->free_clusters, ci, idx);\n" ">> > > +}\n" ">> > > +\n" - ">> > > A /*\n" - ">> > > A * Doing discard actually. After a cluster discard is finished, the cluster\n" - ">> > > A * will be added to free cluster list. caller should hold si->lock.\n" + ">> > > \302\240/*\n" + ">> > > \302\240 * Doing discard actually. After a cluster discard is finished, the cluster\n" + ">> > > \302\240 * will be added to free cluster list. caller should hold si->lock.\n" ">> > > @@ -398,10 +406,7 @@ static void swap_do_scheduled_discard(struct swap_info_struct *si)\n" - ">> > > A \n" - ">> > > A \t\tspin_lock(&si->lock);\n" - ">> > > A \t\tci = lock_cluster(si, idx * SWAPFILE_CLUSTER);\n" + ">> > > \302\240\n" + ">> > > \302\240\t\tspin_lock(&si->lock);\n" + ">> > > \302\240\t\tci = lock_cluster(si, idx * SWAPFILE_CLUSTER);\n" ">> > > -\t\tcluster_set_flag(ci, CLUSTER_FLAG_FREE);\n" ">> > > -\t\tunlock_cluster(ci);\n" ">> > > -\t\tcluster_list_add_tail(&si->free_clusters, info, idx);\n" ">> > > -\t\tci = lock_cluster(si, idx * SWAPFILE_CLUSTER);\n" ">> > > +\t\t__free_cluster(si, idx);\n" - ">> > > A \t\tmemset(si->swap_map + idx * SWAPFILE_CLUSTER,\n" - ">> > > A \t\t\t\t0, SWAPFILE_CLUSTER);\n" - ">> > > A \t\tunlock_cluster(ci);\n" + ">> > > \302\240\t\tmemset(si->swap_map + idx * SWAPFILE_CLUSTER,\n" + ">> > > \302\240\t\t\t\t0, SWAPFILE_CLUSTER);\n" + ">> > > \302\240\t\tunlock_cluster(ci);\n" ">> > The __free_cluster definition and the above change to eliminate\n" ">> > the extra unlock_cluster and lock_cluster can perhaps be broken up\n" - ">> > as a separate patch. A It can be independent of THP changes.\n" + ">> > as a separate patch. \302\240It can be independent of THP changes.\n" ">> I think the change may have no value by itself without THP changes.\n" ">> There will be only 1 user of __free_cluster() and the lock change is\n" - ">> trivial too.A A So I think it may be better just to keep it as that?\n" + ">> trivial too.\302\240\302\240So I think it may be better just to keep it as that?\n" ">> \n" ">\n" "> Seems like the extra unlock and lock of cluster in existing code should be taken out\n" "> irrespective of the THP changes:\n" - "> A \n" + "> \302\240\n" "> \t\tcluster_set_flag(ci, CLUSTER_FLAG_FREE);\n" "> -\t\tunlock_cluster(ci);\n" "> \t\tcluster_list_add_tail(&si->free_clusters, info, idx);\n" "> -\t\tci = lock_cluster(si, idx * SWAPFILE_CLUSTER);\n" "> \t\tmemset(si->swap_map + idx * SWAPFILE_CLUSTER,\n" - "> A A \t\t\t\t0, SWAPFILE_CLUSTER);\n" + "> \302\240\302\240\t\t\t\t0, SWAPFILE_CLUSTER);\n" ">\n" "\n" "This is not a functionality fix or performance optimization. Because\n" @@ -108,12 +108,6 @@ "code a little simpler. Is this deserved a separate patch?\n" "\n" "Best Regards,\n" - "Huang, Ying\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>" + Huang, Ying -659aa4ceeca12678cc9e58399bf92a18250c0206e786f6e2b9ebf551da5bc934 +2175212b1760a2df9e4171f6a795688330fae261dbc89dc539a339b8d0eae45d
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.