Project

General

Profile

Bug #6599

kstat queues should assert on both platforms

Added by Rich Lowe over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2016-02-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

At present, we assert that q_len is not 0 on SPARC only, because SPARC seems to have asm implementations of kstat_q_* for some reason.

If the assert is a valid thing to do (and I say "assert", it appears to actually be not conditional on DEBUG), it should be done on both platforms. If invalid, on neither. It definitely should not be platform specific while in a common interface

History

#1

Updated by Toomas Soome over 4 years ago

Rich Lowe wrote:

At present, we assert that q_len is not 0 on SPARC only, because SPARC seems to have asm implementations of kstat_q_* for some reason.

If the assert is a valid thing to do (and I say "assert", it appears to actually be not conditional on DEBUG), it should be done on both platforms. If invalid, on neither. It definitely should not be platform specific while in a common interface

to be exact, on sparcv9 the asm code behaves as having VERIFY, while corresponding C code has ASSERT. I think it is not reasonable to dump asm code as its there for performance reasons and assuming its valid reason, I think, the correct course of action would be use VERIFY in C code as well.

#2

Updated by Toomas Soome over 4 years ago

After careful reading of how the SPARC code is implementing those kstat_* functlion, I have found an way to implement ASSERT like behavior, so we can continue to have ASSERT in C code and have both platforms to behave the same way.

#3

Updated by Electric Monk over 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 6e7bd6722c43b5bb4fa3bfb4961472f546ec2a6a

commit  6e7bd6722c43b5bb4fa3bfb4961472f546ec2a6a
Author: Toomas Soome <tsoome@me.com>
Date:   2016-02-18T21:10:42.000Z

    6599 kstat queues should assert on both platforms
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF