Skip to contentSkip to conversation

xen/sched: remove pointless ASSERT() in credit2

PATCH Superseded Juergen Gross 2 participants 4 messages Feb 10, 2020 – Feb 11, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/sched: remove pointless ASSERT() in credit2

The ASSERT() at the top of csched2_context_saved() is completely pointless, as the BUG_ON() just in front of it catches the same problem already.

While at it remove a bogus space in the BUG_ON().

---
 xen/common/sched/credit2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
xen/common/sched/credit2.c +2 -4
index b965cd1c7b..78467b772c 100644
@@ -2167,10 +2167,8 @@ csched2_context_saved(const struct scheduler *ops, struct sched_unit *unit)
     s_time_t now = NOW();
     LIST_HEAD(were_parked);
 
-    BUG_ON( !is_idle_unit(unit) &&
-            svc->rqd != c2rqd(ops, sched_unit_master(unit)));
-    ASSERT(is_idle_unit(unit) ||
-           svc->rqd == c2rqd(ops, sched_unit_master(unit)));
+    BUG_ON(!is_idle_unit(unit) &&
+           svc->rqd != c2rqd(ops, sched_unit_master(unit)));
 
     /* This unit is now eligible to be put on the runqueue again */
     __clear_bit(__CSFLAG_scheduled, &svc->flags);
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 5 lines · Juergen Gross

The ASSERT() at the top of csched2_context_saved() is completely pointless, as the BUG_ON() just in front of it catches the same problem
already.

Yep, I went double checking and this is my fault. :-(

Apparently, in ccf2ead7f52 ("xen: credit2: make the code less experimental"), for this specific case, I added the assert but forgot to remove the BUG_ON().

Thanks for noticing and acting on this. :-)

TBH, though, considering the nature of the check, I'd rather keep the ASSERT() and kill the BUG_ON().

I can do the patch myself if you don't want to respin it that way.

Thanks again and Regards

Signature · 6 lines
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 12 lines · Dario Faggioli
Quoted 5 lines · Juergen Gross

The ASSERT() at the top of csched2_context_saved() is completely pointless, as the BUG_ON() just in front of it catches the same problem
already.

Yep, I went double checking and this is my fault. :-(

Apparently, in ccf2ead7f52 ("xen: credit2: make the code less experimental"), for this specific case, I added the assert but forgot to remove the BUG_ON().

Quoted 6 lines

Thanks for noticing and acting on this. :-)

TBH, though, considering the nature of the check, I'd rather keep the ASSERT() and kill the BUG_ON().

I can do the patch myself if you don't want to respin it that way.

I'll respin.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
Quoted 10 lines · Jürgen Groß
Quoted 6 lines · Dario Faggioli

TBH, though, considering the nature of the check, I'd rather keep the
ASSERT() and kill the BUG_ON().

I can do the patch myself if you don't want to respin it that way.

I'll respin.

Thanks!

On an not so related note... I have that other patch of yours, the one about Credit2 runqueues on my list.

Sorry it's taking a while to review it properly. I'll try to get to it ASAP.

Regards

Signature · 6 lines
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel