From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAD6634C815 for ; Fri, 20 Feb 2026 14:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771596860; cv=none; b=m2gkwrh5s8v2s6EQCbyb5AKbXUDrLoXl3ZJ6xnS5hNAhgfu0lZbdAFzm/yiC87k4IgrN5lKb9bRs3H/oC6ny8nqTlPzD/YyEl84CNl8p1qpA8ibZMjRdM4jtUmQ3KVP3DTyCHP7WxAT+HNJurYUgS5TUVCSQMmPLFa/SDp+eZvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771596860; c=relaxed/simple; bh=v80JkCPVzhXzhoeBRwlLhfn9tS3CbYzDQEhYPgC8/cA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KVDC84mCSb1qXsHHCCbBVyc6I7QW7fMFe4UGzOrQnLT+NLrMg/QxHoToYqk42rMSK5oFxgCLrRErFi9U2prCC+AkfhMmQUzzcyZtDyUm6MiCgdNl6MPixGdVECZj2eNevdgoBAgAsv21RY4SL8P5HIW76AO2Kq9V9H/GTp4Bv9I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=abvAdycp; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="abvAdycp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771596858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xlvVlAc4De5O6CGGQkhYnkfj//p44jm65jlYo4krZv8=; b=abvAdycpZkk8SgKHZt+6Z6INe4kTDen2DKercoo00EGY4EppxhK2P/Q7FVQ27AOIp0+gB8 sb9YJqMaWrt0aeXmPjHGPFEc1iWevcZRSWxLFF2GxhJM8Kobdf8qb4+B/iRlEj4p8Tbd02 OC1mW6UrpnY2Td9SiyBGeJ7T3XXm2/w= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-694-hcCoDzB9MnCY64QMM7u8uQ-1; Fri, 20 Feb 2026 09:14:15 -0500 X-MC-Unique: hcCoDzB9MnCY64QMM7u8uQ-1 X-Mimecast-MFC-AGG-ID: hcCoDzB9MnCY64QMM7u8uQ_1771596854 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 896B4195609E; Fri, 20 Feb 2026 14:14:14 +0000 (UTC) Received: from fedora (unknown [10.72.116.11]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DB61195419E; Fri, 20 Feb 2026 14:14:04 +0000 (UTC) Date: Fri, 20 Feb 2026 22:13:53 +0800 From: Ming Lei To: Xiao Ni Cc: lsf-pc@lists.linux-foundation.org, linux-block , bpf@vger.kernel.org, Caleb Sander Mateos Subject: Re: [LSF/MM/BPF TOPIC] User space RAID5 with ublk and io_uring BPF Message-ID: References: Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Hi Xiao, On Thu, Feb 19, 2026 at 01:38:46PM +0800, Xiao Ni wrote: > Hi all > > I'm doing some work on user-space RAID recently. I'd like to propose a > topic for LSF/MM 2026 regarding the implementation of RAID5 in user > space using ublk and io_uring bpf[1], particularly focusing on the > challenges encountered and potential kernel improvements needed. > > Ublk raid5 uses the ublk framework (tools/testing/selftests/ublk/), > with the goal of leveraging io_uring's zero-copy capabilities and > BPF[1] for performance optimization. The implementation includes: > * RAID5 stripe handling with configurable chunk sizes > * Multi-queue support via io_uring > * Degraded mode for single disk failure tolerance > * Integration with io_uring BPF struct_ops framework > > During the implementation, I encountered several technical challenges. > The primary challenge is performing XOR parity calculations in a true > zero-copy manner: > > 1. Bpf program support > Raid5 needs to calculate parity with data. Now io_uring already > supports zero copy. For targets such as raid0/raid1, it's enough. But > for targets such as raid5, it still needs to copy data to userspace > and calculate the parity. Bpf program is a nice solution[1] to resolve > this issue. Besides the patch set[1], it still needs another bpf kfunc > uring_bpf_xor() support. > > 2. Register buffer per io > Raid5 needs to calculate parity with data. So it still needs to > pre-alloc buffer and register it for each io. The total memory is > controlled by queue number and queue depth. With the pre-alloc memory > and bpf program support, target such as raid5 can support true > zero-copy manner. > > Question for discussion: > * Should the kernel provide XOR operation kfuncs for io_uring BPF? > * What would be the appropriate API design? > * Are there security or verification concerns with BPF performing XOR > on registered buffers? > > Current Status: > * Basic RAID5 functionality: implemented > * BPF struct_ops framework: successfully integrated > * Performance testing: in progress > * Main blocker: zero-copy XOR implementation waiting for kernel > support I've written a patch for testing based on [1] > > Why this matters > User-space block devices (ublk) offer several advantages: > * Faster development and iteration > * Easier debugging > * Ability to leverage user-space libraries > * No kernel panic risks during development > * Easy to evaluate/compare performance between kernel raid and ublk > based userspace raid. > > Desired Outcome > * If proposal in [1] would be acceptable > * Get feedback on whether `uring_bpf_xor()` kfunc would be acceptable > * Discuss API design for BPF-based computation on io_uring buffers > * Understand the roadmap for io_uring + BPF capabilities > * Learn best practices from the community for similar implementations I am interested in this topic, and looks Caleb Sander Mateos has similar requirement too. Thanks, Ming