Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/poll: cache req->apoll_events

Avoid a potential reload of ->apoll_events post vfs_poll() by caching it
in a local variable.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+5 -3
+5 -3
io_uring/poll.c
··· 276 276 277 277 /* the mask was stashed in __io_poll_execute */ 278 278 if (!req->cqe.res) { 279 - struct poll_table_struct pt = { ._key = req->apoll_events }; 280 - req->cqe.res = vfs_poll(req->file, &pt) & req->apoll_events; 279 + __poll_t events = req->apoll_events; 280 + struct poll_table_struct pt = { ._key = events }; 281 + 282 + req->cqe.res = vfs_poll(req->file, &pt) & events; 281 283 /* 282 284 * We got woken with a mask, but someone else got to 283 285 * it first. The above vfs_poll() doesn't add us back ··· 288 286 */ 289 287 if (unlikely(!req->cqe.res)) { 290 288 /* Multishot armed need not reissue */ 291 - if (!(req->apoll_events & EPOLLONESHOT)) 289 + if (!(events & EPOLLONESHOT)) 292 290 continue; 293 291 return IOU_POLL_REISSUE; 294 292 }