@@ -478,6 +478,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
478
478
*/
479
479
atomic_dec (& rdtgrp -> waitcount );
480
480
kfree (callback );
481
+ rdt_last_cmd_puts ("task exited\n" );
481
482
} else {
482
483
/*
483
484
* For ctrl_mon groups move both closid and rmid.
@@ -488,10 +489,12 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
488
489
tsk -> closid = rdtgrp -> closid ;
489
490
tsk -> rmid = rdtgrp -> mon .rmid ;
490
491
} else if (rdtgrp -> type == RDTMON_GROUP ) {
491
- if (rdtgrp -> mon .parent -> closid == tsk -> closid )
492
+ if (rdtgrp -> mon .parent -> closid == tsk -> closid ) {
492
493
tsk -> rmid = rdtgrp -> mon .rmid ;
493
- else
494
+ } else {
495
+ rdt_last_cmd_puts ("Can't move task to different control group\n" );
494
496
ret = - EINVAL ;
497
+ }
495
498
}
496
499
}
497
500
return ret ;
@@ -510,8 +513,10 @@ static int rdtgroup_task_write_permission(struct task_struct *task,
510
513
*/
511
514
if (!uid_eq (cred -> euid , GLOBAL_ROOT_UID ) &&
512
515
!uid_eq (cred -> euid , tcred -> uid ) &&
513
- !uid_eq (cred -> euid , tcred -> suid ))
516
+ !uid_eq (cred -> euid , tcred -> suid )) {
517
+ rdt_last_cmd_printf ("No permission to move task %d\n" , task -> pid );
514
518
ret = - EPERM ;
519
+ }
515
520
516
521
put_cred (tcred );
517
522
return ret ;
@@ -528,6 +533,7 @@ static int rdtgroup_move_task(pid_t pid, struct rdtgroup *rdtgrp,
528
533
tsk = find_task_by_vpid (pid );
529
534
if (!tsk ) {
530
535
rcu_read_unlock ();
536
+ rdt_last_cmd_printf ("No task %d\n" , pid );
531
537
return - ESRCH ;
532
538
}
533
539
} else {
@@ -555,6 +561,7 @@ static ssize_t rdtgroup_tasks_write(struct kernfs_open_file *of,
555
561
if (kstrtoint (strstrip (buf ), 0 , & pid ) || pid < 0 )
556
562
return - EINVAL ;
557
563
rdtgrp = rdtgroup_kn_lock_live (of -> kn );
564
+ rdt_last_cmd_clear ();
558
565
559
566
if (rdtgrp )
560
567
ret = rdtgroup_move_task (pid , rdtgrp , of );
0 commit comments