Re: [PATCH v3 05/13] epoll: offload polling to a work in case of epfd polled from userspace

Roman Penyaev
2019-05-22T12:54:13Z

On 2019-05-21 09:51, Eric Wong wrote:
> Roman Penyaev <rpenyaev@suse.de> wrote:
>> diff --git a/fs/eventpoll.c b/fs/eventpoll.c
>> index 81da4571f1e0..9d3905c0afbf 100644
>> --- a/fs/eventpoll.c
>> +++ b/fs/eventpoll.c
>> @@ -44,6 +44,7 @@
>> #include <linux/seq_file.h>
>> #include <linux/compat.h>
>> #include <linux/rculist.h>
>> +#include <linux/workqueue.h>
>> #include <net/busy_poll.h>
>>
>> /*
>> @@ -185,6 +186,9 @@ struct epitem {
>>
>> /* The structure that describe the interested events and the source
>> fd */
>> struct epoll_event event;
>> +
>> + /* Work for offloading event callback */
>> + struct work_struct work;
>> };
>>
>> /*
>
> Can we avoid the size regression for existing epoll users?

Yeah, ->next, ->rdllink, ->ws are not used for user polling, so can hold
work
struct and co (or pointer on container which holds work struct, if work
struct
is huge).

--
Roman