History

pktdvd: stop using bdi congestion framework.

The bdi congestion framework isn't widely used and should be deprecated. pktdvd makes use of it to track congestion, but this can be done entirely internally to pktdvd, so it doesn't need to use the framework. So introduce a "congested" flag. When waiting for bio_queue_size to drop, set this flag and a var_waitqueue() to wait for it. When bio_queue_size does drop and this flag is set, clear the flag and call wake_up_var(). We don't use a wait_var_event macro for the waiting as we need to set the flag and drop the spinlock before calling schedule() and while that is possible with __wait_var_event(), result is not easy to read.

NeilBrown committed 4 years ago

Commit db670971 parent 2385ebf2 files · +22 −11Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/pktcdvd.h+2−0
@@ -183,6 +183,8 @@ struct pktcdvd_device · 182 unmodified lines
183 spinlock_t lock; /* Serialize access to bio_queue */183 spinlock_t lock; /* Serialize access to bio_queue */
184 struct rb_root bio_queue; /* Work queue of bios we need to handle */184 struct rb_root bio_queue; /* Work queue of bios we need to handle */
185 int bio_queue_size; /* Number of nodes in bio_queue */185 int bio_queue_size; /* Number of nodes in bio_queue */
186 bool congested; /* Someone is waiting for bio_queue_size
187 * to drop. */
186 sector_t current_sector; /* Keep track of where the elevator is */188 sector_t current_sector; /* Keep track of where the elevator is */
187 atomic_t scan_queue; /* Set to non-zero when pkt_handle_queue */189 atomic_t scan_queue; /* Set to non-zero when pkt_handle_queue */
188 /* needs to be run. */190 /* needs to be run. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t