From: Martin Sustrik <sustrik@250bpm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Sha Zhengju <handai.szj@taobao.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, Michael Kerrisk <mtk.manpages@gmail.com>,
Davide Libenzi <davidel@xmailserver.org>,
Andy Lutomirski <luto@amacapital.net>,
Eric Wong <normalperson@yhbt.net>
Subject: Re: [PATCH v2 1/1] eventfd: implementation of EFD_MASK flag
Date: Mon, 18 Feb 2013 09:54:31 +0100 [thread overview]
Message-ID: <5121EC47.2080402@250bpm.com> (raw)
In-Reply-To: <20130214145430.04f8750c.akpm@linux-foundation.org>
On 14/02/13 23:54, Andrew Morton wrote:
>> +/* On x86-64 keep the same binary layout as on i386. */
>> +#ifdef __x86_64__
>> +#define EVENTFD_MASK_PACKED __packed
>> +#else
>> +#define EVENTFD_MASK_PACKED
>> +#endif
>> +
>> +struct eventfd_mask {
>> + __u32 events;
>> + __u64 data;
>> +} EVENTFD_MASK_PACKED;
>
> The x86-64 specific thing is ugly. I can find no explanation of why it
> was done, but it should go away. You could make `events' a u64, or
> swap the order of the two fields and make the struct __packed on all
> architectures.
>
> Given that the size of the types is fixed, I see no compat issues here.
I've just copied how the definition is done for epoll_event. The comment
there goes like this:
/*
* On x86-64 make the 64bit structure have the same alignment as the
* 32bit structure. This makes 32bit emulation easier.
*
* UML/x86_64 needs the same packing as x86_64
*/
If you still think I should remove the #ifdef, I am happy to do so.
Martin
next prev parent reply other threads:[~2013-02-18 8:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-08 8:11 [PATCH v2 1/1] eventfd: implementation of EFD_MASK flag Martin Sustrik
2013-02-14 22:54 ` Andrew Morton
2013-02-14 23:57 ` Andy Lutomirski
2013-02-15 3:42 ` Martin Sustrik
2013-02-15 5:24 ` Andrew Morton
2013-02-15 17:32 ` Andy Lutomirski
2013-02-15 18:37 ` Martin Sustrik
2013-02-18 8:54 ` Martin Sustrik [this message]
2013-02-18 11:57 ` Martin Sustrik
-- strict thread matches above, loose matches on Subject: below --
2015-09-16 6:27 [PATCH v2 0/1] Generalize poll events from eventfd Damian Hobson-Garcia
[not found] ` <1442384836-13045-1-git-send-email-dhobsong-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
2015-09-16 6:27 ` [PATCH v2 1/1] eventfd: implementation of EFD_MASK flag Damian Hobson-Garcia
2015-09-16 6:27 ` Damian Hobson-Garcia
2015-09-16 6:51 ` Martin Sustrik
2015-09-16 7:43 ` Damian Hobson-Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5121EC47.2080402@250bpm.com \
--to=sustrik@250bpm.com \
--cc=akpm@linux-foundation.org \
--cc=davidel@xmailserver.org \
--cc=handai.szj@taobao.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtk.manpages@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=normalperson@yhbt.net \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.