Skip to content

Instantly share code, notes, and snippets.

@arakashic
arakashic / patch
Last active April 29, 2025 19:59
qzfs-fix
From d6f5b65362a5d2471c8b8fb7509fda85e43d20dd Mon Sep 17 00:00:00 2001
From: Yanfei Guo <[email protected]>
Date: Fri, 18 Apr 2025 19:48:19 +0000
Subject: [PATCH] qat: wait for in-flight req to complete before remove session
reqs in session may be still in-flight after callback returns.
This results in session remove fail with message "There are %lu
requests pending". Adding a small loop to wait for the completion
of in-flight requests.
---
@arakashic
arakashic / on-setting-qat-for-zfs.md
Last active May 6, 2025 14:18
On Setting Intel QuickAssist Accelerator for ZFS

I built a TrueNAS storage server with Intel QuickAssist accelerator for ZFS back in 2022. It worked well for me. Since I am upgrading it to TrueNAS 25.04, I had to redo a lot of the past work. So I decided to write down everything. This article is not meant to be a comprehensive guide.

Also, the QAT support in ZFS is mostly a research product. It does not get much maintenance as you can see in git history.

Introduction

The plan was building a TrueNAS storage server, but also using it host various containers and VMs for my services. Essentially, a all-in-one server (or all-in-BOOM if the server fails). Partly because my last NAS had hardware RAID card, and with limited hardware resource in the new server, I was looking at way to offload some ZFS work from the CPU. I did not find any ZFS specific accelerator that I can get cheaply on eBay utill I came across the QZFS paper in USENIX ATC'2019 (https://www.usenix.org/conference/atc19/presentation/hu-xiaokang). It demonstated a way to use the Intel QuickAssis

@arakashic
arakashic / timelib.h
Last active May 26, 2024 22:41
Quick Snip for Time Measurement
#include <time.h>
double TL_gettime();
int TL_checktick();
double TL_gettime()
{
struct timespec t;
clock_gettime(CLOCK_REALTIME, &t);
return ( (double) t.tv_sec + (double) t.tv_nsec * 1.e-9 );