Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1957874ima; Thu, 25 Oct 2018 07:34:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5cmLBt93mCSENqXdBq2TKoXdIja4DIPb2V4XduVFmd+lbPGnAl6BITWRjSJNUsQ4R0mD/54 X-Received: by 2002:a17:902:9a04:: with SMTP id v4-v6mr1705230plp.247.1540478056051; Thu, 25 Oct 2018 07:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478056; cv=none; d=google.com; s=arc-20160816; b=ZOHoycViPTq1rspwyVIK8LLgOijtMsgw9kJ40dHQ6w8LmaV4oOG2YFFUzFHBZa1o4/ ISqYrRkV5FJZXqJdQHwFDIkaVlNB3nQlbFXAJX0GQUt/JMb9bF+YFL8uNDREBp7QeTfO 5XCzIIFlp013Qje++4YXsEoKXEL0+MfVz6A6nNBoEmw66yIzsCg1nRCS7uZkFba7NjhC iYGbR2JFQaMqZWLRZeE7j8LqDLIOIe+E6QppxB4xFBkFTlSYdV4vxtqUjxsCtpkwcZZF rwO292Y5W2LAXUHpyg2cfGjDkpkmTTystmtVYZ4efHJZvRqfyskZCByall7WIzbs6dXc Q+DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HU0elb0o2sCTeQFoNAF1SSQ30d0MrewsBy0rMcuKUKE=; b=w9sV2loIBPCQw0Q/Bb+SDw0BKX30Oz71Hxoss56XWa0aVtki5D5lgK+/t7ZIMso1Lt JrMS78Ozg7McP6Y+u1FXowrN9FkiDBia0F6K1nX5aLlzAqFJj1kTpHfZasFKdnmMw42n qoKrmFewvsXr5dY2SdNincssznwzl/TYq6VM4g5vCK8mnUqWWeBL9f45jHG7g+D2FYDg oRButd85nGFyyFOhtseg19mTYxIYIPzh++eiv2VPkrp0nPgnAQzzSd+esx3f45GjE2hf kh5BR4sd5w5a/PuHK3D/6uJZq9WfncJ71/OF3gSAeTB5xXsWouD6DeTpdr42Xu0CqV4l nKaA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y190-v6si8265247pfy.147.2018.10.25.07.33.44; Thu, 25 Oct 2018 07:34:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729500AbeJYXEW (ORCPT + 99 others); Thu, 25 Oct 2018 19:04:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:45796 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730215AbeJYWvg (ORCPT ); Thu, 25 Oct 2018 18:51:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 228DBAFDF; Thu, 25 Oct 2018 14:18:37 +0000 (UTC) Date: Thu, 25 Oct 2018 16:18:35 +0200 From: Michal Hocko To: "Edgecombe, Rick P" Cc: "daniel@iogearbox.net" , "jeyu@kernel.org" , "ard.biesheuvel@linaro.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jannh@google.com" , "keescook@chromium.org" , "arjan@linux.intel.com" , "netdev@vger.kernel.org" , "tglx@linutronix.de" , "linux-mips@linux-mips.org" , "linux-s390@vger.kernel.org" , "x86@kernel.org" , "kristen@linux.intel.com" , "Dock, Deneen T" , "catalin.marinas@arm.com" , "mingo@redhat.com" , "will.deacon@arm.com" , "kernel-hardening@lists.openwall.com" , "bp@alien8.de" , "Hansen, Dave" , "linux-arm-kernel@lists.infradead.org" , "davem@davemloft.net" , "linux-arch@vger.kernel.org" , "arnd@arndb.de" , "sparclinux@vger.kernel.org" , "alexei.starovoitov@gmail.com" Subject: Re: [PATCH RFC v3 0/3] Rlimit for module space Message-ID: <20181025141835.GS18839@dhcp22.suse.cz> References: <20181019204723.3903-1-rick.p.edgecombe@intel.com> <6b1017c450d163539d2b974657baaaf697f0a138.camel@intel.com> <20181024150706.jewcclhhh756tupn@linux-8ccs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 25-10-18 01:01:44, Edgecombe, Rick P wrote: [...] > FWIW, cgroups seems like a better solution than rlimit to me too. Maybe you all > already know, but it looks like the cgroups vmalloc charge is done in the main > page allocator and counts against the whole kernel memory limit. I am not sure I understand what you are saying but let me clarify that vmalloc memory is accounted against memory cgroup associated with the user context calling vmalloc. All you need to do is to add __GFP_ACCOUNT to the gfp mask. The only challenge here is the charged memory life cycle. When does it get deallocated? In the worst case the memory is not tight to any user context and as such it doesn't get deallocated by killing all processes which could lead to memcg limit exhaustion. > A user may want > to have a higher kernel limit than the module space size, so it seems it isn't > enough by itself and some new limit would need to be added. If there is another restriction on this memory then you are right. -- Michal Hocko SUSE Labs