Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-6.7-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix a bug where heavy VAS (accelerator) usage could race with
partition migration and prevent the migration from completing.

- Update MAINTAINERS to add Aneesh & Naveen.

Thanks to Haren Myneni.

* tag 'powerpc-6.7-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
MAINTAINERS: powerpc: Add Aneesh & Naveen
powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

+48 -7
+2
MAINTAINERS
··· 12189 12189 M: Michael Ellerman <mpe@ellerman.id.au> 12190 12190 R: Nicholas Piggin <npiggin@gmail.com> 12191 12191 R: Christophe Leroy <christophe.leroy@csgroup.eu> 12192 + R: Aneesh Kumar K.V <aneesh.kumar@kernel.org> 12193 + R: Naveen N. Rao <naveen.n.rao@linux.ibm.com> 12192 12194 L: linuxppc-dev@lists.ozlabs.org 12193 12195 S: Supported 12194 12196 W: https://github.com/linuxppc/wiki/wiki
+44 -7
arch/powerpc/platforms/pseries/vas.c
··· 385 385 * same fault IRQ is not freed by the OS before. 386 386 */ 387 387 mutex_lock(&vas_pseries_mutex); 388 - if (migration_in_progress) 388 + if (migration_in_progress) { 389 389 rc = -EBUSY; 390 - else 390 + } else { 391 391 rc = allocate_setup_window(txwin, (u64 *)&domain[0], 392 392 cop_feat_caps->win_type); 393 + if (!rc) 394 + caps->nr_open_wins_progress++; 395 + } 396 + 393 397 mutex_unlock(&vas_pseries_mutex); 394 398 if (rc) 395 399 goto out; ··· 408 404 goto out_free; 409 405 410 406 txwin->win_type = cop_feat_caps->win_type; 411 - mutex_lock(&vas_pseries_mutex); 407 + 412 408 /* 409 + * The migration SUSPEND thread sets migration_in_progress and 410 + * closes all open windows from the list. But the window is 411 + * added to the list after open and modify HCALLs. So possible 412 + * that migration_in_progress is set before modify HCALL which 413 + * may cause some windows are still open when the hypervisor 414 + * initiates the migration. 415 + * So checks the migration_in_progress flag again and close all 416 + * open windows. 417 + * 413 418 * Possible to lose the acquired credit with DLPAR core 414 419 * removal after the window is opened. So if there are any 415 420 * closed windows (means with lost credits), do not give new ··· 426 413 * after the existing windows are reopened when credits are 427 414 * available. 428 415 */ 429 - if (!caps->nr_close_wins) { 416 + mutex_lock(&vas_pseries_mutex); 417 + if (!caps->nr_close_wins && !migration_in_progress) { 430 418 list_add(&txwin->win_list, &caps->list); 431 419 caps->nr_open_windows++; 420 + caps->nr_open_wins_progress--; 432 421 mutex_unlock(&vas_pseries_mutex); 433 422 vas_user_win_add_mm_context(&txwin->vas_win.task_ref); 434 423 return &txwin->vas_win; ··· 448 433 */ 449 434 free_irq_setup(txwin); 450 435 h_deallocate_vas_window(txwin->vas_win.winid); 436 + /* 437 + * Hold mutex and reduce nr_open_wins_progress counter. 438 + */ 439 + mutex_lock(&vas_pseries_mutex); 440 + caps->nr_open_wins_progress--; 441 + mutex_unlock(&vas_pseries_mutex); 451 442 out: 452 443 atomic_dec(&cop_feat_caps->nr_used_credits); 453 444 kfree(txwin); ··· 958 937 struct vas_caps *vcaps; 959 938 int i, rc = 0; 960 939 940 + pr_info("VAS migration event %d\n", action); 941 + 961 942 /* 962 943 * NX-GZIP is not enabled. Nothing to do for migration. 963 944 */ 964 945 if (!copypaste_feat) 965 946 return rc; 966 - 967 - mutex_lock(&vas_pseries_mutex); 968 947 969 948 if (action == VAS_SUSPEND) 970 949 migration_in_progress = true; ··· 1011 990 1012 991 switch (action) { 1013 992 case VAS_SUSPEND: 993 + mutex_lock(&vas_pseries_mutex); 1014 994 rc = reconfig_close_windows(vcaps, vcaps->nr_open_windows, 1015 995 true); 996 + /* 997 + * Windows are included in the list after successful 998 + * open. So wait for closing these in-progress open 999 + * windows in vas_allocate_window() which will be 1000 + * done if the migration_in_progress is set. 1001 + */ 1002 + while (vcaps->nr_open_wins_progress) { 1003 + mutex_unlock(&vas_pseries_mutex); 1004 + msleep(10); 1005 + mutex_lock(&vas_pseries_mutex); 1006 + } 1007 + mutex_unlock(&vas_pseries_mutex); 1016 1008 break; 1017 1009 case VAS_RESUME: 1010 + mutex_lock(&vas_pseries_mutex); 1018 1011 atomic_set(&caps->nr_total_credits, new_nr_creds); 1019 1012 rc = reconfig_open_windows(vcaps, new_nr_creds, true); 1013 + mutex_unlock(&vas_pseries_mutex); 1020 1014 break; 1021 1015 default: 1022 1016 /* should not happen */ ··· 1047 1011 goto out; 1048 1012 } 1049 1013 1014 + pr_info("VAS migration event (%d) successful\n", action); 1015 + 1050 1016 out: 1051 - mutex_unlock(&vas_pseries_mutex); 1052 1017 return rc; 1053 1018 } 1054 1019
+2
arch/powerpc/platforms/pseries/vas.h
··· 91 91 struct vas_caps { 92 92 struct vas_cop_feat_caps caps; 93 93 struct list_head list; /* List of open windows */ 94 + int nr_open_wins_progress; /* Number of open windows in */ 95 + /* progress. Used in migration */ 94 96 int nr_close_wins; /* closed windows in the hypervisor for DLPAR */ 95 97 int nr_open_windows; /* Number of successful open windows */ 96 98 u8 feat; /* Feature type */