public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Willy Tarreau <w@1wt.eu>
Cc: linux-kernel@vger.kernel.org, Willy Tarreau <wtarreau@hera.kernel.org>
Subject: Re: 2.4.x: i386/x86_64 bitops clobberings
Date: Mon, 09 Oct 2006 00:53:56 +0200	[thread overview]
Message-ID: <45298184.1050006@web.de> (raw)
In-Reply-To: <20061008224440.GA30172@1wt.eu>

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

Willy Tarreau wrote:
> Hi Jan,
> 
> On Sun, Oct 08, 2006 at 11:42:07PM +0200, Jan Kiszka wrote:
>> Hi,
>>
>> after going through debugging hell with some out-of-tree code, I
>> realised that this patch
>>
>> http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92934bcbf96bc9dc931c40ca5f1a57685b7b813b
>>
>> makes a difference: current 2.6 works with the following code sequence
>> as expected (printk is executed), 2.4 fails.
>>
>>
>> #include <asm/bitops.h>
>> #include <linux/module.h>
>>
>> unsigned long a = 1;
>>
>> int module_init(void)
>> {
>> 	unsigned long b = 0;
>> 	int x;
>>
>> 	x = __test_and_set_bit(0, &b);
>> 	if (__test_and_set_bit(0, &a))
>> 		printk("x = %d\n", x);
>>
>> 	return -1;
>> }
>>
>>
>> There will likely be a way to work around my issue. Nevertheless, I
>> wondered if that patch was already considered for 2.4 inclusion. Or is
>> there no risk that in-tree code is affected?
> 
> While I remember some discussion on the subject for 2.6, I don't
> recall anything similiar in 2.4. Wouldn't you happen to build with
> gcc-3.4 ? IIRC, the clobbering changed around this version. Could

I used gcc 3.3.6-13 (Debian).

> you confirm that the patch you pointed above fixes the problem for
> your case ?

Yes. I ported the x86 part back to 2.4.33 and my problem disappeared.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 246 bytes --]

  reply	other threads:[~2006-10-08 22:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 21:42 2.4.x: i386/x86_64 bitops clobberings Jan Kiszka
2006-10-08 22:44 ` Willy Tarreau
2006-10-08 22:53   ` Jan Kiszka [this message]
2006-10-08 23:36     ` Willy Tarreau
2006-10-09  6:27       ` Jan Kiszka
2006-10-14 19:50         ` Willy Tarreau
2006-10-15  9:56           ` Jan Kiszka
2006-10-15 10:12             ` Willy Tarreau

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=45298184.1050006@web.de \
    --to=jan.kiszka@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    --cc=wtarreau@hera.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