Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1026847pxk; Fri, 18 Sep 2020 01:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDI9GQRa/DutvBlgvY+3h3Wi4iKw1k5utikRpoVfj2xtXsVYaeC/BUAhWuFbZ8m0kCi7wX X-Received: by 2002:a50:fe0a:: with SMTP id f10mr24469295edt.133.1600418387377; Fri, 18 Sep 2020 01:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600418387; cv=none; d=google.com; s=arc-20160816; b=Ri1mBZIHhj5uZLXfZyd+rbWH0PL1r8ta3p8WZo2MzLha3eAW1CINxMdt8cwYnANja6 QrTztAt55YHZz0d8oOqVQR3JLGmUmHsy52MgMvpyaZMJ3Nk/Hj0+HaFLhwFj5IdjyBnm U1ipQDz+DI88dh+z1/Ck5jhDyvcoD0czH13EMA+iGchPFlr+TPJkEdFeQjOnbCzimOoQ LKwqCuZe8vOQAYjuuSy6W56XqGffhcLpS9uuBWDSGY9x3JrwKYagxsiOJht46cI3kHA4 pdWIMtd2DQFMcexZhVDeURQ1byuutCQevIweAbdMxEq3mxFg899pct1Xsmdt3fU9kVye 0sUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :autocrypt:from:references:cc:to; bh=bAguI4oO/TqPYJ8DssjwMbrDmDOaVWAeCfZ4XJnn+ok=; b=WmW8NMtJH5cP5PT5ZNhZdTt6dlHieB2/Q+9zPAZllYw4+NREoonKjhBJQ0ovveqLgf jyB7dwnT2LhOD51Nrn9sNlCSx0xaI21dnxb2mO3Jxsb+YR6fLUtP/7BVZ9AhXEoU1Ycf gCd9iSYRXSgzFgwLz8MdqamqY/RD8lJ4uqWlt51eB1cjBXzmJe9ATF25eq1UCNuao9C+ 3Q5OgVMSDkymkuwJttdNLnfOzsvhIufkPDsBx2KLNKew8wnm0wKhwpUrVP2Ie2fhNWn7 q9zLVkhqB+9bI08Zzrbmpgv3JIG6EHwsq5cOffGQjDsvEPG4olYJhvGXuS4nDJziUvg/ W4PA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si1689982eju.731.2020.09.18.01.39.23; Fri, 18 Sep 2020 01:39:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbgIRIhd (ORCPT + 99 others); Fri, 18 Sep 2020 04:37:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:48546 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbgIRIhc (ORCPT ); Fri, 18 Sep 2020 04:37:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3E190ADF7; Fri, 18 Sep 2020 08:38:04 +0000 (UTC) To: David Miller , hch@lst.de Cc: kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200819051945.1797088-1-hch@lst.de> <20200819.120709.1311664171016372891.davem@davemloft.net> <20200820043744.GA4349@lst.de> <20200821.141400.594703865403700191.davem@davemloft.net> From: Coly Li Autocrypt: addr=colyli@suse.de; keydata= mQINBFYX6S8BEAC9VSamb2aiMTQREFXK4K/W7nGnAinca7MRuFUD4JqWMJ9FakNRd/E0v30F qvZ2YWpidPj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2C3X7jTMQUytCz9 0MyV1QARAQABiQI8BBgBCAAmAhsMFiEE6j5FL/T5SGCN6PrQxzkHk2t9+PwFAlxHziAFCRj7 5/EACgkQxzkHk2t9+PxgfA//cH5R1DvpJPwraTAl24SUcG9EWe+NXyqveApe05nk15zEuxxd e4zFEjo+xYZilSveLqYHrm/amvQhsQ6JLU+8N60DZHVcXbw1Eb8CEjM5oXdbcJpXh1/1BEwl 4phsQMkxOTns51bGDhTQkv4lsZKvNByB9NiiMkT43EOx14rjkhHw3rnqoI7ogu8OO7XWfKcL CbchjJ8t3c2XK1MUe056yPpNAT2XPNF2EEBPG2Y2F4vLgEbPv1EtpGUS1+JvmK3APxjXUl5z 6xrxCQDWM5AAtGfM/IswVjbZYSJYyH4BQKrShzMb0rWUjkpXvvjsjt8rEXpZEYJgX9jvCoxt oqjCKiVLpwje9WkEe9O9VxljmPvxAhVqJjX62S+TGp93iD+mvpCoHo3+CcvyRcilz+Ko8lfO hS9tYT0HDUiDLvpUyH1AR2xW9RGDevGfwGTpF0K6cLouqyZNdhlmNciX48tFUGjakRFsxRmX K0Jx4CEZubakJe+894sX6pvNFiI7qUUdB882i5GR3v9ijVPhaMr8oGuJ3kvwBIA8lvRBGVGn 9xvzkQ8Prpbqh30I4NMp8MjFdkwCN6znBKPHdjNTwE5PRZH0S9J0o67IEIvHfH0eAWAsgpTz +jwc7VKH7vkvgscUhq/v1/PEWCAqh9UHy7R/jiUxwzw/288OpgO+i+2l11Y= Subject: Re: [PATCH] net: bypass ->sendpage for slab pages Message-ID: <903c7e2c-100f-267f-efd8-b0b3345dc918@suse.de> Date: Fri, 18 Sep 2020 16:37:24 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200821.141400.594703865403700191.davem@davemloft.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/22 05:14, David Miller wrote: > From: Christoph Hellwig > Date: Thu, 20 Aug 2020 06:37:44 +0200 > >> If you look at who uses sendpage outside the networking layer itself >> you see that it is basically block driver and file systems. These >> have no way to control what memory they get passed and have to deal >> with everything someone throws at them. > > I see nvme doing virt_to_page() on several things when it calls into > kernel_sendpage(). > > This is the kind of stuff I want cleaned up, and which your patch > will not trap nor address. > > In nvme it sometimes seems to check for sendpage validity: > > /* can't zcopy slab pages */ > if (unlikely(PageSlab(page))) { > ret = sock_no_sendpage(queue->sock, page, offset, len, > flags); > } else { > ret = kernel_sendpage(queue->sock, page, offset, len, > flags); > } > > Yet elsewhere does not and just blindly calls: > > ret = kernel_sendpage(queue->sock, virt_to_page(pdu), > offset_in_page(pdu) + req->offset, len, flags); > > This pdu seems to come from a page frag allocation. > > That's the target side. On the host side: > > ret = kernel_sendpage(cmd->queue->sock, page, cmd->offset, > left, flags); > > No page slab check or anything like that. > > I'm hesitent to put in the kernel_sendpage() patch, becuase it provides a > disincentive to fix up code like this. > Hi David and Christoph, It has been quiet for a while, what should we go next for the kernel_sendpage() related issue ? Will Christoph's or my series be considered as proper fix, or maybe I should wait for some other better idea to show up? Any is OK for me, once the problem is fixed. Thanks in advance. Coly Li