22 lines
1.1 KiB
Plaintext
22 lines
1.1 KiB
Plaintext
As we conclude, here is a list of questions for you to test your knowledge
|
|
regarding this chapter's material. You will find answers to selected
|
|
questions here:
|
|
https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/tree/main/solutions_to_assgn
|
|
|
|
Chapter 13 : Questions and/or Assignments
|
|
|
|
1. miscdrv_rdwr_refcount
|
|
Modify our earlier ch12/2_miscdrv_rdwr_spinlock/miscdrv_rdwr_spinlock.c
|
|
driver code; it has the integers ga and gb , which, when being read or
|
|
written were protected via a spinlock. Now make them refcount variables
|
|
(initializing them to some value, say, 42) and use the appropriate
|
|
refcount_t methods when working on them.
|
|
Include a test case where you deliberately make them go outside the valid
|
|
allowed range ([1..INT_MAX-1]).
|
|
|
|
2. If you haven't already, configure and build a "debug" kernel (ensure you
|
|
have the Lock Debugging config options enabled, as we explained in
|
|
the 'Configuring a debug kernel for lock debugging' section of this chapter).
|
|
Now, boot from it and try out a buggy kernel module (that has locking/deadlock
|
|
bugs); lockdep should catch and report this.
|