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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25C2EEB64D7 for ; Mon, 26 Jun 2023 15:30:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3B768D0002; Mon, 26 Jun 2023 11:30:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9CE18D0001; Mon, 26 Jun 2023 11:30:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 916648D0002; Mon, 26 Jun 2023 11:30:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7AFD88D0001 for ; Mon, 26 Jun 2023 11:30:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0CF761A0466 for ; Mon, 26 Jun 2023 15:30:48 +0000 (UTC) X-FDA: 80945286618.08.E9900AD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 4A8CE140018 for ; Mon, 26 Jun 2023 15:30:46 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="G/KdVT5T"; spf=pass (imf26.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1687793446; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7uLYHxA1BeyjC2zeH9Gn+m3MAcFP9PjLf/sWdMqlqe8=; b=uD97GHmllBi3WH9tnMJz5ClZY36wPYwkGtLuOXdtTnCWLT6qkgJE3rKhZP1hU8yip0227i KYoQFu9dtjIzl/F/IwIuOrmEiYedxAoy1NWu/RPYZp+dyEG4exxbzGUuGjhzI4ZyT2Lh4W MxqW4opelJR88jREJtvVEO3YwD6NBKc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687793446; a=rsa-sha256; cv=none; b=15FiWc1z5gx0U7vPh1VtABT20d14lcJrQNdHBfvN4mrzpqIDqLOdPe9lMiOmtQ0H9TYDV3 9fCK72iCXcQWjEUks372oGKlXqc6ZhWqB+H0PXZ3czXg/Z2m0nDmNQyO4x/BYjjc90eehV +f+l/cR0yfwHp+oCR8iNfSWACoyz4Qg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="G/KdVT5T"; spf=pass (imf26.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687793445; 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=7uLYHxA1BeyjC2zeH9Gn+m3MAcFP9PjLf/sWdMqlqe8=; b=G/KdVT5TrhL0qE5EC95tWng5eO4Z9t9XunkwGBuBbZbfqzawxoI+wI5AeV9DTviB5Fgegs v7oT1oQpyMjGvEAjBrJwYY9U1osA9BfKvPYAUcn9ZXUhn6RDHz9LjrnQ1sg0NIhklXyBJJ Cfs1zfTIpz3gT+pxsbcKM8ccqIYz+oo= 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-250-PqDpqqq7PE2LP5FGnG2VSA-1; Mon, 26 Jun 2023 11:30:42 -0400 X-MC-Unique: PqDpqqq7PE2LP5FGnG2VSA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 228B51044597; Mon, 26 Jun 2023 15:30:25 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 222FE492B01; Mon, 26 Jun 2023 15:30:23 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230623225513.2732256-1-dhowells@redhat.com> <20230623225513.2732256-5-dhowells@redhat.com> To: Ilya Dryomov Cc: dhowells@redhat.com, netdev@vger.kernel.org, Alexander Duyck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiubo Li , Jeff Layton , ceph-devel@vger.kernel.org Subject: Re: [PATCH net-next v5 04/16] ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3070988.1687793422.1@warthog.procyon.org.uk> Date: Mon, 26 Jun 2023 16:30:22 +0100 Message-ID: <3070989.1687793422@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspamd-Queue-Id: 4A8CE140018 X-Rspam-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q Y2bGrvtssUDxZvzt1QaPEe8zC9xqVMC3OmQljIkFVKreNIEFKnCDJspRd1In/AngOYHWLfXiUMLmqfTwIDS6s925/XtfSp/waMWBw5R5nzx1H8oLMc2apzPHa+QGZtSiJrgFo5wyQz12X49k7N1C6ePv9+mr2KUcHTU7ur9Lu113zWgIN22OTYa2wpvjdfG6cBW9PXHO+zKNHL/VnslDAAguQZB711Y2/3D+VexZKa8mvqVL9OK8uUMuuE1lI4mi8ypuJh/eNfULEZnO8Lr1ctiaxczvWHmJFsqN6yuR1HNAQRHU= 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: Ilya Dryomov wrote: > write_partial_message_data() is net/ceph/messenger_v1.c specific, so it > doesn't apply here. I would suggest squashing the two net/ceph patches > into one since even the titles are the same. I would, but they're now applied to net-next, so we need to patch that. > > * Write as much as possible. The socket is expected to be corked, > > - * so we don't bother with MSG_MORE/MSG_SENDPAGE_NOTLAST here. > > + * so we don't bother with MSG_MORE here. > > * > > * Return: > > - * 1 - done, nothing (else) to write > > + * >0 - done, nothing (else) to write > > It would be nice to avoid making tweaks like this to the outer > interface as part of switching to a new internal API. Ok. I'll change that and wrap the sendmsg in a loop. Though, as I asked in an earlier reply, why is MSG_DONTWAIT used here? > > + if (WARN_ON(!iov_iter_is_bvec(&con->v2.out_iter))) > > + return -EINVAL; > > Previously, this WARN_ON + error applied only to the "try sendpage" > path. There is a ton of kvec usage in net/ceph/messenger_v2.c, so I'm > pretty sure that placing it here breaks everything. This should have been removed as MSG_SPLICE_PAGES now accepts KVEC and XARRAY iterators also. Btw, is it feasible to use con->v2.out_iter_sendpage to apply MSG_SPLICE_PAGES to the iterator to be transmitted as a whole? It seems to be set depending on iterator type. David