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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7912FC3A5A1 for ; Thu, 22 Aug 2019 19:04:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 494A720856 for ; Thu, 22 Aug 2019 19:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391293AbfHVTEY (ORCPT ); Thu, 22 Aug 2019 15:04:24 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:47270 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731910AbfHVTEX (ORCPT ); Thu, 22 Aug 2019 15:04:23 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (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 6F070153410A7; Thu, 22 Aug 2019 12:04:22 -0700 (PDT) Date: Thu, 22 Aug 2019 12:04:21 -0700 (PDT) Message-Id: <20190822.120421.71092037400077946.davem@davemloft.net> To: jan.dakinevich@virtuozzo.com Cc: linux-kernel@vger.kernel.org, den@virtuozzo.com, khorenko@virtuozzo.com, pabeni@redhat.com, viro@zeniv.linux.org.uk, axboe@kernel.dk, hare@suse.com, kgraul@linux.ibm.com, kyeongdon.kim@lge.com, tglx@linutronix.de, netdev@vger.kernel.org Subject: Re: [PATCH] af_unix: utilize skb's fragment list for sending large datagrams From: David Miller In-Reply-To: <1566470311-4089-1-git-send-email-jan.dakinevich@virtuozzo.com> References: <1566470311-4089-1-git-send-email-jan.dakinevich@virtuozzo.com> X-Mailer: Mew version 6.8 on Emacs 26.1 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]); Thu, 22 Aug 2019 12:04:22 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Dakinevich Date: Thu, 22 Aug 2019 10:38:39 +0000 > However, paged part can not exceed MAX_SKB_FRAGS * PAGE_SIZE, and large > datagram causes increasing skb's data buffer. Thus, if any user-space > program sets send buffer (by calling setsockopt(SO_SNDBUF, ...)) to > maximum allowed size (wmem_max) it becomes able to cause any amount > of uncontrolled high-order kernel allocations. So? You want huge SKBs you get the high order allocations, seems rather reasonable to me. SKBs using fragment lists are the most difficult and cpu intensive geometry for an SKB to have and we should avoid using it where feasible. I don't want to apply this, sorry.