Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3886489pxb; Tue, 26 Jan 2021 07:13:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEU2ke7NL5BprAacvO/Bqq+FR/04XEriGhljKUrXCar/lISPdY8fTR+R0csRO9SAuDAA73 X-Received: by 2002:a05:6402:35ca:: with SMTP id z10mr5104758edc.186.1611674014817; Tue, 26 Jan 2021 07:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611674014; cv=none; d=google.com; s=arc-20160816; b=RErvIPx4kHSElNyPSs1HKbvdaMQSIQtCpDS4pCjTxTujtT9kf9JlaD6fvhS5Xg6nZf pgaTsUh5nKj2zZPuwaC7UecUQ5TejnsJoY+88LonCMMmjicEo9hN7C9OSVe6z9mxm/ec TXWqlWtvqXEdul1J+QJ3oSenZR+mS3td/d0pkgWKMCXJcNOLbQfD8qUV2h9idyGxPqSo 2aHeXrAl7bfrwSPv3U1FUTynWELnslsKIZM+tD5PTFC0VLwiUxMWjKi1gR1oun2frtC3 47gsmGazyQIitHNK+unyM6rmwca5dwNUnGcqfiXrXnoRsros7k299r58RK7o5lD7fozF rwvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CXc9QyfjbzYkr/9E7kWbWAYLlI4FbRmuEeT8rg+wTwU=; b=fTAt4n3oJYMnCJRF/L3Rc7PmgXwUyLRW2GXsZX9p+wNXr+rlJDb0oOExr+H9poQfXB yenuTrXDwCIXEVd9QAXU10Ukp7GzG51bkTP3qLrEL/65oVSySXhS5LmSstuPsy/Dn1yj 7ULUxXwtGojb4NIUOIQWVyLRuA30QQYWvMtvlgbNHNnQgCZm8NdmayDvSM7P+5MS3U/x YS9G8YRDuoSlTYJxW+1dwgjcheP9Ynm2UAjzG7q8FuJ4Jd4RX4LcLAqXIwCkgX2tn3C4 AWxNyUhQoCBJIkU6qq3QqKEgywioe3e41fCmuSe7mjaUDf2qH+26BGRIdmmVyMcciEqO KW6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=RcjpwZyx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si8900377edx.588.2021.01.26.07.13.09; Tue, 26 Jan 2021 07:13:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=RcjpwZyx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406142AbhAZPIZ (ORCPT + 99 others); Tue, 26 Jan 2021 10:08:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:34092 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406091AbhAZPGp (ORCPT ); Tue, 26 Jan 2021 10:06:45 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611673558; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CXc9QyfjbzYkr/9E7kWbWAYLlI4FbRmuEeT8rg+wTwU=; b=RcjpwZyxbSnL27+xPbzI8DyQUePSR4WX2wnQ97UeZMl/oXbeJLspplWQnjrpGmeZ7f77M8 pp/AUp1dBACy/R4ZeJn8VoibDW4Ammk83FYCwymuY2mppYsbTam98rNT5itWkQIDggqXZG gLCeXQM4w8C09vqYIx/Yft3mlmE8rVM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E4094AF2F; Tue, 26 Jan 2021 15:05:57 +0000 (UTC) Date: Tue, 26 Jan 2021 16:05:55 +0100 From: Michal Hocko To: Matthew Wilcox Cc: Mike Rapoport , Andrew Morton , Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , David Hildenbrand , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Mark Rutland , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org, Hagen Paul Pfeifer , Palmer Dabbelt Subject: Re: [PATCH v16 08/11] secretmem: add memcg accounting Message-ID: <20210126150555.GU827@dhcp22.suse.cz> References: <20210121122723.3446-1-rppt@kernel.org> <20210121122723.3446-9-rppt@kernel.org> <20210125165451.GT827@dhcp22.suse.cz> <20210125213817.GM6332@kernel.org> <20210126144838.GL308988@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210126144838.GL308988@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 26-01-21 14:48:38, Matthew Wilcox wrote: > On Mon, Jan 25, 2021 at 11:38:17PM +0200, Mike Rapoport wrote: > > I cannot use __GFP_ACCOUNT because cma_alloc() does not use gfp. > > Besides, kmem accounting with __GFP_ACCOUNT does not seem > > to update stats and there was an explicit request for statistics: > > > > https://lore.kernel.org/lkml/CALo0P13aq3GsONnZrksZNU9RtfhMsZXGWhK1n=xYJWQizCd4Zw@mail.gmail.com/ > > > > As for (ab)using NR_SLAB_UNRECLAIMABLE_B, as it was already discussed here: > > > > https://lore.kernel.org/lkml/20201129172625.GD557259@kernel.org/ > > > > I think that a dedicated stats counter would be too much at the moment and > > NR_SLAB_UNRECLAIMABLE_B is the only explicit stat for unreclaimable memory. > > That's not true -- Mlocked is also unreclaimable. And doesn't this > feel more like mlocked memory than unreclaimable slab? It's also > Unevictable, so could be counted there instead. yes, that is indeed true, except the unreclaimable counter is tracking the unevictable LRUs. These pages are not on any LRU and that can cause some confusion. Maybe they shouldn't be so special and they should live on unevistable LRU and get their stats automagically. I definitely do agree that this would be a better fit than NR_SLAB abuse. But considering that this is somehow even more special than mlock then a dedicated counter sounds as even better fit. -- Michal Hocko SUSE Labs