Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2062110yba; Fri, 19 Apr 2019 11:21:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMDS+t/SzZuhfprYqNNI/lM+ZwLRkyD/7a1pV8nJn8LS9Iqt/ZE/Ax1mdCAbPsFW/CfKhW X-Received: by 2002:a63:c046:: with SMTP id z6mr5184051pgi.81.1555698073422; Fri, 19 Apr 2019 11:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555698073; cv=none; d=google.com; s=arc-20160816; b=doLj4DqM7QVOnqExuCWXN2FDJkHldKd4mD2BxsWeRdwLv5fj3Tkzr9O8p6lTU/6It5 947zz6/c5VRODymgEvO+sJOLxjnkEuFag+m2jhE5jEPmrQBK4b7dnPnuVWG0Fdi/E3Ot +FHGC1MhfXGf6+p/y090Ga8KEKjwZAXiM8XuND0aVsQDicmPUGB6Z74flUoNoJ0wcfet Sw8KH51FAo3xn1yTyhW+snMSVykvguM5nGA+wbIg++VuNU9dMwHoZzIy9SeeMYVcydoN VXZzClQHuNLoL5e0gxxiaIhnupc80UZwS7j1izjqiiJqOt4vF9hlibCmtO2q9nTzYYY6 CMuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jDnN7xYuu1VBUKudqASvz1g5pzbRI3PK9c75wOnApTA=; b=s/g/k1zjBFZs3Sj4EEtWoFgEDCLQMynh7BR8HI/JNNtVWX7zXizx4x6H2RAabrTOPc pV+f87s2Ez6Azzt6v0YgE94PBBEgJRf3NDIecqX04XFxPQiOF93XfwGn9pRnyAc2ZJ0a Yq70IcVG0mr4GZ/yY3mx+4cSz7MfNqhoiarih/vUq70TQtj45m/8ltO6e4jFMvfgLmx0 fA7Wofg8mgUs55MgrV+JPYHCULt+J5Ex1wIQ6/+ckng/Op4FBTN8B08pFORzV4RE5Zac jWJAahtJES9kly1Hf4ajcYY3fBnfh7ViTVF7gDZzwus33WyzNVCOvknwX0t2Qr1gEW/7 iSUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pJVXOLwc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si989890pgj.132.2019.04.19.11.20.57; Fri, 19 Apr 2019 11:21:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pJVXOLwc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725859AbfDSSPi (ORCPT + 99 others); Fri, 19 Apr 2019 14:15:38 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:36990 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725280AbfDSSPi (ORCPT ); Fri, 19 Apr 2019 14:15:38 -0400 Received: by mail-yw1-f67.google.com with SMTP id w66so2154601ywd.4 for ; Fri, 19 Apr 2019 11:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jDnN7xYuu1VBUKudqASvz1g5pzbRI3PK9c75wOnApTA=; b=pJVXOLwcTV3RzVu+pObedJ4qJe4aSqH4L5NasYqdFiKvUju/IlqJGydPqDSfG4mEgt kxSWWyZmkEBlsQMDJ9o2e4/W+/eX7kZMc/PEDRYcRmtxXi4aBv9t+L8xSjUwNN6uaJb2 a+LClMsVxinVCy+b2wjeoa25rxIbQkXz8g63XRhsysxfXp2SZT+9aJDHrVo/zwSzjc3h 8GafA6Quf0aOhA7cf5bi+Yg3PpbeUBY5uPExenR8gRPV1pvCHJCQCKTqOvk89nHuCmto sBa5yKwwQtkUMxyzNRluyvq3R3HEfYr5vXdU6OwaQAvpA9GwEBqxfY6fITzx2X1eaBZr 2mVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jDnN7xYuu1VBUKudqASvz1g5pzbRI3PK9c75wOnApTA=; b=YZQlDaNp/UgVrAQVbmq0rKKnXYU/xiB55A5KDzPJRZOSNoRh2WUb1LMGxDNLu/vhLi M3HrJ4sCCzqmVf6+PhMK1wqdp2ye6FkHdxTWNnN7kO5qMJUkjkuoC0zjRTm4oXuhAGBp UZvYjfQvIpM2jWVGj6pAb8OdMfAovlOSX44/G6TcUQsJEaZXGiwHebxvmbTdWF3X13XE KBoIEiQsOz5Lhw8crwHk792dId0ZRM35p/vmIkVbLszTE3hjdZcCia8L5SglLDlOe4w/ B1QK/IcW9BkK2DuyB+PbktvMidvJlGI+VExEPEFuTKryysRCO0RrFPsZKoh6OsV+pwkG tWPQ== X-Gm-Message-State: APjAAAUTW9sAtEyrHDuRi9YwG9bL/wUyvUVcVvD+pA36od8duxeyD4Sq 7pcKSnyKpZvvNa0THprFI9IW1mRyD5IS9s8MODTiVg== X-Received: by 2002:a0d:f346:: with SMTP id c67mr3714898ywf.37.1555691283825; Fri, 19 Apr 2019 09:28:03 -0700 (PDT) MIME-Version: 1.0 References: <20190418180524.23489-1-aryabinin@virtuozzo.com> <791f4f23-d931-4ac8-4e60-3ffe46c4ece2@gmail.com> <6651d0b9-4ddf-ef6d-6f53-e1290b7aeeee@virtuozzo.com> In-Reply-To: <6651d0b9-4ddf-ef6d-6f53-e1290b7aeeee@virtuozzo.com> From: Eric Dumazet Date: Fri, 19 Apr 2019 09:27:52 -0700 Message-ID: Subject: Re: [PATCH 1/4] net/skbuff: don't waste memory reserves To: Andrey Ryabinin Cc: Eric Dumazet , "David S. Miller" , Mel Gorman , Willem de Bruijn , Florian Westphal , LKML , netdev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 9:24 AM Andrey Ryabinin wrote: > > > But why that failed allocation is such a problem? > > 1. sk_memalloc_socks() false > 2. NIC driver tries to allocate pages and fails The NIC then is unable to receive any frames. We need to be able to populate the RX ring buffer, before NIC can actually be started. Basically you are saying : We need to allocate memory only _after_ frame has been received by the NIC. I am saying : We need to allocate memory so that the NIC can put a future frame in it.