Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Sep 2011 11:31:54 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Peter Jeremy <peterjeremy@acm.org>
Cc:        Alexander Kabaev <kan@FreeBSD.org>, freebsd-current@FreeBSD.org
Subject:   Re: ZFS: i/o error - all block copies unavailable after upgrading to r225312
Message-ID:  <4E6C71FA.50906@FreeBSD.org>
In-Reply-To: <20110910110310.GA6263@server.vk2pj.dyndns.org>
References:  <20110901223646.14b8aae8@o2.pl> <4E60DBBD.1040703@FreeBSD.org> <4E679D3D.1000007@FreeBSD.org> <4E6B1285.70508@FreeBSD.org> <4E6B1AD4.6080206@FreeBSD.org> <4E6B320A.4090606@FreeBSD.org> <20110910110310.GA6263@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 10/09/2011 14:03 Peter Jeremy said the following:
> On 2011-Sep-10 12:46:50 +0300, Andriy Gapon <avg@FreeBSD.org> wrote:
>> on 10/09/2011 11:07 Andriy Gapon said the following:
>>> Actually, removing either -mrtd _or_ -fno-unit-at-a-time produces the
>>> correct code.  Puzzled.
>> 
>> The problem is reproducible with base gcc and gcc42, it is not
>> reproducible with gcc45, gcc46 and clang.
> 
> I was just checking gcc44 & gcc46.  gcc44 inlines the entire function and I
> couldn't quickly find the offending code to see if the bug was there or
> not.  I agree you've triggered a gcc bug but I'm not sure of the correct
> approach to fix it.  I've tried a few trivial code transforms within
> vdev_read_phys() but haven't stumbled on one that avoids the problem.
> 
> Since -mrtd changes the calling convention, it's a more intrusive change.
> I'm not sure if there's any simple way to alter CFLAGS for a single file
> (since we only want to alter the zfsboot.c compilation.

And I am actually wondering about -fno-unit-at-a-time option.
In my opinion this is an anti-optimization option and it can actually increase
a size of a final binary.  In fact, it looks like the option was introduced to
boot2 in r132870 in the year 2004, way before GCC 4.X switch, and it was
introduced to avoid some optimizations that produced broken code.
I wonder if there is any reason to keep using that option now.

At least the zfs boot code works fine without the option in my testing.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E6C71FA.50906>