Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Dec 2020 21:35:53 +0100 (CET)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        FreeBSD Current <freebsd-current@freebsd.org>, Allan Jude <allanjude@freebsd.org>
Subject:   Re: Enabling AESNI by default
Message-ID:  <750559933.8900.1609446953164@localhost>
In-Reply-To: <5d56280e-a8dd-b28d-7039-f8fe0bc0cd6f@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

 Yes! Took me until last month to notice that I needed to load aesni in loader.conf instead of rc.conf because swap geli is configured before kld_list.
Years of optimization thrown away.


Regards, 
Ronald.


Van: Allan Jude <allanjude@freebsd.org>
Datum: 31 december 2020 20:51
Aan: FreeBSD Current <freebsd-current@freebsd.org>
Onderwerp: Enabling AESNI by default

> 
> 
> We've had the AESNI module for quite a few years now, and it has not
> caused any problems.
> 
> I am wondering if there are any objections to including it in GENERIC,
> so that users get the benefit without having to have the "tribal
> knowledge" that 'to accelerate kernel crypto (GELI, ZFS, IPSEC, etc),
> you need to load aesni.ko'
> 
> Userspace crypto that uses openssl or similar libraries is already
> taking advantage of these CPU instructions if they are available, by
> excluding this feature from GENERIC we are just causing the "out of the
> box" experience to by very very slow for crypto.
> 
> For example, writing 1MB blocks to a GELI encrypted swap-backed md(4)
> device:
> 
> with 8 jobs on a 10 core Intel Xeon CPU E5-2630 v4 @ 2.20GHz
> 
> fio --filename=/dev/md0.eli --device=1 --name=geli --rw=write --bs=1m
> --numjobs=8 --iodepth=16 --end_fsync=1 --ioengine=pvsync
> --group_reporting --fallocate=none --runtime=60 --time_based
> 
> 
> stock:
> write: IOPS=530, BW=530MiB/s (556MB/s) (31.1GiB/60012msec)
> 
> with aesni.ko loaded:
> write: IOPS=2824, BW=2825MiB/s (2962MB/s) (166GiB/60002msec)
> 
> 
> Does anyone have a compelling reason to deny our users the 5x speedup?
> 
> 
> -- 
> Allan Jude
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
> 
> 
> 
> 
From owner-freebsd-current@freebsd.org  Thu Dec 31 21:58:26 2020
Return-Path: <owner-freebsd-current@freebsd.org>
Delivered-To: freebsd-current@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5450F4D0F10
 for <freebsd-current@mailman.nyi.freebsd.org>;
 Thu, 31 Dec 2020 21:58:26 +0000 (UTC)
 (envelope-from bsd-lists@bsdforge.com)
Received: from udns.ultimatedns.net (static-24-113-41-81.wavecable.com
 [24.113.41.81])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "ultimatedns.net",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D6MV96Ssdz3v7P;
 Thu, 31 Dec 2020 21:58:25 +0000 (UTC)
 (envelope-from bsd-lists@bsdforge.com)
Received: from ultimatedns.net (localhost [127.0.0.1])
 by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 0BVLx2Ou045282;
 Thu, 31 Dec 2020 13:59:08 -0800 (PST)
 (envelope-from bsd-lists@bsdforge.com)
MIME-Version: 1.0
Date: Thu, 31 Dec 2020 13:59:02 -0800
From: Chris <bsd-lists@bsdforge.com>
To: Allan Jude <allanjude@freebsd.org>
Cc: FreeBSD Current <freebsd-current@freebsd.org>
Subject: Re: Enabling AESNI by default
In-Reply-To: <5d56280e-a8dd-b28d-7039-f8fe0bc0cd6f@freebsd.org>
References: <5d56280e-a8dd-b28d-7039-f8fe0bc0cd6f@freebsd.org>
User-Agent: UDNSMS/17.0
Message-ID: <048a95427c6a9c30fad8f2dd882dc70f@bsdforge.com>
X-Sender: bsd-lists@bsdforge.com
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: 4D6MV96Ssdz3v7P
X-Spamd-Bar: /
X-Spamd-Result: default: False [0.00 / 15.00];
 ASN(0.00)[asn:11404, ipnet:24.113.0.0/16, country:US];
 local_wl_ip(0.00)[24.113.41.81]
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 31 Dec 2020 21:58:26 -0000

On 2020-12-31 11:51, Allan Jude wrote:
> We've had the AESNI module for quite a few years now, and it has not
> caused any problems.
> 
> I am wondering if there are any objections to including it in GENERIC,
> so that users get the benefit without having to have the "tribal
> knowledge" that 'to accelerate kernel crypto (GELI, ZFS, IPSEC, etc),
> you need to load aesni.ko'
> 
> Userspace crypto that uses openssl or similar libraries is already
> taking advantage of these CPU instructions if they are available, by
> excluding this feature from GENERIC we are just causing the "out of the
> box" experience to by very very slow for crypto.
> 
> For example, writing 1MB blocks to a GELI encrypted swap-backed md(4)
> device:
> 
> with 8 jobs on a 10 core Intel Xeon CPU E5-2630 v4 @ 2.20GHz
> 
> fio --filename=/dev/md0.eli --device=1 --name=geli --rw=write --bs=1m
> --numjobs=8 --iodepth=16 --end_fsync=1 --ioengine=pvsync
> --group_reporting --fallocate=none --runtime=60 --time_based
> 
> 
> stock:
> write: IOPS=530, BW=530MiB/s (556MB/s) (31.1GiB/60012msec)
> 
> with aesni.ko loaded:
> write: IOPS=2824, BW=2825MiB/s (2962MB/s) (166GiB/60002msec)
> 
> 
> Does anyone have a compelling reason to deny our users the 5x speedup?
FWIW I'd just like to suggest that I'm a +1 for adding it to GENERIC.
Thanks for suggesting this, and have a Happy New Year!

--Chris



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