From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756684AbdJJXc6 (ORCPT ); Tue, 10 Oct 2017 19:32:58 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:35738 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbdJJXc5 (ORCPT ); Tue, 10 Oct 2017 19:32:57 -0400 Date: Wed, 11 Oct 2017 00:32:48 +0100 From: Al Viro To: Shakeel Butt Cc: Vladimir Davydov , Michal Hocko , Greg Thelen , Andrew Morton , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs, mm: account filp and names caches to kmemcg Message-ID: <20171010233248.GY21978@ZenIV.linux.org.uk> References: <20171005222144.123797-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171005222144.123797-1-shakeelb@google.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 05, 2017 at 03:21:44PM -0700, Shakeel Butt wrote: > The allocations from filp and names kmem caches can be directly > triggered by user space applications. A buggy application can > consume a significant amount of unaccounted system memory. Though > we have not noticed such buggy applications in our production > but upon close inspection, we found that a lot of machines spend > very significant amount of memory on these caches. So, these > caches should be accounted to kmemcg. IDGI... Surely, it's not hard to come up with a syscall that can allocate a page for the duration of syscall? Just to pick a random example: reading from /proc/self/cmdline does that. So does readlink of /proc/self/cwd, etc. What does accounting for such temporary allocations (with fixed limit per syscall, always freed by the end of syscall) buy you, why is it needed and what makes it not needed for the examples above (and a slew of similar ones)? While we are at it, how much overhead does it add on syscall-heavy loads? As in, a whole lot of threads is calling something like stat("/", &stbuf); in parallel? Because outside of that kind of loads it's completely pointless...