lkml.org 
[lkml]   [2013]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] epoll: trim epitem by one cache line on x86_64
Andrew Morton <akpm@linux-foundation.org> wrote:
> It's going to be hard to maintain this - someone will change something
> sometime and break it. I suppose we could add a runtime check if we
> cared enough. Adding a big fat comment to struct epitem might help.

Thanks for looking at this patch. I'll send a patch with a comment
about keeping epitem size in check. Also, would adding (with comments):

BUILD_BUG_ON(sizeof(struct epitem) > 128);

...be too heavy-handed? I used that in my testing. I'll check for:
sizeof(void *) <= 8 too; in case 128-bit machines appear...

> I don't see much additional room to be saved. We could probably remove
> epitem.nwait, but that wouldn't actually save anything because nwait
> nestles with ffd.fd.

If we remove nwait, we can move epoll_event up and have event.events
tucked in there. I have more and more depending on epoll, so I'll be
around to comment on future epoll changes as they come up.

> I tested your patch on powerpc and it reduced sizeof(epitem) from 136
> to 128 for that arch as well, so I suggest we run with
>
> --- a/fs/eventpoll.c~epoll-trim-epitem-by-one-cache-line-on-x86_64-fix
> +++ a/fs/eventpoll.c
> @@ -105,7 +105,7 @@
> struct epoll_filefd {
> struct file *file;
> int fd;
> -} EPOLL_PACKED;
> +} __packed;

Thanks for testing on ppc. Looks good to me. For what it's worth:
Acked-by: Eric Wong <normalperson@yhbt.net>


\
 
 \ /
  Last update: 2013-03-07 12:22    [W:0.063 / U:1.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site