From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 BD578374A0E for ; Thu, 30 Jul 2026 15:18:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785424701; cv=none; b=bYGtqYXiYMMDDc2OiE7P04jPKJjDZHuNqbwHe0/us6VCjLz/XwtXOfj3XMcHy/F0MaVgne5VXydvccd7OfY6zkBkM72pWiIPr6l+9gITWyu1gmbgAhXI9SznTXeb0qdmC/Y+nzvRXtZC/NDukkTL2nw+yueZtwHVIGKoi9vOKXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785424701; c=relaxed/simple; bh=WQYZ0jRX0zeO9RPdXp27mMy+Z/RV671WJFI/dIseCnA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kFZ9u5R7Ksm8zTGGspX8V3DdWE5Hz0DRTjdvXK9jU68tpjySp4SZHS5FWiAnJXH5NTDPQ3yIsT0rvx10j/PuH+aIiHDroEi/g6atPEeKwIlnkQmSgqjyQKJ+WiLMTNmTV/j+yNcqkjuZZsoYD6tmg3+p+5Ftvy3JXyN/AUI/6bA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=n6cg7XPV; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n6cg7XPV" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-4798bea72f9so1544010f8f.1 for ; Thu, 30 Jul 2026 08:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785424698; x=1786029498; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=4xubJdGIMIyB1Za5QMsHLEPZoFTDPQnDT99ep9CTLO8=; b=n6cg7XPVSYMPyOZ378g9t48IrQ0jbRzEibtnpjS7bSAnXmv/SjwIhf7gFO06OUaqKN IRu4vCckUMogD0n+W6cGvmFXWPgsF6d2qj9JdVTB6zRZCqsugL3lmxTd03GpJttz7l6k i6ypfuMX+/eJMw0x/+/OyVH9w4h1DXfSri8YjI8HOCTQiy6OA3pHg3Z7Ms/sLUT74w6K 97Nh7yKJNEUgkAmgg574thoAZemJW6wZnPxW0CHAQBhlvmr4svPrvpNF2AS85C7cn6jI j6jiiacvAHja9D59q6U8YjLuiVvHjm6x10Ge9r/RHozI5nQPCrRApP4TJChh1WgIlpc3 0LrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785424698; x=1786029498; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4xubJdGIMIyB1Za5QMsHLEPZoFTDPQnDT99ep9CTLO8=; b=Xj54q5vmsxw1/LQBhU83csU6sCkxsX383ckNsaI4HknHZvocEp9BoVDUM7EjFCkzkO UQ1sDbM7K5sfno9g5JZIFdsjWwqUYm8wpnNjWzMuk+dzkJOnmXz48B/gPVT3vnguYOkn 9vHJE3T0HxP78SoIJZXL8h8fMq0QcUWcwkPLTd9k4vlJGtIISgJywTuDjUDZ5EwqaJfG PEs1TAqFrSnaJmUp69O4AyTqLi0voAOvkk5/1vTn7ESGRyWrbmnt+/iqf9ZO9Bfum1us geVvkrscRgtA+w1rE/606Qq3v8+Zx+nZOGevaMH0s6m7l0YsrL4KJB/lK4z5jOIup8p0 g/wA== X-Forwarded-Encrypted: i=1; AHgh+RooRO0VmQE5EKNAujyNS6qPYOapWhe5rR/B8qLewB0LS9LHEofbuB5pkPMzeReXXXXbTfkC77g/pisserI=@vger.kernel.org X-Gm-Message-State: AOJu0YzArGmeaQoIsKbnN5egXfiuKy/EX3N1y/GBB0uhGzPblT30l75N MFVG7qdbX4ka1eiBq/K5nIVEN2mFsbRmyRQihZ1WMseGpSpYeakmxl6h X-Gm-Gg: AR+sD12iHAzEWfSz3tHNg48wjMH+llwqFNUwWnc/ZAqA7rgaKFT84TGE1kT3WGR6iWe k8N1ZQij7hRh37A4len6fKTr2gM13pWkOF5cNeGCdMt6w/uTWFfDx9L1+e1+HJYcuwyZIY1vlNa nLmQAymCcUhDRHpBA11im9y2vSiaDr/oYjAu2ES7Qiy/LcdDhZdwEdHr4m+eznL0agpqvZncR/C XLe0Ezfyh48Tr+YnPMr/ur71LVvx/bGr2hjLlVv5U+nG1T1hZOFlnrki7Bk0+8fQ0XC0vqvkKTm m3q+sQl5I1d6ScgG5Aut1+vdzQTeAGvVsWfNXY6O1NYz61mlOduCbWtmV13NNgojsIHhnEwb4oT roCeok3XWY0nL9qNCe2s8vXaLL7BlmxGutpUhd69q8qaLtBVWcf/B+XA0++SlZ15YAqb5YpgMdf HZPEFIdlzzw8jjitUtmEmTjvjhBILtT4kJorgd6uis/caiRTllqNkJnyvmtmemDiLyrHdpEa2bE YTHLKvERBh4xyNIrQyKchS16hFbDvWjemSmepejjGgl9H7sLOxNDw== X-Received: by 2002:a05:6000:2909:b0:47e:f3d:2b3 with SMTP id ffacd0b85a97d-47fc82028b9mr4314366f8f.39.1785424697916; Thu, 30 Jul 2026 08:18:17 -0700 (PDT) Received: from fedora-laptop ([172.245.82.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc892cc3asm7766881f8f.23.2026.07.30.08.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 08:18:17 -0700 (PDT) Date: Thu, 30 Jul 2026 10:17:43 -0500 From: Ming Lei To: Caleb Sander Mateos Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] ublk: lift need_map check out of ublk_{,un}map_io() Message-ID: References: <20260729012951.3744582-1-csander@purestorage.com> <20260729012951.3744582-7-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20260729012951.3744582-7-csander@purestorage.com> On Tue, Jul 28, 2026 at 07:29:51PM -0600, Caleb Sander Mateos wrote: > ublk_map_io() and ublk_unmap_io() are no-ops for ublk devices that > enable user copy or zero copy. However, the implementation is a bit > convoluted, returning the full request data length and relying on the > caller to check the return value against the request length. > UBLK_F_SHMEM_ZC recently added branches to skip the ublk_{,un}map_io() > call for I/Os using a shared-memory buffer. This is a more logical place > for the need_map check, so move it there from ublk_{,un}map_io(). > > Checking need_map early also avoids the expensive pointer-chasing for > the ublk_iod_is_shmem_zc() check in __ublk_complete_rq() in the common > case of a ublk device using user copy or zero copy. > > Signed-off-by: Caleb Sander Mateos Reviewed-by: Ming Lei Thanks, Ming