diff mbox series

[RFC,03/15] migration: Enable UFFD_FEATURE_THREAD_ID even without blocktime feat

Message ID 20220119080929.39485-4-peterx@redhat.com
State New
Headers show
Series migration: Postcopy Preemption | expand

Commit Message

Peter Xu Jan. 19, 2022, 8:09 a.m. UTC
This patch allows us to read the tid even without blocktime feature enabled.
It's useful when tracing postcopy fault thread on faulted pages to show thread
id too with the address.

Remove the comments - they're merely not helpful at all.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/postcopy-ram.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Dr. David Alan Gilbert Jan. 19, 2022, 2:15 p.m. UTC | #1
* Peter Xu (peterx@redhat.com) wrote:
> This patch allows us to read the tid even without blocktime feature enabled.
> It's useful when tracing postcopy fault thread on faulted pages to show thread
> id too with the address.
> 
> Remove the comments - they're merely not helpful at all.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/postcopy-ram.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index d18b5d05b2..2176ed68a5 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -283,15 +283,13 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis)
>      }
>  
>  #ifdef UFFD_FEATURE_THREAD_ID
> -    if (migrate_postcopy_blocktime() && mis &&
> -        UFFD_FEATURE_THREAD_ID & supported_features) {
> -        /* kernel supports that feature */
> -        /* don't create blocktime_context if it exists */
> -        if (!mis->blocktime_ctx) {
> -            mis->blocktime_ctx = blocktime_context_new();
> -        }
> -
> +    if (UFFD_FEATURE_THREAD_ID & supported_features) {
>          asked_features |= UFFD_FEATURE_THREAD_ID;
> +        if (migrate_postcopy_blocktime()) {
> +            if (!mis->blocktime_ctx) {
> +                mis->blocktime_ctx = blocktime_context_new();
> +            }
> +        }
>      }
>  #endif
>  
> -- 
> 2.32.0
>
Juan Quintela Jan. 27, 2022, 9:40 a.m. UTC | #2
Peter Xu <peterx@redhat.com> wrote:
> This patch allows us to read the tid even without blocktime feature enabled.
> It's useful when tracing postcopy fault thread on faulted pages to show thread
> id too with the address.
>
> Remove the comments - they're merely not helpful at all.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

queued.
diff mbox series

Patch

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index d18b5d05b2..2176ed68a5 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -283,15 +283,13 @@  static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis)
     }
 
 #ifdef UFFD_FEATURE_THREAD_ID
-    if (migrate_postcopy_blocktime() && mis &&
-        UFFD_FEATURE_THREAD_ID & supported_features) {
-        /* kernel supports that feature */
-        /* don't create blocktime_context if it exists */
-        if (!mis->blocktime_ctx) {
-            mis->blocktime_ctx = blocktime_context_new();
-        }
-
+    if (UFFD_FEATURE_THREAD_ID & supported_features) {
         asked_features |= UFFD_FEATURE_THREAD_ID;
+        if (migrate_postcopy_blocktime()) {
+            if (!mis->blocktime_ctx) {
+                mis->blocktime_ctx = blocktime_context_new();
+            }
+        }
     }
 #endif