lkml.org 
[lkml]   [2003]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: gcc-3.2 breaks rmap on s390x
On Thu, 3 Apr 2003, Pete Zaitcev wrote:
>
> the following patch seems to fix my rmap problems on s390x.
>
> --- linux-2.4.20-2.1.24.z1/include/linux/mm.h 2003-03-27 21:30:09.000000000 -0500
> +++ linux-2.4.20-2.1.24.z2/include/linux/mm.h 2003-04-02 20:26:11.000000000 -0500
> @@ -376,8 +376,10 @@
> */
> #ifdef CONFIG_SMP
> while (test_and_set_bit(PG_chainlock, &page->flags)) {
> - while (test_bit(PG_chainlock, &page->flags))
> + while (test_bit(PG_chainlock, &page->flags)) {
> cpu_relax();
> + barrier();
> + }
> }
> #endif
> }

Isn't it rather odd that it should fix the problem you describe?
because the barrier you're adding comes only in the exceptional path,
when the lock was found already held. I suppose the compiler is free
to make the barrier more general than you've asked for, but it seems
unsafe to rely on that.

Hugh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site