From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 6088223772 for ; Mon, 29 Apr 2024 11:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714390127; cv=none; b=e/AYAw03Ximn500IsPyTEZlE7pSkoKLNaem4PY5o6l6+Hbna4Bwm/HKWWSer26vE/TbXBVYWfP9gbKoDh+YLZegFJUkqxyc5MQTFQImZsdnmsD1HZaJrXof02n6t7g0ut9afEspyJxMcjtLhf306+Zhg00rytSJeBd1+g3Tm5wU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714390127; c=relaxed/simple; bh=9+iIDIGeBrqPHa7IENzBUl64vkmGoImZHllaGSOcTTI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=vFGLrUT0CEC1suEkcLDhCwk8gxBE6rwpONTZBxVG0fnSFwuryMYZ+olsJRM7Xx6euIzMqznEtKNpI4G0ZofiljPNIfikVVQoPT4DwvfcnhLZMTL/T/1HQsc0KjrCTTUumhrAs3w4XpYIsXIgK3mVNZJt3ITimoY9rj+frra2Ol0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=EH3sYA15; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="EH3sYA15" Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240429112842epoutp0345908c35d0820269ae000211b6055a12~KvLvGJ6pI0522605226epoutp035 for ; Mon, 29 Apr 2024 11:28:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240429112842epoutp0345908c35d0820269ae000211b6055a12~KvLvGJ6pI0522605226epoutp035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1714390122; bh=qql6H84yrAVcpCA1EqC2oiYtThMBtmV/sd5WrSawJ9I=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=EH3sYA15o0O8qZy0q/WHV48FiAx4OpUFFDtZ9TsHhaUJzASUo3CbUItJZe2tvt4tI GWBDFQdtR4n2M2mbpVAwbUS7U3hhwI30wO4sI9zd+815+D48VeuQjDZir9NYm8m7F5 6W63vQ/19DwKZ654lVFXVs6LmeEPsQb8A/mJHBYM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240429112842epcas5p1b13daeffb2c8379c9a7893e7d5363a7f~KvLuqDBoD0922009220epcas5p1R; Mon, 29 Apr 2024 11:28:42 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.175]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4VSh0m4gQLz4x9Py; Mon, 29 Apr 2024 11:28:40 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 2F.9C.19431.8648F266; Mon, 29 Apr 2024 20:28:40 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240429112840epcas5p3c1e0fa5d887cb99e34beaf752c6079d1~KvLso-4-o2717727177epcas5p37; Mon, 29 Apr 2024 11:28:40 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240429112840epsmtrp264f517a3660175e6a3f54f47a2b90028~KvLsoSqAA2874128741epsmtrp2H; Mon, 29 Apr 2024 11:28:40 +0000 (GMT) X-AuditID: b6c32a50-f57ff70000004be7-05-662f8468829a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 99.F7.19234.8648F266; Mon, 29 Apr 2024 20:28:40 +0900 (KST) Received: from [107.122.11.51] (unknown [107.122.11.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240429112838epsmtip281332baf2962d0db426883b1de052ce3~KvLq5utYd1326113261epsmtip2k; Mon, 29 Apr 2024 11:28:38 +0000 (GMT) Message-ID: <73cc82c3-fbf6-ea3e-94ec-3bdce55af541@samsung.com> Date: Mon, 29 Apr 2024 16:58:37 +0530 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH 02/10] block: copy bip_max_vcnt vecs instead of bip_vcnt during clone Content-Language: en-US To: Christoph Hellwig Cc: axboe@kernel.dk, martin.petersen@oracle.com, kbusch@kernel.org, brauner@kernel.org, asml.silence@gmail.com, dw@davidwei.uk, io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Anuj Gupta From: Kanchan Joshi In-Reply-To: <20240427070331.GB3873@lst.de> Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMJsWRmVeSWpSXmKPExsWy7bCmhm5Gi36awdstihZNE/4yW8xZtY3R YvXdfjaL14c/MVq8mrGWzeLmgZ1MFitXH2WyeN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pg98b/u09Mu2+h+GRbsRiJhqUbL780 6JOdfqvWTGifaEDdD8PvX6ZPNQr/7CH7QYJ7VoTzp+q6c2vffkhdrfGUge3pZ+Pw3xu3KrEU ZyQaajEXFScCACypC4otAwAA X-CMS-MailID: 20240429112840epcas5p3c1e0fa5d887cb99e34beaf752c6079d1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240425184653epcas5p28de1473090e0141ae74f8b0a6eb921a7 References: <20240425183943.6319-1-joshi.k@samsung.com> <20240425183943.6319-3-joshi.k@samsung.com> <20240427070331.GB3873@lst.de> On 4/27/2024 12:33 PM, Christoph Hellwig wrote: >> If bio_integrity_copy_user is used to process the meta buffer, bip_max_vcnt >> is one greater than bip_vcnt. In this case bip_max_vcnt vecs needs to be >> copied to cloned bip. > Can you explain this a bit more? The clone should only allocate what > is actually used, so this leaves be a bit confused. > Will expand the commit description. Usually the meta buffer is pinned and used directly (say N bio vecs). In case kernel has to make a copy (in bio_integrity_copy_user), it factors these N vecs in, and one extra for the bounce buffer. So for read IO, bip_max_vcnt is N+1, while bip_vcnt is N. The clone bio also needs to be aware of all N+1 vecs, so that we can copy the data from the bounce buffer to pinned user pages correctly during read-completion.