Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp691289pxa; Wed, 19 Aug 2020 12:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1i/5miBxN0w11J7IEws8KzHM4Q9GgCl+SaMm/jlKpfN6AZF2Rc2Kdg48ScWLFqh0udfDF X-Received: by 2002:a17:906:80d3:: with SMTP id a19mr27958578ejx.217.1597864122446; Wed, 19 Aug 2020 12:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597864122; cv=none; d=google.com; s=arc-20160816; b=o7HWKtgZ8aCULJqi6Rw1FO46L7e+zefZXc7w7l41jQRyLjEkBrc39nyaMzRqIe1anR TaO/gTnHb3d3c3Oov3u/rKriSz9gsI+VVDqgsi1gMODGYeMDSaZEOOLw6iv9ysQd9ld5 DW0nHiUzJHBIM2r1j3kjLiK07nCpnJAY0lnepaMNxTE1XosCymUxCAe5tMESET9LuBJf jWbXTnPE0JZxsr6gJV+A8z7nRvkeIA8Hr1oT8VVe0jGHM9VnzKwHObHzo6p/T7wSY1RN ZYaahgaFvuyoZN72ZiqvsTa31jzzJMMev8uvSET2v1UVADUyP9qEb5qwG5LYj9FzNIZ/ qoIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=PbgjETiCmE5h0h7OngmBCW4QHYkZ5bkvUYvNBusYWvY=; b=ZKyXzknRkLEgLhkoYI9GxSqXteRXJr2NJAAeVZHih4PlFoCDUkG6cWJUQdzI9rT7ug SEff8Elzhr7jhGozeZ6pHPWX7TAOiwefaDAFHCstfYk5o5ycnILpYSTsRKjWiWWOnnl/ YwvFFWrNRQngixoe6w4Yxtr35LsRT4+CD5tj/dMLW0Eux1hPlPp2gGlo5WHL72/3NmQ4 TDg02uY/eAZc4/ODOClcbyRjQHMoeRnnTgcB62rBv4lq7ub2hKtywO5LYiyxaDDhFvsb Q6LMuYlOvBfJ3wEk6xefHoes7/zhXeTwW8rvzsLDoXjbNt2c/8JJSmPifmdAguuJ6k6l RJHg== 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 k11si14824064ejg.401.2020.08.19.12.08.16; Wed, 19 Aug 2020 12:08:42 -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 S1726729AbgHSTHM (ORCPT + 99 others); Wed, 19 Aug 2020 15:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbgHSTHL (ORCPT ); Wed, 19 Aug 2020 15:07:11 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94145C061757; Wed, 19 Aug 2020 12:07:11 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 5412112963ADB; Wed, 19 Aug 2020 11:50:24 -0700 (PDT) Date: Wed, 19 Aug 2020 12:07:09 -0700 (PDT) Message-Id: <20200819.120709.1311664171016372891.davem@davemloft.net> To: hch@lst.de Cc: kuba@kernel.org, colyli@suse.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: bypass ->sendpage for slab pages From: David Miller In-Reply-To: <20200819051945.1797088-1-hch@lst.de> References: <20200819051945.1797088-1-hch@lst.de> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 19 Aug 2020 11:50:24 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig Date: Wed, 19 Aug 2020 07:19:45 +0200 > Sending Slab or tail pages into ->sendpage will cause really strange > delayed oops. Prevent it right in the networking code instead of > requiring drivers to guess the exact conditions where sendpage works. > > Based on a patch from Coly Li . > > Signed-off-by: Christoph Hellwig Yes this fixes the problem, but it doesn't in any way deal with the callers who are doing this stuff. They are all likely using sendpage because they expect that it will avoid the copy, for performance reasons or whatever. Now it won't. At least with Coly's patch set, the set of violators was documented and they could switch to allocating non-slab pages or calling sendmsg() or write() instead. I hear talk about ABIs just doing the right thing, but when their value is increased performance vs. other interfaces it means that taking a slow path silently is bad in the long term. And that's what this proposed patch here does.