From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.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 A5CC6256C8D for ; Fri, 30 Jan 2026 15:12:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769785959; cv=none; b=oKAnE1rhWUUl9cF6WgmXS2A4KW8CofdXk0Rl0+SrDE6UBW5wBgmwloUehUU3L5AYOzJ6ZLDKCJxK5Bl4FhTTtApig6F4t+MccfxUbgc4tuypBlyyvl5++whbdLxZQc5uLXwpp8fKfIXM7h+6TyuwoVt0edOUDYTk9cTJ8EHaUAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769785959; c=relaxed/simple; bh=sVRIbLRLm2gdKVdmxMHiNrrjFKokCmeAu5KAGlszTcs=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=Pd8D372rcYwU6w0NwE5JW91Ep2tJNKvjEqGZdZOOttFu2boJVW2nKeNOGc5Oy5sCbXZHeFv3PVIITwGmGv3KAW8BINx8fLnUZMiDlAY18szUPmi+pEmn9OYPD/Ku+5Po5DIyv5p/RfCgJdgnBNLtCbg7TmeFcyyJc/p8RjbBSmM= 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=oLvTotHD; arc=none smtp.client-ip=209.85.210.46 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="oLvTotHD" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-7d18a9d2b1aso2206410a34.2 for ; Fri, 30 Jan 2026 07:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1769785955; x=1770390755; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:date:message-id:subject :references:in-reply-to:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eXoX3vnzmebVZOm3CUt6qKUyHourmARTnybZ8qjemAw=; b=oLvTotHDCmWHHD+8BwaE/4BBoo+gbBp1FG7fMzma5mKRuMNo+nX38zcV98tH5z+j22 ZBA4GcEkRY5F3jVCIG3Ebv+EXKU5dlzdz8q8Iaf4e0vU/IZ7hTMGoxaSEQSqkFtU4f8x 8htGt8jvvSckQF4bF8P3TpBiDFEEV0QBG/VgkJpslNjf374hnk6UQy/+yj4BK9a6oV5J VQyQuqGTZAaylM/lmHnR1sgPk7zbL3bzfACAA5+AZh7qYFLa/Djak0YhkSZ311tI1Srk B+EQe+SModhYGFT1nFGDli6xUTeB94kAITeGgmKdZT4L7wkUAo3RYokjUU6c7Fg4Z2Kt qr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769785955; x=1770390755; h=content-transfer-encoding:mime-version:date:message-id:subject :references:in-reply-to:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eXoX3vnzmebVZOm3CUt6qKUyHourmARTnybZ8qjemAw=; b=jjxHH1IxQyS0AjQVzMXY312Hm++XKiR68UV+xaF4Bn6I+hh9HJAIK1nwJsieb8YHsg KVYYBykOaK1XJxsQfC9C1lRauRd/XJ4+M71+e6XY6Th7hk3Al+XdwOWyzYCTlicPjNum KRCGdipYKPIFna+G9kPNAgTe8EbnUMcHB3mEkVKCecz6N5TIllztJ/VKlG5gwCGzO5YS rEX/Ooqvb32DogCVY1dYuUVzclPu6bmI73c2TgbTuigM9Fb3YSTDs5GTSbhT3SPWzX7Y xiXCL/4QrIhELXRp+Nnsu488flKoU7v/UJglDYUgKnzFoUMWR48PxwZKDAgh+mDwFIRB FpIQ== X-Forwarded-Encrypted: i=1; AJvYcCUTD9tOGl+5mK28fY1Y09gAsoM531Htsm5/3MElCBtiQvaySwskiN1RZEctdXilmZjOk4rsgUVS4Cvwf2M=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1huzFFc35k5O5aUgJ+8jEeZv73SCVRzApaXf0vNmnjyhS898J w/sIhZkALOk+L0PDfnM4JWw0GI3KAllb/O291C8mUWkL9lCCkduR8csWklnRbkhoqlmomVxXJv7 jZjm1VjY= X-Gm-Gg: AZuq6aJAiu3NjQaB+TPRo7Vqw4RXbJawQRgsPCqH2/C68X60SiBtGFuVryJjjVbjmz0 WXolaD2u3+YbC0xE/KU8RAIrBlD8uQMONI1X3zhxBCQvGjaMVkidSzWpCLK8kNVPATXokFHF7Ek e6erWBq/NdEIjHFzZtVaDjspCJddIJTPmDHZcia+ps7r3DmRKR10tcnyLBaQC2RF/Nr3B+DmHMM J5Lt1qJSBS95Nb3MuT5dkXG6eBEawTtCGNoLQU5KmdqQ2MD8K9c8EbKYzqArWsRcZSmr2fIfjN6 EcxqftCnJpfCSl0CF2jcMXPWnOOo0muky9xnb2euVk9bf9m4jxMrCeK3RNDqQJToT/7v4NkDaa/ vDCcXwjEhqmPEPPLOqOHJmTnFjA0m8zlP/H7+OTcjGncxL+lXTHWY9kasaW/AovJlAMExqQo7Bn OolNr3p+1DJRYnPa85xJT5BcDZOM/hhcM083cpr6YtuuD4nlQfSS62dcDJmKfzwP7f7k7MFd4lo A== X-Received: by 2002:a05:6830:3498:b0:7c6:aea0:3382 with SMTP id 46e09a7af769-7d1a532b43fmr1876606a34.23.1769785955615; Fri, 30 Jan 2026 07:12:35 -0800 (PST) Received: from [127.0.0.1] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d18c69e632sm5685845a34.10.2026.01.30.07.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 07:12:34 -0800 (PST) From: Jens Axboe To: Ming Lei , Caleb Sander Mateos Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260128205636.4003327-1-csander@purestorage.com> References: <20260128205636.4003327-1-csander@purestorage.com> Subject: Re: [PATCH] ublk: restore auto buf unregister refcount optimization Message-Id: <176978595418.809940.7908857788281671989.b4-ty@kernel.dk> Date: Fri, 30 Jan 2026 08:12:34 -0700 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="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.14.3 On Wed, 28 Jan 2026 13:56:34 -0700, Caleb Sander Mateos wrote: > Commit 1ceeedb59749 ("ublk: optimize UBLK_IO_UNREGISTER_IO_BUF on daemon > task") optimized ublk request buffer unregistration to use a non-atomic > reference count decrement when performed on the ublk_io's daemon task. > The optimization applied to auto buffer unregistration, which happens as > part of handling UBLK_IO_COMMIT_AND_FETCH_REQ on the daemon task. > However, commit b749965edda8 ("ublk: remove ublk_commit_and_fetch()") > reordered the ublk_sub_req_ref() for the completed request before the > io_buffer_unregister_bvec() call. As a result, task_registered_buffers > is already 0 when io_buffer_unregister_bvec() calls ublk_io_release() > and the non-atomic refcount optimization doesn't apply. > Move the io_buffer_unregister_bvec() call back to before > ublk_need_complete_req() to restore the reference counting optimization. > > [...] Applied, thanks! [1/1] ublk: restore auto buf unregister refcount optimization commit: ad5f2e2908c9b79a86529281a48e94d644d43dc7 Best regards, -- Jens Axboe