From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8CEDC433FE for ; Tue, 1 Feb 2022 19:26:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242352AbiBAT0V (ORCPT ); Tue, 1 Feb 2022 14:26:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36263 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242307AbiBAT0T (ORCPT ); Tue, 1 Feb 2022 14:26:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643743578; 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=V6LHo6un10Hww5UkITIYZqx0hJ95mxjwPuv4ZEQNJOo=; b=QhKV1hxFV4DrLCMpruu0+ZiccX445AEbzWn+MHs66zuJfOY679hgGer5AybNlfY125+iZu btPS7vmOnsNziR1ps24VwRu/loc9wvcuaPHOVLzFySZYqiZ9yJrlG0Py9Wc0xVwycTpTBb 42VG01jzErjaIN/b+5XwyOJrvAvFovE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-M3lC_SoeOUSu4g4fX1B8yw-1; Tue, 01 Feb 2022 14:26:13 -0500 X-MC-Unique: M3lC_SoeOUSu4g4fX1B8yw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06EAD1091DA0; Tue, 1 Feb 2022 19:26:12 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73DEA5D6BA; Tue, 1 Feb 2022 19:25:59 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 211JPwaE023932; Tue, 1 Feb 2022 14:25:58 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 211JPwim023928; Tue, 1 Feb 2022 14:25:58 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 1 Feb 2022 14:25:58 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Bart Van Assche cc: Chaitanya Kulkarni , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "dm-devel@redhat.com" , "linux-nvme@lists.infradead.org" , linux-fsdevel Subject: Re: [RFC PATCH 2/3] nvme: add copy offload support In-Reply-To: <1380d0e4-032d-133b-4ebb-f10d85e39800@acm.org> Message-ID: References: <20220201102122.4okwj2gipjbvuyux@mpHalley-2> <1380d0e4-032d-133b-4ebb-f10d85e39800@acm.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Tue, 1 Feb 2022, Bart Van Assche wrote: > On 2/1/22 10:33, Mikulas Patocka wrote: > > +static inline blk_status_t nvme_setup_read_token(struct nvme_ns *ns, struct > > request *req) > > +{ > > + struct bio *bio = req->bio; > > + struct nvme_copy_token *token = > > page_to_virt(bio->bi_io_vec[0].bv_page) + bio->bi_io_vec[0].bv_offset; > > Hmm ... shouldn't this function use bvec_kmap_local() instead of > page_to_virt()? > > Thanks, > > Bart. .bv_page is allocated only in blkdev_issue_copy with alloc_page. So, page_to_virt works. But you are right that bvec_kmap_local may be nicer. Mikulas From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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.lore.kernel.org (Postfix) with ESMTPS id C9015C433EF for ; Tue, 1 Feb 2022 19:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643743579; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VQpTMemC7sAbBu7TWCx21JTyUulX1qw74xNnFC+OOSs=; b=FnSniwpS/8gJLq/iMRKoTpDYSLo8wCkbQ89VUW2AM9KrTMpJcRNk8lAZ6t82m+XoWNGBwI RS4dmJ3yTRzIT5/96f7ghd7PGUYP/+8bacZsqxGJtIdZBRMtEywAznCVwmptF2C+Vd3t7s M8MEJcPtihe9CCrHvSIfr7td7x/Vh4I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-cfEwrkOsNRaAvDPfOZ7ksg-1; Tue, 01 Feb 2022 14:26:18 -0500 X-MC-Unique: cfEwrkOsNRaAvDPfOZ7ksg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 086BF1091DA3; Tue, 1 Feb 2022 19:26:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF76C1002388; Tue, 1 Feb 2022 19:26:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4774D1809CB9; Tue, 1 Feb 2022 19:26:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 211JQCF5007992 for ; Tue, 1 Feb 2022 14:26:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 03D735F4F4; Tue, 1 Feb 2022 19:26:12 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73DEA5D6BA; Tue, 1 Feb 2022 19:25:59 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 211JPwaE023932; Tue, 1 Feb 2022 14:25:58 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 211JPwim023928; Tue, 1 Feb 2022 14:25:58 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 1 Feb 2022 14:25:58 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Bart Van Assche In-Reply-To: <1380d0e4-032d-133b-4ebb-f10d85e39800@acm.org> Message-ID: References: <20220201102122.4okwj2gipjbvuyux@mpHalley-2> <1380d0e4-032d-133b-4ebb-f10d85e39800@acm.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com Cc: Chaitanya Kulkarni , "linux-scsi@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-block@vger.kernel.org" , "dm-devel@redhat.com" , linux-fsdevel Subject: Re: [dm-devel] [RFC PATCH 2/3] nvme: add copy offload support X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, 1 Feb 2022, Bart Van Assche wrote: > On 2/1/22 10:33, Mikulas Patocka wrote: > > +static inline blk_status_t nvme_setup_read_token(struct nvme_ns *ns, struct > > request *req) > > +{ > > + struct bio *bio = req->bio; > > + struct nvme_copy_token *token = > > page_to_virt(bio->bi_io_vec[0].bv_page) + bio->bi_io_vec[0].bv_offset; > > Hmm ... shouldn't this function use bvec_kmap_local() instead of > page_to_virt()? > > Thanks, > > Bart. .bv_page is allocated only in blkdev_issue_copy with alloc_page. So, page_to_virt works. But you are right that bvec_kmap_local may be nicer. Mikulas -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel