Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16385529rwd; Mon, 26 Jun 2023 09:16:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UghvHoIiPOlTNksBahJCygZ4vgZyAGOx3gzv+h1HFXU7PY7Jq7rQCLr9Fee16Ga3lbxir X-Received: by 2002:a05:6402:1353:b0:51d:a679:7555 with SMTP id y19-20020a056402135300b0051da6797555mr151056edw.31.1687796197676; Mon, 26 Jun 2023 09:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687796197; cv=none; d=google.com; s=arc-20160816; b=nzIoYEIA28K4tJDQ2m1md/SsggqEcLho3VDqZLyQbozEr3thbiJagyJZLyPdwVQ1Vm +dqO/SIHNyf6KaCYR6npg+b6q8nDmSesMbGUhCR4W5Z1e6gePmZYjJqne3c1rAyEV6eK tGiUjsthi33fJI7Vru9k2Olb+0xcBv2pU1dpNlYFSVZFiVQWIdVR58aHo774IVj4aqAR KBsNyYvNpwbiXKezv3CvEG+6vhYDCvBn//lExon1ESRkqZld8YH3QFxO6LLKBdsaSTpa dsYcLZ8SBKsRjdfmSF3Ms8GbLXk4EwLTELpmbmO5/kU9brx29U+6tTsf6pbkukLbtBpw okVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+4iSzTg8EChOOzM4BxDcM+RvFk02kmVmbliMB8mfUCk=; fh=LjG57/xhNymJeHvCYkXV5dN1FMn8k3P6RGOhbmkzhhI=; b=e23GC0y71RlpQsPFxUAlpg7kga4rGoExEQ3oYciM5LvxW+NHIqzTa8aBZD3J0cbiEk vaiHy0IxafP61VKePg9HVSI9P1W5ul9x+Q3Uba1xve9QWtGgDYZqdLktgsnBr5ojIxHR h6DJPdjI1Xjqc52np/c0kb3LF+jc7S9nWw4xGfMLDLNjLJhc+olWwcnfijcIgV+Twh+G 4TJxJxcm/XCakse1ogUxjOkWjs03zWhtgxIUxr35gSkxSD+LqqEKqLublNvXFeSJ4VST kw7O3BmAOyf8w5jBSsWyAP6O/YVfT8ITc/QgTmy3S4CZdF2YxcietSGvR6ZoMF0tVFCU 1FYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RlnK3OZo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a056402150200b0051d98294f23si1552301edw.270.2023.06.26.09.16.10; Mon, 26 Jun 2023 09:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RlnK3OZo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbjFZQHh (ORCPT + 99 others); Mon, 26 Jun 2023 12:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjFZQHd (ORCPT ); Mon, 26 Jun 2023 12:07:33 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DD4FA; Mon, 26 Jun 2023 09:07:31 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b69e6d324aso21827371fa.0; Mon, 26 Jun 2023 09:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687795650; x=1690387650; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+4iSzTg8EChOOzM4BxDcM+RvFk02kmVmbliMB8mfUCk=; b=RlnK3OZoaEKxJnom2X8CXl92pbWx7OOPW4z0jpKaCHbGXroW0iQAsSISlIaV4C8G8x gK1MOooiRRWfenFnvdfXiSVEVcMWb8LVrk+kNPSJIiB4OthW+XopAMs0ohxXFBO6MZzx xSS+fZp9IO2IqrTy2iaKTdrItk2cvv2xVSz2QF7kcl2N3PQsgFWom2cZkSD7OlepUhRh QeyFDcM0MFp5+izZO5CpgbepvcNdsGpIMb9zj2O9x3o9Wz383Fh4CGG6pOxAOoVXe+26 Ud/6Sl6lcVCtQjx7rER0jxpx+HyFIEctGfvtCyVSt1QRfo4NaN7sZ6JzkmyeXZNdV+mw 6o5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687795650; x=1690387650; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+4iSzTg8EChOOzM4BxDcM+RvFk02kmVmbliMB8mfUCk=; b=hVK5CsuX4NcJqQAbmE4tmF6kCGlqHVmQ0kNLhh/q0Hzs4sOKfw4oMOLQysFsnuFUKp gtyFTSeIj6N4PRx1unjFeFJq+3jxpaGG80FAMyCRnFpCc2zU3nkKK/ofuRMdFDXekNJr rLY9AGLSWGuQb4Y6Tf52nhGNNE83WnnrsTqDtq4o6SYhza4Iw6cUzbFX5aa28Us7EABC 6N7hVLtXcqjAo36bXyLXInC8YENRm70a9dqGVN/JfUqMA/6imh7zVIO4crgj4PVfYlPB ZGdl141KeY5SHB9/aU6EHhSjNSNPlZl/o279NBu+DfvdxGpOm1lf6Kq9eV961a9A0+R+ e/Kw== X-Gm-Message-State: AC+VfDy9i2E//s7LCpdkIQayJ2h7LrWot5tIK1XzguiI3iufdCxXHAOI alAdhVnnanYHb6x7tzsbCikI2m3cXaF+IH3GJDY= X-Received: by 2002:a2e:a401:0:b0:2b6:a186:52ac with SMTP id p1-20020a2ea401000000b002b6a18652acmr1820365ljn.47.1687795649926; Mon, 26 Jun 2023 09:07:29 -0700 (PDT) MIME-Version: 1.0 References: <20230623225513.2732256-1-dhowells@redhat.com> <20230623225513.2732256-5-dhowells@redhat.com> <3070989.1687793422@warthog.procyon.org.uk> In-Reply-To: <3070989.1687793422@warthog.procyon.org.uk> From: Ilya Dryomov Date: Mon, 26 Jun 2023 18:07:18 +0200 Message-ID: Subject: Re: [PATCH net-next v5 04/16] ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() To: David Howells Cc: 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 26, 2023 at 5:30=E2=80=AFPM David Howells = wrote: > > 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. I don't see a problem with that given that the patches themselves have major issues (i.e. it's not just a commit message/title nit). > > > > * 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? See my reply there. > > > > + 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 XA= RRAY > 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 dependi= ng on > iterator type. I'm not sure I understand what you mean by "transmitted as a whole". con->v2.out_iter_sendpage is set only when zerocopy is desired. If the underlying data is not guaranteed to remain stable, zerocopy behavior is not safe. Thanks, Ilya