Message ID | 20230329141354.516864-34-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AA30C6FD18 for <linux-mm@archiver.kernel.org>; Wed, 29 Mar 2023 14:15:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D88A6B00A4; Wed, 29 Mar 2023 10:15:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2881E6B00A5; Wed, 29 Mar 2023 10:15:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 150706B00A6; Wed, 29 Mar 2023 10:15:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 02DAA6B00A4 for <linux-mm@kvack.org>; Wed, 29 Mar 2023 10:15:41 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CC76C160D5A for <linux-mm@kvack.org>; Wed, 29 Mar 2023 14:15:40 +0000 (UTC) X-FDA: 80622134040.14.A7754DE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id C1AC0180022 for <linux-mm@kvack.org>; Wed, 29 Mar 2023 14:15:38 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=c78w6wnc; spf=pass (imf24.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680099338; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0V0VYuNRGUsctVySLnEH8GinGQ4l5nQcc0Sx6Q5aq0A=; b=ftOTAnXzy09RO7Q0SvVW9J8BRaD5hTWqdMQQNQCMc48eMtfq926DfZJRnzvPBUoVC3VZSi rNbkmjL04iSLxGP1QfjYVCx4j7hT1us/bDGhtPnd978n37EUQxFWX39ad1t3QsvyohyGzC 69eN98b5M95z2aW2WOzKH9Y+VTPMbLk= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=c78w6wnc; spf=pass (imf24.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680099338; a=rsa-sha256; cv=none; b=q+XlAQ5Dy15A5QVcXtqMRdHiYMK138w9DvHx2GvPZvtuNCQtGsG/9PcpsavRxHaV3RodkH /fh3wbVkuItLQSaOAU+PsZCWT1jDXPB4zuzr+M08LsavTNSvsvwmmsDS+tpOTsUzgjK9g4 KEiYXbs6sS4etWUE3eJUNs+bxnJUGxw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680099337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0V0VYuNRGUsctVySLnEH8GinGQ4l5nQcc0Sx6Q5aq0A=; b=c78w6wncXK2A7qKBNp/fqp/QLdog2d7a7+Y5riDnZFpKgCuQJ2A3HhS6otgSGW1eMfIgI1 uVeWcEMz3sZgfa5fdgtpVM1MHiGRO7STJ6WiN2FnnpiqYwwV0G2ocWgMLnXfKEPV8GrZBr oW+sF5ijcJT9WBVx6yfv7g/mFiq7EpM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-kCehxZq9PD6SIf6owZvSow-1; Wed, 29 Mar 2023 10:15:33 -0400 X-MC-Unique: kCehxZq9PD6SIf6owZvSow-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C7FF3185A790; Wed, 29 Mar 2023 14:15:29 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BD4C1121330; Wed, 29 Mar 2023 14:15:27 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Matthew Wilcox <willy@infradead.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: David Howells <dhowells@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@infradead.org>, Jens Axboe <axboe@kernel.dk>, Jeff Layton <jlayton@kernel.org>, Christian Brauner <brauner@kernel.org>, Chuck Lever III <chuck.lever@oracle.com>, Linus Torvalds <torvalds@linux-foundation.org>, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Martin K. Petersen" <martin.petersen@oracle.com>, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Subject: [RFC PATCH v2 33/48] iscsi: Assume "sendpage" is okay in iscsi_tcp_segment_map() Date: Wed, 29 Mar 2023 15:13:39 +0100 Message-Id: <20230329141354.516864-34-dhowells@redhat.com> In-Reply-To: <20230329141354.516864-1-dhowells@redhat.com> References: <20230329141354.516864-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: yrb83c1fqg1moeq4eosuiqhe1rhd6kji X-Rspamd-Queue-Id: C1AC0180022 X-HE-Tag: 1680099338-278962 X-HE-Meta: U2FsdGVkX1/5d1rYGF5aGCSjVPdq8In/9kL4VcBIgD1kd4Sh0CU1fmFHq93K0acAPd8HWncX1dAvmouWE5lpOp1w6/V6cCoP0ugH2neKnmHZ2e4/rsEYJFVrEGj65DHVByQO6inidrLYMQqMXsEnHe/GRhTz3wqEc9ivCVvmNdip1WljcI1HzHn4ndzYwqMWT2wpcl2IJUKEjXLWqKL53W5/JkJOe+2qQQJ7MJ2/P14WmWQ9x4GQySOJ+JEnBd5Xc/GjFHgCtcAb++ydqGw2sRH8/FqeLUg5FLaOZbj5V2gmgN1pEvXT2aSd4fCbs4F7HpV2XRHltcF5ItkmkXikbXo/4KqWvA8A549GAYAT3X367InY9IBznP3tNCm9sMffXomVtz6ZjlrR8aFHX6Mrl5r44z1vMRxz/WsFaNuLXxYUcoeesTa+93XwGkwEeMc/G+ii7e4jeiyBZ/13m5xF5exCH7X7itSqDfwgR4ydPDxlmdAefGC9lBVoOdkK9EETRQepHmXDJiKF55T27tnb4xhJC65y8wGrxfSkNupeHBDIzeQOpWfSCdwj5JCwC1viAa78lJrPIjYHzsJr/fwESn9AlssEMV/ySDQ6WDKCWpDyhYzTpRP7gL0Im/WZOVwRh0tk8x554AthmyWP5X2q40NPPCXnDrXgX2ZivPIBNFmAVGZMLUNb37LqO5sMooUbW0v9h9Djd8arN/S8w2YJXwmXHy93YN8ZDgXgHLWyO0Xwt7wI9mOryGdEKak2fs1ctENjVE20ZO8JkARzlVL4Gx0w4H2ejXOfhwwgco9DEH9NQcg330W0F927rWFjAV0u58We4F2/ezgQJ9EftuX1QuKLm0vr1IkuEhEoalUC1/rHw78upArSWW6T9g9LtRsA2PJu1rmbJVoSV6+6sTmRPMjbZNTYAWkRBJEHR+UQKGzNPH5Y50Gq43aMo9KKMIbB7j7m+bLRJYhWyZ8l1Xv FVTRJy6V uwLKDCIaWGp4m7fb6KzksTrxfQeyPfU5GS6dmx70x2zsJ/myfk3Wb5tqJFMDpibWxXBdYSqRh1mpaMhMuBS8sD5m4ZBmPtVPP0D4VpeC+ITW15Zt3VMHO16P+KrKBE10XR+9EXH197CkcLUwUrnQAWzwL/prZZpgM3wedrHQT2QewCxcKx6drVEOPbO89M0+tR1ai6XGDE3Rp2pyIcys9ubnXjgGCoTv8rmCpErVeC/WDkJXpmdPrwRA65+Q0IWnxCULxsr329R6SScRMGzWgWSOXe87uljCOOBhHGes4gIGyyP/WkUAiZRu4a885GcPsknMIfiZVqRtcZKS/EV+FQ9vGaw38EebMEzOw1/ll6meP8FLr4oI3nFGwq2OAdWaSJMUIQyLy6pexK0wDMlzwToXEm1U39WbT9dNMu8B2ANZvfyi4dd58WPaVaXbc7CAHmlhhO+MKLtAuyxeAL8OJGgN83A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES)
|
expand
|
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c index c182aa83f2c9..07ba0d864820 100644 --- a/drivers/scsi/libiscsi_tcp.c +++ b/drivers/scsi/libiscsi_tcp.c @@ -128,18 +128,11 @@ static void iscsi_tcp_segment_map(struct iscsi_segment *segment, int recv) * coalescing neighboring slab objects into a single frag which * triggers one of hardened usercopy checks. */ - if (!recv && sendpage_ok(sg_page(sg))) + if (!recv) return; - if (recv) { - segment->atomic_mapped = true; - segment->sg_mapped = kmap_atomic(sg_page(sg)); - } else { - segment->atomic_mapped = false; - /* the xmit path can sleep with the page mapped so use kmap */ - segment->sg_mapped = kmap(sg_page(sg)); - } - + segment->atomic_mapped = true; + segment->sg_mapped = kmap_atomic(sg_page(sg)); segment->data = segment->sg_mapped + sg->offset + segment->sg_offset; }
As iscsi is now using sendmsg() with MSG_SPLICE_PAGES rather than sendpage, assume that sendpage_ok() will return true in iscsi_tcp_segment_map() and leave it to TCP to copy the data if not. Signed-off-by: David Howells <dhowells@redhat.com> cc: "Martin K. Petersen" <martin.petersen@oracle.com> cc: "David S. Miller" <davem@davemloft.net> cc: Eric Dumazet <edumazet@google.com> cc: Jakub Kicinski <kuba@kernel.org> cc: Paolo Abeni <pabeni@redhat.com> cc: Jens Axboe <axboe@kernel.dk> cc: Matthew Wilcox <willy@infradead.org> cc: linux-scsi@vger.kernel.org cc: target-devel@vger.kernel.org cc: netdev@vger.kernel.org --- drivers/scsi/libiscsi_tcp.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)