Project

General

Profile

Actions

Submit #2714

closed

Spinlock changes

Added by dclink over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Kernel
Target version:
Start date:
08/16/2014
Due date:
% Done:

100%

Estimated time:

Description

- Adding descry field to struct spin lock, changed initialiser and spin_init function


Files

patch-spinlock.txt (52.6 KB) patch-spinlock.txt dclink, 08/16/2014 03:03 PM
Actions #1

Updated by dclink over 9 years ago

  • Status changed from New to Resolved
Actions #2

Updated by dclink over 9 years ago

  • Status changed from Resolved to Feedback
Actions #3

Updated by swildner over 9 years ago

I have looked at the patch, but it will not run with DEBUG_LOCKS in the kernel config. It gets stuck here right after entering the kernel from the loader, before the copyright messages and all. I guess it tries to kprintf() something at a point where kprintf() as such isn't usable yet. Have you tried it with DEBUG_LOCKS/DEBUG_LOCKS_LATENCY?

Furthermore, I've changed the following things in the patch:

  • Move descr to the bottom of struct spinlock at Matt's request.
  • Change the argument order of SPINLOCK_INITIALIZER() to match spin_init()'s order, i.e. "descr" becomes the second argument.
  • Fix a broken kprintf() in usched_dfly.c.
  • Move some kprintf()s around for cosmetic reasons.
  • Adjust indent.

The new patch is here -> http://leaf.dragonflybsd.org/~swildner/spinlock_descr.diff

Actions #4

Updated by dclink over 9 years ago

hi , thanks for review and above all the fix. I ve tested only DEBUG_LOCK_LATENCY sorry for the inconveniency, i ll be more careful for next.

Actions #5

Updated by swildner over 9 years ago

I have committed the bulk of your patch to master (http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ba87a4ab252df80acecfc25acfd9e406ea7f4c93), which is everything except the kprintf()s.

Do you want to submit a new patch for the kprintf()s? I am not 100% which make sense but right now there are two issues:

  • Without any further options, it prints the "choose worst queue.." messages frequently on normal operation (like booting and building world for example). Does it indicate an issue with usched_*?
  • With DEBUG_LOCKS, the system will not boot at all, presumably due to wanting to kprintf() too early, I guess from one of the messages in spinlock2.h

Thanks,
Sascha

Actions #6

Updated by dclink over 9 years ago

No it is ok like this it was more for using new descry field than anything else so it is probably better like this,

Thanks.
David CARLIER

Actions #7

Updated by swildner over 9 years ago

  • Status changed from Feedback to Closed

Thanks, pushed (ba87a4ab252df80acecfc25acfd9e406ea7f4c93)

Actions

Also available in: Atom PDF