Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp68551imu; Thu, 3 Jan 2019 14:14:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN6XkSwdSO/GXN8UpWqUYh7VXCw2ZhGD0uZliuTjZOFFD0ISVHrbR514Q8FVFahnOw+Y8PmS X-Received: by 2002:a63:f615:: with SMTP id m21mr18905845pgh.428.1546553691866; Thu, 03 Jan 2019 14:14:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546553691; cv=none; d=google.com; s=arc-20160816; b=RAnf4DwOj6lEYaqkre7S7bObhmk9d+7g3NJ28QwyNauO0RVcy2vuq4X4voBnYNBhsr UDo87tONDsyYN0w4sXWwtfnZ8Rhr71ssdAzk4kGvjVbt69oCuWoH+d+fLM9XOn5PiNAo MHWq89jwbRNPDJlA9oxw3CcRwEv5A2h6Uoj0OKGiKSUhjb5cpqY2RUyLyqdm9YeLq03Q vyHlCWKuLyEQbl7pU2u4Q2O2TmWgd3JRNxiqiPIojHt82rW4ZBV0CnPLFj0OiEwrU7aQ +AGBLDKelGL10Uua/szJZrIppW7uTQrAPomlunxnnkhYED/2qesYa92JjU5SSeS+jGXQ a4PQ== 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=nRuzp0vI0flryI3MP5+vDJIF6vIrlB4Ktla0xA64B1Y=; b=xy1cpPMLTNX3BCgWWpZipdKCe90wnqwWIhF85Rl3tQVbt7FQnUo+CDhOtGGwWlXLh9 7WxsJtvs+hp3sxC3n70iNby0wDud2exkzY9eCWt7AaT6jLi6W467dF4nLNYoJtWznrkn zMh8hlRxBw6JA8wxNtFX98j4y6PiQINCL/5EED9XoTGlkrWn1FrZV/3sDw0XRqED11qk GEPrA0d8HwbLRvx19on0K9jgHTAqPnsGM9SOS2pA2Y8dqkZUrRwdksVSp5ZO0qi6riu1 CdnWy7Y+fjJntVr0WvFvtLAaGcDm+JDNBYKY5rDdHI9sritjFjy8+PooIXguKjxi5sBE Lw5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P9PpFd3n; 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 90si699215plb.17.2019.01.03.14.14.36; Thu, 03 Jan 2019 14:14:51 -0800 (PST) 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=P9PpFd3n; 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 S1732302AbfACQSX (ORCPT + 99 others); Thu, 3 Jan 2019 11:18:23 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:41643 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730643AbfACQSW (ORCPT ); Thu, 3 Jan 2019 11:18:22 -0500 Received: by mail-yb1-f193.google.com with SMTP id j10so10582101ybj.8 for ; Thu, 03 Jan 2019 08:18:21 -0800 (PST) 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=nRuzp0vI0flryI3MP5+vDJIF6vIrlB4Ktla0xA64B1Y=; b=P9PpFd3n7HFykVrlxL8ZDNljuAJ/n4gopOyvWY6bWuAMNKTRC8Xro/HUuAj2m+8Q+w tvTGTCrHEGsoSaFRZnR4jBBwCl5W5K+Jcap4iSOC29bEZeTvAQeh6LpUcYZt9UWRUDm/ V07rtj1AARtUg4eJR1vZueQaNHE4PmTrtxvpLUb+Dx8b+DyI4KocCEC9E6gNMqfUKw2P ynAQgrWxWdMUZcFyR2dN+CkU7mHx40FNdy8gVu5iDVUfsUETVMEdbQunpaRdXfKb0KFs FmMikP6SYycVjla6fgf5S4WLb0KQsEnOPCXZ737utsNhrdzo1HfuovNeWa7cawc386Kl mgqw== 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=nRuzp0vI0flryI3MP5+vDJIF6vIrlB4Ktla0xA64B1Y=; b=fWh0/HbbDai5f7OjAlHxmJ5eLEDrlrkIA12pXdXkChXB/Zo/ZyQh1mXppaTxR9ALOk xhHTiIc8Wydgh7AySUvLkdG5Y4w7/BezU+kZjZjtpL4QpBrp435rcfzGpR7Su3seub+W nat0ABP9JrH7ceM1hsuSnrZro/jaXxFISheFrkevnjn0Q+RtvL7d6doXAoPNIUvyfa7Q 6Tt29CLbGkGx7E3Wb/tthEDK67Um+N3iT5ujq/y+TLnIVe4rVFGtAFVPL3zqeASihMkr xvMfvAW4w5wlbJiALGo1qdZMbsV8iCe2NJYAKOOJQ5d58a16Lm4/bIFp5La22dRa9fct RJTQ== X-Gm-Message-State: AJcUukfY3NL0TiAgINUw9AorjI/LMRHH71Ryul5AbR75hf2fGzfQM4d5 FsQCFlGWYbRkhd7U9o9rBMCplRLVtRbNNsIRhqEcrA== X-Received: by 2002:a25:a269:: with SMTP id b96mr18971395ybi.148.1546532300334; Thu, 03 Jan 2019 08:18:20 -0800 (PST) MIME-Version: 1.0 References: <20190103031431.247970-1-shakeelb@google.com> <313C6566-289D-4973-BB15-857EED858DA3@oracle.com> In-Reply-To: <313C6566-289D-4973-BB15-857EED858DA3@oracle.com> From: Shakeel Butt Date: Thu, 3 Jan 2019 08:18:09 -0800 Message-ID: Subject: Re: [PATCH v2] netfilter: account ebt_table_info to kmemcg To: William Kucharski Cc: Michal Hocko , Andrew Morton , Florian Westphal , Kirill Tkhai , Linux-MM , LKML , syzbot+7713f3aa67be76b1552c@syzkaller.appspotmail.com, Pablo Neira Ayuso , Jozsef Kadlecsik , Roopa Prabhu , Nikolay Aleksandrov , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux-foundation.org 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 Thu, Jan 3, 2019 at 2:15 AM William Kucharski wrote: > > > > > On Jan 2, 2019, at 8:14 PM, Shakeel Butt wrote: > > > > countersize = COUNTER_OFFSET(tmp.nentries) * nr_cpu_ids; > > - newinfo = vmalloc(sizeof(*newinfo) + countersize); > > + newinfo = __vmalloc(sizeof(*newinfo) + countersize, GFP_KERNEL_ACCOUNT, > > + PAGE_KERNEL); > > if (!newinfo) > > return -ENOMEM; > > > > if (countersize) > > memset(newinfo->counters, 0, countersize); > > > > - newinfo->entries = vmalloc(tmp.entries_size); > > + newinfo->entries = __vmalloc(tmp.entries_size, GFP_KERNEL_ACCOUNT, > > + PAGE_KERNEL); > > if (!newinfo->entries) { > > ret = -ENOMEM; > > goto free_newinfo; > > -- > > Just out of curiosity, what are the actual sizes of these areas in typical use > given __vmalloc() will be allocating by the page? > We don't really use this in production, so, I don't have a good idea of the size in the typical case. The size depends on the workload. The motivation behind this patch was the system OOM triggered by a syzbot running in a restricted memcg. Shakeel