Skip to contentSkip to conversation

eventpoll: Don't re-zero eventpoll fields

PATCH Applied Joe Damato 3 participants 3 messages Aug 7, 2024

Subsystems (3)
lore
Share & tools
lore

Joe Damato

author
#0 lore raw

PATCH 1/1 eventpoll: Don't re-zero eventpoll fields

Remove redundant and unnecessary code.

ep_alloc uses kzalloc to create struct eventpoll, so there is no need to set fields to defaults of 0. This was accidentally introduced in commit 85455c795c07 ("eventpoll: support busy poll per epoll instance") and expanded on in follow-up commits.

---
 fs/eventpoll.c | 5 -----
 1 file changed, 5 deletions(-)
fs/eventpoll.c +0 -5
index f53ca4f7fced..6c0a1e9715ea 100644
@@ -2200,11 +2200,6 @@ static int do_epoll_create(int flags)
 		error = PTR_ERR(file);
 		goto out_free_fd;
 	}
-#ifdef CONFIG_NET_RX_BUSY_POLL
-	ep->busy_poll_usecs = 0;
-	ep->busy_poll_budget = 0;
-	ep->prefer_busy_poll = false;
-#endif
 	ep->file = file;
 	fd_install(fd, file);
 	return fd;
Signature · 1 line
2.25.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Joe Damato

Remove redundant and unnecessary code.

ep_alloc uses kzalloc to create struct eventpoll, so there is no need to set fields to defaults of 0. This was accidentally introduced in commit 85455c795c07 ("eventpoll: support busy poll per epoll instance") and expanded on in follow-up commits.

Looks good. Feel free to add:

Honza

Quoted 23 lines
---
 fs/eventpoll.c | 5 -----
 1 file changed, 5 deletions(-)
fs/eventpoll.c +0 -5
index f53ca4f7fced..6c0a1e9715ea 100644
@@ -2200,11 +2200,6 @@ static int do_epoll_create(int flags)
 		error = PTR_ERR(file);
 		goto out_free_fd;
 	}
-#ifdef CONFIG_NET_RX_BUSY_POLL
-	ep->busy_poll_usecs = 0;
-	ep->busy_poll_budget = 0;
-	ep->prefer_busy_poll = false;
-#endif
 	ep->file = file;
 	fd_install(fd, file);
 	return fd;
Signature · 1 line
2.25.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer Applied
#2 lore raw
In reply to Joe Damato
Quoted 8 lines · Joe Damato

Remove redundant and unnecessary code.

ep_alloc uses kzalloc to create struct eventpoll, so there is no need to set fields to defaults of 0. This was accidentally introduced in commit 85455c795c07 ("eventpoll: support busy poll per epoll instance") and expanded on in follow-up commits.

[...]

Applied to the vfs.misc.jeff branch of the vfs/vfs.git tree. Patches in the vfs.misc.jeff branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc.jeff

[1/1] eventpoll: Don't re-zero eventpoll fields

      https://git.kernel.org/vfs/vfs/c/394923595c20