public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: rusty@rustcorp.com.au
Cc: pavel@suse.cz, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org, akpm@zip.com.au
Subject: Re: [PATCH] Important per-cpu fix.
Date: Sun, 08 Sep 2002 23:13:04 -0700 (PDT)	[thread overview]
Message-ID: <20020908.231304.30400540.davem@redhat.com> (raw)
In-Reply-To: <20020909054106.19E762C0C4@lists.samba.org>

   From: Rusty Russell <rusty@rustcorp.com.au>
   Date: Mon, 09 Sep 2002 13:45:02 +1000

   	/* FIXME: Initializer required so gcc 2.96 doesn't put in BSS */
   	DEFINE_PER_CPU(int, xxx) = 0;
   
   everywhere, which can be deleted later

Why everywhere?  If you do it in the macro, then when you want
to delete the initializer remove the macro arg.  Then you cover
both in-kernel and cases in external sources because the build
will break for them so they'll know to fixup their macro invocation.

I hate when things change silently, and if you don't put it in
the macro, someone will get it wrong and we'll find out only
when someone with an older compiler uses that feature on an SMP
machine.

Read as: This is bad programming practice Rusty, regardless of
         your personal views about this particular GCC bug or
	 what you think is a legitimate initializer.

See spinlock_t's declaration for older GCC versions, that is how we
traditionally deal with compiler bugs like this, explicitly so that it
is impossible to "miss" something and get it wrong.

Everytime I asked Linus to rearrange some piece of code that used
spinlock_t initializers to workaround the "empty initializer at
end of struct" GCC bug he always told me "someone will get it
wrong if we do it that way"  And I think he's right.

  reply	other threads:[~2002-09-09  6:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-04  2:35 [PATCH] Important per-cpu fix Rusty Russell
2002-09-04  2:54 ` David S. Miller
2002-09-04  4:04   ` Rusty Russell
2002-09-04  4:52     ` H. Peter Anvin
2002-09-09  8:06       ` Rusty Russell
2002-09-09  8:16         ` David S. Miller
2002-09-04  5:05     ` David S. Miller
2002-09-04  5:17       ` Linus Torvalds
2002-09-04  5:12         ` David S. Miller
2002-09-04  6:00       ` Rusty Russell
2002-09-04  6:06         ` David S. Miller
2002-09-04  6:19           ` David S. Miller
2002-09-04  7:38             ` Rusty Russell
2002-09-06  9:57               ` Pavel Machek
2002-09-09  3:45                 ` Rusty Russell
2002-09-09  6:13                   ` David S. Miller [this message]
2002-09-09  8:17                     ` Rusty Russell
2002-09-09  8:15                       ` David S. Miller
2002-09-09 20:58                         ` Alan Cox
2002-09-09 21:06                           ` Andrew Morton
2002-09-10  9:41                         ` Rusty Russell
2002-09-04 15:44       ` Thunder from the hill
2002-09-04 23:18         ` David S. Miller
2002-09-04  2:56 ` Andrew Morton
2002-09-04  2:46   ` William Lee Irwin III
2002-09-04  3:42 ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2002-09-05  9:10 Dipankar Sarma
2002-09-05  9:09 ` William Lee Irwin III
2002-09-05 19:08   ` Dipankar Sarma
2002-09-05 19:11     ` William Lee Irwin III
2002-09-09 12:17 Matthew Wilcox
2002-09-09 23:24 ` Rusty Russell

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=20020908.231304.30400540.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@transmeta.com \
    /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