Skip to content

Commit 2d1c37c

Browse files
xzpeterJuan Quintela
authored andcommitted
migration: Enable UFFD_FEATURE_THREAD_ID even without blocktime feat
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> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
1 parent 258f5c9 commit 2d1c37c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

migration/postcopy-ram.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,13 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis)
283283
}
284284

285285
#ifdef UFFD_FEATURE_THREAD_ID
286-
if (migrate_postcopy_blocktime() && mis &&
287-
UFFD_FEATURE_THREAD_ID & supported_features) {
288-
/* kernel supports that feature */
289-
/* don't create blocktime_context if it exists */
290-
if (!mis->blocktime_ctx) {
291-
mis->blocktime_ctx = blocktime_context_new();
292-
}
293-
286+
if (UFFD_FEATURE_THREAD_ID & supported_features) {
294287
asked_features |= UFFD_FEATURE_THREAD_ID;
288+
if (migrate_postcopy_blocktime()) {
289+
if (!mis->blocktime_ctx) {
290+
mis->blocktime_ctx = blocktime_context_new();
291+
}
292+
}
295293
}
296294
#endif
297295

0 commit comments

Comments
 (0)