Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2952747imm; Mon, 28 May 2018 20:48:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKn8eq8i/MjjJtd3U4/zl3KPB6m0Yt2Xv0NyQIL+9k5shrSoffyhO/q+J8L4L7w5QxwQX6y X-Received: by 2002:a63:449:: with SMTP id 70-v6mr2204614pge.229.1527565689299; Mon, 28 May 2018 20:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527565689; cv=none; d=google.com; s=arc-20160816; b=FgWn322w3FcxOblDh4GwgE5riOy6HkCycCGlIC5j1OAjYqiDgIQ0Sh4XdI3aBgjrxN W8x3i0jBqL26F2gnraTHIjVPk+3yE1CgUx4kJ1m7Wuy9eWoL4n8QQGn4BsEVKvhwD4a2 CLYvRETbufysUA9J9XZou49F/WDhnaFc++qaKY++0u2VfCu1jV7yutrwhfdIWOdZwV2B HjVGUkUwGKS81c+Y/IiLp58KVuXtwHwU/KCmyFz9/7sttUZPTM2XZm751/ByjmanlAgG XLVllMW0mmku42w/5g9qwB9brab4HCUNKgWsih4AAuy2cOU6c12Ko0nSW3tB0YRoylxd abLw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=QnZX55h+z4mn2KO+nqsq8zbiY2Dlp2GQR3mYXay8zB0=; b=JZoxlwlcZUIvuvmdh0i+bBcBy1nfTd+XhYic8/nO+DfF9jvyjWFkYRk0gPhadABZqW QV727VCNn1z0vS91rdEBhRWVbASbDLqhWbgWjQX1UkGd3JJdcRNRBgt54NWNZbam8tdY gjx2CMjVLzsvcuVy7AX99I6LGi1lFgnO9pKm++JJ4tET/J7d6zQjt6GmBEVxreAowgcS YLOZoKpu+CMsZM5ElJEHqNL7qgAaVuqMUHlFVdeuYq3G8kQZPe8o7CBtLOP8pjvfiBPs kNZJLQ/8JTqnbWR4j2KPKyr2ixutqTsZJbwfQJi8HmMvEjGodIzZ1XG2rbbvFT0ibG/j M8ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BPb1Xuut; 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 32-v6si7744339ple.447.2018.05.28.20.47.54; Mon, 28 May 2018 20:48:09 -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=BPb1Xuut; 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 S1751759AbeE1RXO (ORCPT + 99 others); Mon, 28 May 2018 13:23:14 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34886 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbeE1RXK (ORCPT ); Mon, 28 May 2018 13:23:10 -0400 Received: by mail-wr0-f196.google.com with SMTP id i14-v6so21335401wre.2 for ; Mon, 28 May 2018 10:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QnZX55h+z4mn2KO+nqsq8zbiY2Dlp2GQR3mYXay8zB0=; b=BPb1XuutyYNYdkl4lW39qZx8Uw+tkF/NyvtMAdRJbnlr4a8LcMqfvLthE8yClglHpg rpsVCrt9rYOj5OHMeALdXBndnv0BmaLVuJn2j6vUQMS+2oKNYWCGEMF0r7Gu8yM0nXXM pR5xaykaxfdDeVXLszdTPznOJb0GCSSUI4daDkTBJVvPNMum1LaQUkrzorPGm0CKUo7L IQS4+W6AQGNe2eF0EdmZbRd9qMiP14v1iGdHJNwGvWSWZrhCu7PM1rHa3p5sInyr9nnw E83DZ0E6DK0sgR+vUVuz6BtgDDoc7V0IT4p9VZ2gyxxSGqh2EJUswiZmI6cKlYfKNalg wBNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QnZX55h+z4mn2KO+nqsq8zbiY2Dlp2GQR3mYXay8zB0=; b=qyeNgeIl+mkApAb/6R70JLOYmv5KKYOEAhvXF6cQLVgh5uJa158zzTd6hzKqS2QgXN PaEDoq7aa/ZzaVQs89Gjzbp+2qTMFdqqVpBRZuJsZzDukdOx5ZYD4T0F0vc+d1h7RWUf mxH6WSCHTdYW73oaYf7IVNOlOdmjYUBdUHuf5Dj7Jbk7KfHUgME2gUNiCDU+fdC74Ykb z6CZ18vKo3VieAt7WscoY9XNgJp8CfQPVXLJKpotWsfNMEDTRb1xljUkeVLVfFaKR2cn TdAoVlOph5vW1vQyngNTtUbLy+D7R4PYoiGvV95h4x9PV/4sZn6oxGZN0US0mvDbGY1W xdqA== X-Gm-Message-State: ALKqPwcmmOKVlmewvp1T5dkKtJfpsempApjjwuB4zdYjTM2GrnQsDE2A vgbfpbMiww1CnKO+iPvbfgfjFHsdXHv3r+FifRRIpQ== X-Received: by 2002:adf:c98c:: with SMTP id f12-v6mr11919912wrh.272.1527528188635; Mon, 28 May 2018 10:23:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:1286:0:0:0:0:0 with HTTP; Mon, 28 May 2018 10:23:07 -0700 (PDT) In-Reply-To: <20180528091110.GG1517@dhcp22.suse.cz> References: <20180525185501.82098-1-shakeelb@google.com> <20180526185144.xvh7ejlyelzvqwdb@esperanza> <20180528091110.GG1517@dhcp22.suse.cz> From: Shakeel Butt Date: Mon, 28 May 2018 10:23:07 -0700 Message-ID: Subject: Re: [PATCH] memcg: force charge kmem counter too To: Michal Hocko Cc: Vladimir Davydov , Andrew Morton , Greg Thelen , Johannes Weiner , Linux MM , Cgroups , LKML 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 Mon, May 28, 2018 at 2:11 AM, Michal Hocko wrote: > On Sat 26-05-18 15:37:05, Shakeel Butt wrote: >> On Sat, May 26, 2018 at 11:51 AM, Vladimir Davydov >> wrote: >> > On Fri, May 25, 2018 at 11:55:01AM -0700, Shakeel Butt wrote: >> >> Based on several conditions the kernel can decide to force charge an >> >> allocation for a memcg i.e. overcharge memcg->memory and memcg->memsw >> >> counters. Do the same for memcg->kmem counter too. In cgroup-v1, this >> >> bug can cause a __GFP_NOFAIL kmem allocation fail if an explicit limit >> >> on kmem counter is set and reached. >> > >> > memory.kmem.limit is broken and unlikely to ever be fixed as this knob >> > was deprecated in cgroup-v2. The fact that hitting the limit doesn't >> > trigger reclaim can result in unexpected behavior from user's pov, like >> > getting ENOMEM while listing a directory. Bypassing the limit for NOFAIL >> > allocations isn't going to fix those problem. >> >> I understand that fixing NOFAIL will not fix all other issues but it >> still is better than current situation. IMHO we should keep fixing >> kmem bit by bit. >> >> One crazy idea is to just break it completely by force charging all the time. > > What is the limit good for then? Accounting? > Unlike tcpmem, the kmem accounting is enabled by default. No need to set the limit to enable accounting. I think my crazy idea was just wrong and without much thought. Though is there a precedence where the broken feature is not fixed because an alternative is available?