All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: "David S. Miller" <davem@redhat.com>
Cc: pavel@suse.cz, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org, akpm@zip.com.au
Subject: Re: [PATCH] Important per-cpu fix.
Date: Mon, 09 Sep 2002 18:17:22 +1000	[thread overview]
Message-ID: <20020909081754.EC8382C09D@lists.samba.org> (raw)
In-Reply-To: Your message of "Sun, 08 Sep 2002 23:13:04 MST." <20020908.231304.30400540.davem@redhat.com>

In message <20020908.231304.30400540.davem@redhat.com> you write:
>    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.

So, you break everyone's compile later *and* you have to figure out
which initializers were required, and which ones were bogus.
*Planning* to break an interface is just stupid.

> 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.

Yeah, but you can still leave a spinlock uninitialized, and it'll
work.

I'm not making an interface harder to use because of one of 17
architectures refuses to fix a bug in their toolchain.  Just not
happening, sorry.

I want *you* to feel the pain, not spread it around by leaving turds
throughout the code long after the bug is forgotten:

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal working-2.5.33-cset-1.621/Makefile working-2.5.33-cset-1.621-catch-percpu/Makefile
--- working-2.5.33-cset-1.621/Makefile	2002-09-09 13:31:44.000000000 +1000
+++ working-2.5.33-cset-1.621-catch-percpu/Makefile	2002-09-09 18:06:51.000000000 +1000
@@ -282,6 +282,8 @@ cmd_link_vmlinux = $(LD) $(LDFLAGS) $(LD
 		-o vmlinux
 
 #	set -e makes the rule exit immediately on error
+#	Final awk script makes sure per-cpu vars are in per-cpu section, as
+#	old gcc (eg egcs 2.92.11) ignores section attribute if uninitialized.
 
 define rule_link_vmlinux
 	set -e
@@ -292,6 +294,7 @@ define rule_link_vmlinux
 	$(call cmd,link_vmlinux)
 	echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd
 	$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
+	awk '/ __per_cpu_start$/ { IN_PER_CPU=1 } / __per_cpu_end$/ { IN_PER_CPU=0 } /__per_cpu$/ { if (!IN_PER_CPU) { print $3 " not in per-cpu section" > "/dev/stderr"; FOUND=1; } } END { exit FOUND; }' < System.map
 endef
 
 vmlinux: $(vmlinux-objs) FORCE

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2002-09-09  8:13 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
2002-09-09  8:17                     ` Rusty Russell [this message]
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=20020909081754.EC8382C09D@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@zip.com.au \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --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 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.