Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2019 21:13:05 -0700
From:      Xin Li <delphij@FreeBSD.org>
To:        cem@freebsd.org
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>, kib@freebsd.org
Subject:   Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker...
Message-ID:  <58af4bc5-0097-1540-be64-e9bceab6d4f8@FreeBSD.org>
In-Reply-To: <CAG6CVpXCgz-fxC11RyO1oL50UEoNFa%2Bck_TUf-eOm73sd5yyTQ@mail.gmail.com>
References:  <201906171949.x5HJn9Ed091108@repo.freebsd.org> <CAG6CVpXCgz-fxC11RyO1oL50UEoNFa%2Bck_TUf-eOm73sd5yyTQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--El5xSSqvJdctsskaVtUROdjjySJWxQGZi
Content-Type: multipart/mixed; boundary="sHl1TCSPVBIEDsBcTLotjbMNyEdGRZhjy";
 protected-headers="v1"
From: Xin Li <delphij@FreeBSD.org>
To: cem@freebsd.org
Cc: src-committers <src-committers@freebsd.org>,
 svn-src-all <svn-src-all@freebsd.org>,
 svn-src-head <svn-src-head@freebsd.org>, kib@freebsd.org
Message-ID: <58af4bc5-0097-1540-be64-e9bceab6d4f8@FreeBSD.org>
Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf
 sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net
 sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker...
References: <201906171949.x5HJn9Ed091108@repo.freebsd.org>
 <CAG6CVpXCgz-fxC11RyO1oL50UEoNFa+ck_TUf-eOm73sd5yyTQ@mail.gmail.com>
In-Reply-To: <CAG6CVpXCgz-fxC11RyO1oL50UEoNFa+ck_TUf-eOm73sd5yyTQ@mail.gmail.com>

--sHl1TCSPVBIEDsBcTLotjbMNyEdGRZhjy
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 6/22/19 17:15, Conrad Meyer wrote:
> Hi Xin Li,
>=20
> On Mon, Jun 17, 2019 at 12:49 PM Xin LI <delphij@freebsd.org> wrote:
>>
>> Author: delphij
>> Date: Mon Jun 17 19:49:08 2019
>> New Revision: 349151
>> URL: https://svnweb.freebsd.org/changeset/base/349151
>>
>> Log:
>>   Separate kernel crc32() implementation to its own header (gsb_crc32.=
h) and
>>   rename the source to gsb_crc32.c.
>>
>>   This is a prerequisite of unifying kernel zlib instances.
>>
>> ...
>> Modified: head/sys/libkern/x86/crc32_sse42.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/libkern/x86/crc32_sse42.c  Mon Jun 17 17:35:55 2019      =
  (r349150)
>> +++ head/sys/libkern/x86/crc32_sse42.c  Mon Jun 17 19:49:08 2019      =
  (r349151)
>> @@ -29,14 +29,14 @@ __FBSDID("$FreeBSD$");
>>  /*
>>   * This file is compiled in userspace in order to run ATF unit tests.=

>>   */
>> -#ifdef USERSPACE_TESTING
>> +#ifndef _KERNEL
>=20
> This change and following identical changes revert a request by kib@
> in https://reviews.freebsd.org/D9342 .  (When this revision was
> initially proposed in  , it was '#ifndef _KERNEL' =E2=80=94 kib@ reques=
ted the
> use of a different preprocessor macro.)

Thanks for pointing this out -- admittedly, I haven't read the reasoning
before.

But after reading more about the original review context, I don't quite
agree with Kostik's reasoning because the code actually works in
userland regardless of the original intention.  It's true that the code
is at the time only used in the test program, but they do enabled usage
in userland, and they by themselves do not serve purely test purposed
task (these are not mock interfaces, nor test cases, etc.), and the
common practice in sys/libkern is to wrap these with #if[n]def _KERNEL.

I don't insist but I still think it's more reasonable to use _KERNEL
because it's more consistent with the surrounding code.

Cheers,


--sHl1TCSPVBIEDsBcTLotjbMNyEdGRZhjy--

--El5xSSqvJdctsskaVtUROdjjySJWxQGZi
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJdDvxYAAoJEEB5f3yV9INPvW4P/2dsu9GGnDtrKVyrGY75Y+vx
jLuxdPJc9kYRWK6gblM/G8/23R7svJMn5l/Gotj2YA/boV4hCtOvvY9wq4S2+BPT
I04pnhSGt6YP/6y2XNfzptQ4M0zAaXJh4XYjmS0wmMTUdRCI6uKcRSRkebDvMs3F
S/tdHWIOSTU3wuVyGSRWgxrWSVcuSLe1JXVrvWWX5s/gkJoZuQTXje4E5/l/A9KP
b5flSdLZi69vDISXCp6Q22pJRTU64fTIf12OUYwkXRBF82VRyXADBCEGPsravCCy
flR+qmdZkh9m6fCpSCsMFKswZTNQvf/20T0hjhmr8M+DWUpjcxFbfZQTkbmskd4S
q8lQQ56cO8DxvhiWBKP8ToGeQzTcZaw9wVw6FyPt9ZN9ZhUigUbEYhtcK+fmikb2
XQfUT4N1XL/+LbGQXsTpdbMkzGIlt9ZxOsRb9WLlcE/ScUXEbsuarjKM4nxsv0zZ
9Lp+E2ECmJd1hMhlx70e/8ZFhuQt8veKcDcE1k9ykuPQT224UEV9CNBNc/+LAWD1
HNiXczHNtxCn+D9Bllap3Dk3ibU4TOAqGSJUK/76ZtBsGXEIBXMPGCrSoom0TI3o
+X5r0YHqpf9zRgv0lyKwKd0nyoM5y9q58r04OXkLEQdxqiFXoCV85Ah+izIKUILh
v09ZvimTPls1EODpConL
=Da5+
-----END PGP SIGNATURE-----

--El5xSSqvJdctsskaVtUROdjjySJWxQGZi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58af4bc5-0097-1540-be64-e9bceab6d4f8>