Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164564615
D57442.id179602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
932 B
Referenced Files
None
Subscribers
None
D57442.id179602.diff
View Options
diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c
--- a/sys/dev/vt/vt_buf.c
+++ b/sys/dev/vt/vt_buf.c
@@ -45,6 +45,7 @@
#define VTBUF_LOCK(vb) mtx_lock_spin(&(vb)->vb_lock)
#define VTBUF_UNLOCK(vb) mtx_unlock_spin(&(vb)->vb_lock)
+#define VTBUF_LOCK_OWNED(vb) mtx_owned(&(vb)->vb_lock)
#define POS_INDEX(c, r) (((r) << 12) + (c))
#define POS_COPY(d, s) do { \
@@ -741,9 +742,19 @@
area.tr_end.tp_col = vb->vb_scr_size.tp_col;
area.tr_end.tp_row = MAX(s, e) + 1;
- VTBUF_LOCK(vb);
- vtbuf_dirty(vb, &area);
- VTBUF_UNLOCK(vb);
+ /*
+ * If the request originates from a keyboard, the vtbuf is
+ * locked by teken for the entire duration of the request.
+ * For all other sources, we avoid holding the spinlock for
+ * extended periods.
+ */
+ if (VTBUF_LOCK_OWNED(vb)) {
+ vtbuf_dirty(vb, &area);
+ } else {
+ VTBUF_LOCK(vb);
+ vtbuf_dirty(vb, &area);
+ VTBUF_UNLOCK(vb);
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 3, 3:05 AM (9 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33908570
Default Alt Text
D57442.id179602.diff (932 B)
Attached To
Mode
D57442: vt: Do not lock request comming from terminal, only those originated by mouse. Because the terminal surrounds requests to vt(4) with locking.
Attached
Detach File
Event Timeline
Log In to Comment