Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1185840pxk; Fri, 25 Sep 2020 08:18:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv9YytGd5CY9iNzk1yZFMEiR1fZELFNVX0TeK8VjzaVp9Q+CWrCtjIqmia6A1XEX9F/2TL X-Received: by 2002:aa7:dc0e:: with SMTP id b14mr1879837edu.17.1601047081300; Fri, 25 Sep 2020 08:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601047081; cv=none; d=google.com; s=arc-20160816; b=TGCTlPTBnoef5lOzHBTFlCcLYqMt0xo7sPrAjK24Z3OzjRz30VTrg6oyBKkK6qw6S/ QirHLfge9E3yW61ANrTAr8Dj9dimoY73BqrkMHAuWTcaKxPrrp7Nzj7Ntu5DNgbD3XXg pPV7cxsv+nPwPJllc4sL18t4waChwe7MrXRUU4ySVxO/4LNtNLJl85IrNGkYc1D6FDsT x97izoE80M0AL1mXwnEueogPbB1MPvQguuOeunRNDHubxfv0fZbC0YqvVAYXdbl2L88M u9Ry5AOBA6bY6Y0SmNY1RuGEpN1ObzTJHFmLQaJ1A607oG0fv17AmPMxpgGGfHRw28FO NQtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=1hOE/j9JSKbI1ii+yT3FvARyv+QjtoSiFukbSIvfD/Y=; b=uuk4pYNrrIIfyQ2jlvjzhRngzqeRr0W/TjErPlJopsyWGkFO0rs2zmi6Qzr3aPHos6 UIkbqp28TrZPJadevcLsuUzhPuMDvu4tbb3hcgW316aHm6g3Ll9DIWDT9AyFIMK0BEla us1fZtHUaZOJ+trvuzVN7kjrkCL7rksiTSVWOv3xNBcLEw2yIRYqYeOQP//5lgnYj1+Q wPXcY3CKbilft1FawnCf/nHkAtWU0nOeATES/xt1uiKCm0q/LR8kJg4vBTNpu8rkc6ax HbmSF6J3IbqlE9euG6qRsGP/7bn9OgGT6F5+hFqG50Y5Inf7qEq6nn6bY0YXUa/DXGkC IbYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PYP9Lvc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si2022820ejj.455.2020.09.25.08.17.37; Fri, 25 Sep 2020 08:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PYP9Lvc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729303AbgIYPN4 (ORCPT + 99 others); Fri, 25 Sep 2020 11:13:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728858AbgIYPNz (ORCPT ); Fri, 25 Sep 2020 11:13:55 -0400 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AACF0208B6; Fri, 25 Sep 2020 15:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601046835; bh=8haPYMN6i4R8L0rBRDB+RFTRiwwmhl0O2ZTgf2GjGgs=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PYP9Lvc+6VpK6zDfYTXAvOODiQyNe45LDl14372p88r2vjqI0Q0pVVj/uOIhNLXRe MOObG21yv2R16u9QGAyn4b7MMY1qecLWzvLxq+120CigHpgpMO4nijXRMB7Y0yoTFo Ras3xD5JtcMdTtzOri8qm/zU75p/qRv0mJJwUPAk= Message-ID: <955efe40d1df7ba78cd0e0f27ba13ae7650ea927.camel@kernel.org> Subject: Re: [PATCH v8 7/7] libceph: use sendpage_ok() in ceph_tcp_sendpage() From: Jeff Layton To: Coly Li , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ilya Dryomov Date: Fri, 25 Sep 2020 11:13:53 -0400 In-Reply-To: <20200925150119.112016-8-colyli@suse.de> References: <20200925150119.112016-1-colyli@suse.de> <20200925150119.112016-8-colyli@suse.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-09-25 at 23:01 +0800, Coly Li wrote: > In libceph, ceph_tcp_sendpage() does the following checks before handle > the page by network layer's zero copy sendpage method, > if (page_count(page) >= 1 && !PageSlab(page)) > > This check is exactly what sendpage_ok() does. This patch replace the > open coded checks by sendpage_ok() as a code cleanup. > > Signed-off-by: Coly Li > Cc: Ilya Dryomov > Cc: Jeff Layton > --- > net/ceph/messenger.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c > index bdfd66ba3843..d4d7a0e52491 100644 > --- a/net/ceph/messenger.c > +++ b/net/ceph/messenger.c > @@ -575,7 +575,7 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page, > * coalescing neighboring slab objects into a single frag which > * triggers one of hardened usercopy checks. > */ > - if (page_count(page) >= 1 && !PageSlab(page)) > + if (sendpage_ok(page)) > sendpage = sock->ops->sendpage; > else > sendpage = sock_no_sendpage; Looks like a reasonable change to make. Assuming that there is no objection to the new helper: Acked-by: Jeff Layton