Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146918724
D8098.1781542379.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8098.1781542379.diff
View Options
Index: sys/kern/vfs_bio.c
===================================================================
--- sys/kern/vfs_bio.c
+++ sys/kern/vfs_bio.c
@@ -4524,7 +4524,10 @@
mtxp = mtx_pool_find(mtxpool_sleep, bp);
mtx_lock(mtxp);
bp->b_flags |= B_DONE;
- wakeup(bp);
+ if (bp->b_flags & B_WAITING) {
+ bp->b_flags &= ~B_WAITING;
+ wakeup(bp);
+ }
mtx_unlock(mtxp);
}
@@ -4535,8 +4538,10 @@
mtxp = mtx_pool_find(mtxpool_sleep, bp);
mtx_lock(mtxp);
- while ((bp->b_flags & B_DONE) == 0)
+ while ((bp->b_flags & B_DONE) == 0) {
+ bp->b_flags |= B_WAITING;
msleep(bp, mtxp, pri, wchan, 0);
+ }
mtx_unlock(mtxp);
}
Index: sys/sys/buf.h
===================================================================
--- sys/sys/buf.h
+++ sys/sys/buf.h
@@ -199,7 +199,7 @@
#define B_CACHE 0x00000020 /* Bread found us in the cache. */
#define B_VALIDSUSPWRT 0x00000040 /* Valid write during suspension. */
#define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */
-#define B_00000100 0x00000100 /* Available flag. */
+#define B_WAITING 0x00000100 /* Waiter(s) active in bwait(). */
#define B_DONE 0x00000200 /* I/O completed. */
#define B_EINTR 0x00000400 /* I/O was interrupted */
#define B_NOREUSE 0x00000800 /* Contents not reused once released. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 15, 4:52 PM (18 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28904374
Default Alt Text
D8098.1781542379.diff (1 KB)
Attached To
Mode
D8098: Avoid unfruitful wakeups in bdone
Attached
Detach File
Event Timeline
Log In to Comment