From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF32B70813 for ; Thu, 13 Mar 2025 14:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741874481; cv=none; b=L64p+nJXwk9+uuY2nLvKn1s90hpT/7g2MDElwK8IWO0DMliYr7zvDY6Kkx/5zRxoW4DO/mmw3ON+x9RW6ywhN7gEWNi1WrGDKZIBiAGiUyqssnZ1XFcmH9WU80pbqKGTxaYxEZxqV+0ju/esKm6IPEDp5xNhr1yx0zDDC6bU8xA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741874481; c=relaxed/simple; bh=oKH7Elamr+t/LNBhDFaCjq8k3Yhh1qOu2+6iErHVUsk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=L0vswnjP31vmdnEbYRYuwwE4O0DGNZNIZHm1UmXs1BXLhgDLRtynKz3h0T513xknyYBT89RotO/dQ1x9sIfbb6HkOMW1PlUZhB9X9y+X6YUkFWfLGB4D/DGtMPqjbXBOuPs477HrLLRi7y+zgL1cha+10qmk49QK7W0XOtgqazU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=p+TXWiZM; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="p+TXWiZM" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3d0465a8d34so9013125ab.0 for ; Thu, 13 Mar 2025 07:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1741874477; x=1742479277; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qDdThx9JUgAoiyQ7U+14OO8Q3xFSMds/LhAjusQXTgE=; b=p+TXWiZMTo1ccrCIfpXiRSLOKVeuqEjQzc2yy5y3GKljD2dbKVZHiLRVJE94abI9XX rjMnCmu6TXd1LRA+2jlnyDzkLvj8vric9AL9a9RhVMHE5lL9i6T3ZJt/HupHFdz6P2qE MyOFszdLRy2wilPtY7rBgJjGdvZv13VOQK45YML8Tcqu8H1ByIttR3mSY5lF0HQRbXoc Qscc5STMQP7Yz7E+VJKc7XGOXa8zOJva29dBjIrWD8KKMAO/z5u7GU39uSw06vSFhKc7 yOXZuq+yh2ICuptKYK0CnRKtWAHqz/WqZZ4Uei+qEDHGlZg6NnfxXaT25qTK+07ACvyw YN7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741874477; x=1742479277; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qDdThx9JUgAoiyQ7U+14OO8Q3xFSMds/LhAjusQXTgE=; b=uqySu2SO11oIUJVDRO81OZIEVZoDXBiUhHqTUXu6w6POvai2iP/Z5r8s72ovij8F+T ltggdkWuyRrr3qRYo/tLY/yOntdb5JyWx9Gu2+XdDTxwKWTZUvi87NiNAvLU8F7Or6uF 90vfVBEEPeSB38M8ckMlDqzCHJPMsmpH2+KIv+61/BEV3RfkFbbqUVXmXvXXul1d8P7l VuoXU/vI6SF2teXEdK4tCG964gmcU/6FNPvdqXbhfVSprp/8+/LUdcszd4K9iBhVEsYM +NTukB3HyFe4qsjJiX89LOhU1/EiX1XP8mjf6bZ7c+hLqdhdUHhvsmKs4PB0JaHlDz6Q /6Og== X-Forwarded-Encrypted: i=1; AJvYcCVtOFLmuwauuUm45DtCrMHDuyxwXwIUA6bm0atketSIZTsoHzR+mB28bRuJ1iLJGH1Mfo2MmEQwoJldUPY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7yyI8QdDjn9Yr/3qs0B2Mys74nT5/FDwZPWark4i1wXjEPBXu T3hzBB9PdVwzd+c0RytNS/Goc8m+0OpsWtODmgjGj2sXSz2ZArhjOPGRHZUktb0= X-Gm-Gg: ASbGncvYg7lyBNqZ5Fj2Vq3HxfRA6wdCD1PcJUSfkarADwdYYd/h0kg113V/3OuVulO khx7m05d9P9MB8FySY8hNkL362yycVc3mX1xhrpqo9sIh1vOwAtqGm+rgIKxEXtErDbI0RABLBt zkZav6rHW+3n0LsaE32+EM77JFGijkPkDEYLWeCuLeliZyrKe2/3ikfc3y5V0MkTwpO5bLB0nnC jzDUBvzDIrLQxOsfI5lI8wSY17UcIfqABsF+rvOVcik2Bvhhht1IVtJigMfVjS+/7rjRGAGnRB5 knUEfi4rKrvJOKGi57AhLj4KVKmGnimbtBpTE7Ym X-Google-Smtp-Source: AGHT+IH8vt8kGcYmo8u1W+6aiVlKe9rMFhsAav1CA7QhsLQdsuy10Ep5nNiDNFdUkL+dAak9/7QM2A== X-Received: by 2002:a05:6e02:1a24:b0:3d2:b72d:a507 with SMTP id e9e14a558f8ab-3d46899ef10mr119104955ab.19.1741874476689; Thu, 13 Mar 2025 07:01:16 -0700 (PDT) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3d47a67f5d5sm4164385ab.41.2025.03.13.07.01.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Mar 2025 07:01:15 -0700 (PDT) Message-ID: Date: Thu, 13 Mar 2025 08:01:15 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 0/2] introduce io_uring_cmd_import_fixed_vec To: Sidong Yang , Pavel Begunkov Cc: Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org References: <20250312142326.11660-1-sidong.yang@furiosa.ai> <7a4217ce-1251-452c-8570-fb36e811b234@gmail.com> <95529e8f-ac4d-4530-94fa-488372489100@gmail.com> From: Jens Axboe Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/13/25 7:56 AM, Sidong Yang wrote: > On Thu, Mar 13, 2025 at 01:17:44PM +0000, Pavel Begunkov wrote: >> On 3/13/25 13:15, Pavel Begunkov wrote: >>> On 3/13/25 10:44, Sidong Yang wrote: >>>> On Thu, Mar 13, 2025 at 08:57:45AM +0000, Pavel Begunkov wrote: >>>>> On 3/12/25 14:23, Sidong Yang wrote: >>>>>> This patche series introduce io_uring_cmd_import_vec. With this function, >>>>>> Multiple fixed buffer could be used in uring cmd. It's vectored version >>>>>> for io_uring_cmd_import_fixed(). Also this patch series includes a usage >>>>>> for new api for encoded read in btrfs by using uring cmd. >>>>> >>>>> Pretty much same thing, we're still left with 2 allocations in the >>>>> hot path. What I think we can do here is to add caching on the >>>>> io_uring side as we do with rw / net, but that would be invisible >>>>> for cmd drivers. And that cache can be reused for normal iovec imports. >>>>> >>>>> https://github.com/isilence/linux.git regvec-import-cmd >>>>> (link for convenience) >>>>> https://github.com/isilence/linux/tree/regvec-import-cmd >>>>> >>>>> Not really target tested, no btrfs, not any other user, just an idea. >>>>> There are 4 patches, but the top 3 are of interest. >>>> >>>> Thanks, I justed checked the commits now. I think cache is good to resolve >>>> this without allocation if cache hit. Let me reimpl this idea and test it >>>> for btrfs. >>> >>> Sure, you can just base on top of that branch, hashes might be >>> different but it's identical to the base it should be on. Your >>> v2 didn't have some more recent merged patches. >> >> Jens' for-6.15/io_uring-reg-vec specifically, but for-next likely >> has it merged. > > Yes, there is commits about io_uring-reg-vec in Jens' for-next. I'll > make v3 based on the branch. Basing patches on that is fine, just never base branches on it. My for-next branch is just a merge point for _everything_ that's queued for the next release, io_uring and block related. The right branch to base on for this case would be for-6.15/io_uring-reg-vec, which is also in my for-next branch. This is more of a FYI than anything, as you're not doing a pull request. Using for-next for patches is fine. -- Jens Axboe