From: Rusty Russell <rusty@rustcorp.com.au>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Hugh Dickins <hugh@veritas.com>, mingming cao <cmm@us.ibm.com>,
Andrew Morton <akpm@digeo.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]updated ipc lock patch
Date: Tue, 29 Oct 2002 09:39:26 +1100 [thread overview]
Message-ID: <20021028233518.0F5FF2C0FE@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 28 Oct 2002 09:08:55 -0800." <Pine.LNX.4.44.0210280906150.966-100000@blue1.dev.mcafeelabs.com>
In message <Pine.LNX.4.44.0210280906150.966-100000@blue1.dev.mcafeelabs.com> yo
u write:
> On Mon, 28 Oct 2002, Rusty Russell wrote:
>
> > I think it's clearer *why* it's being done than:
> >
> > struct ipc_rcu_kmalloc
> > {
> > struct rcu_head rcu;
> > } __attribute__((aligned(__alignof__(void *))));
>
> Well, not really Rusty. The above syntax uses documented gcc features
> already used inside the kernel, while the fact that void *data[0];
> enforces alignment it is not ( to my knowledge ) documented anywhere.
> You can also avoid the comment using the aligned syntax ...
A comment is definitely required: you must say *why* you are aligning
the structure (a clearer comment would be better, of course):
/* We return a pointer after the structure to the unwitting
caller: ensure safe alignment. */
The alignment of a structure member of type X is the alignment of type
X: this seems obvious to me. And "type X data[0];" is the standard
way of representing a variable struct.
Have we picked all the nits yet? 8)
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2002-10-28 23:28 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-28 1:15 Rusty Russell
2002-10-28 1:35 ` Davide Libenzi
2002-10-28 4:10 ` Rusty Russell
2002-10-28 17:08 ` Davide Libenzi
2002-10-28 22:39 ` Rusty Russell [this message]
2002-10-28 23:52 ` Davide Libenzi
[not found] <Pine.LNX.4.44.0210270748560.1704-100000@localhost.localdomain>
2002-10-28 1:06 ` Rusty Russell
2002-10-28 14:21 ` Hugh Dickins
2002-10-28 21:47 ` Rusty Russell
2002-10-29 0:26 ` Hugh Dickins
2002-10-29 2:51 ` Rusty Russell
2002-10-28 20:00 ` Dipankar Sarma
2002-10-28 21:41 ` Rusty Russell
2002-10-29 6:11 ` Dipankar Sarma
2002-10-28 22:07 ` mingming cao
2002-10-29 1:06 ` Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2002-10-25 17:20 Cliff White
2002-10-21 19:00 [PATCH]IPC locks breaking down with RCU Hugh Dickins
2002-10-24 21:49 ` [PATCH]updated ipc lock patch mingming cao
2002-10-24 22:29 ` Andrew Morton
2002-10-24 22:56 ` Hugh Dickins
2002-10-24 23:30 ` Andrew Morton
2002-10-24 23:59 ` Hugh Dickins
2002-10-25 0:07 ` mingming cao
2002-10-25 0:24 ` Andrew Morton
2002-10-25 4:18 ` Rusty Russell
2002-10-25 5:53 ` mingming cao
2002-10-25 7:27 ` Rusty Russell
2002-10-25 5:36 ` Manfred Spraul
2002-10-25 16:53 ` Rik van Riel
2002-10-24 23:23 ` mingming cao
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=20021028233518.0F5FF2C0FE@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=akpm@digeo.com \
--cc=cmm@us.ibm.com \
--cc=davidel@xmailserver.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome