Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp931349imm; Sat, 26 May 2018 15:38:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqCbMCW01HEs4HiB3h4j47Q3R+wWaB4mH0JuMoJI8fnbO2D8RzXz9zir3uV6Li+FJhnDVug X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr7792684plc.241.1527374285495; Sat, 26 May 2018 15:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527374285; cv=none; d=google.com; s=arc-20160816; b=a2DDcFFJhni33i3S+ICrjFaMvU9FJu6Rm/xdr3Dc8J/tdhQA1IVaYou2oJ0kWnd5NH yPfulHMAZhoMhVp/kLFH+cBoJ8CQNGS5Tla416BW0ah6jzr6bGr/MaQNF61Iz/LLxcRN HumpCZKdPqQYEyXUZ2mz3Cq1w9DrJmwGAESuIR1kmslOlFOAopr1gfprAWiNfxl5yH1N yAxhWL56b3u8DsDPPCCJmuPJdOnPH/0P7omWWqLfnHYu9lxgit6IzB+fbGAthWLcEvy3 PQ9kZ/ZzU72yT7aNReVsKmoFghLBN0XwTnxOoNbKrv9m2T24qAqMpJKYgDjT95rI3eJK 4TAg== 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=54+VJeasqBof8u0nfYimee377xmvUkl+RI8HREEgdcI=; b=gTjugLaE5JyH2yNEqHEi3qws/E5uICvY+W5HljKSjZBWG4+DoooyIeOesozlyMxpRy NQNiHOy+6UiV+yjyMpm5uEDuSdJu716ABMDceEgnfgt00mD309mV/KLQ/Y22KKxB8SD1 p8pcHK338HgJ7bM3HTvONt2sge1hA95vEMnIVO9lCt1GUyCJpq0lkruHuG1qFzvekCPq GF91EvKIQksPHDXOM9Liy0HGTHUb77ydir3ZsNjRMFEm4/QCGEEW6/c+sbYZsFsPjK8u tjUGTxxxZZAhruEXTsIUmFAkMM6qCSYekSjN3LDJQiZdOwP5BeIrb4NVjXdwpI0nVShT OZdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SfX6eyfR; 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 q1-v6si19500349pgc.156.2018.05.26.15.37.17; Sat, 26 May 2018 15:38:05 -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=SfX6eyfR; 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 S1032452AbeEZWhJ (ORCPT + 99 others); Sat, 26 May 2018 18:37:09 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:38833 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032422AbeEZWhI (ORCPT ); Sat, 26 May 2018 18:37:08 -0400 Received: by mail-wr0-f196.google.com with SMTP id 94-v6so14626477wrf.5 for ; Sat, 26 May 2018 15:37:07 -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=54+VJeasqBof8u0nfYimee377xmvUkl+RI8HREEgdcI=; b=SfX6eyfRyNAyZqZuwPdiVz+D+J8ufClTwcxD1rAnyPBi1dLBG+6jn3GXezlSa4gVB9 lMtCbR9UeS+hKdRHehZ5CI3bFxJHEFBnidiWdyZEYM1BSiSzHX/opI+kikuUoQ0lxKPf pwjcy5/jxHntmmCJloi4QcNgug67vBflYqmoDzIMkJpPEUHAgEzxMt7NFQfCqeYLO+WQ BzcGVYfri8UrZuWKV19mqGeQe6EqedUaXoL6fciGbYbvg0ht7jOFRp0n/Rnv+G9D5J86 Nfsq1BA17bWQVLQsV8KhSfyL0lGN13URV6K+bGB9CuNBcLvXneFCrXmSTDWmYz6LA209 9GfA== 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=54+VJeasqBof8u0nfYimee377xmvUkl+RI8HREEgdcI=; b=bI2ok+9nLjasl28gFcdCJ78bYMwh6Kj/+2IQCZkexfZ38rSyIfU/CDMfbTuQ7JmWXP 8hbIM6D4Apr4IwZTzBFApFJ10Qk8r61XfFvbx0nuoxqoZImZrwkLLR0D23TVPSxwF7rE mMo2Jc5C25ZFKFijTNujgilpx1DbeQ9xLSMKMV8XfTy34+1CeFs4CuechIt4Tpw3OjT3 bn0Rlu5UDXOK3QqD14+7ybNFlyeKr//JXEjkkpH+GvJcKUSdKZ5BpaJd5hbuB9Z+UVuh eiD11gji03kDed6AsDWGIvHoGGka4auEudb7sF1/6vshYRQRWdMrjjGTfN4VRxeRz2BQ RC7A== X-Gm-Message-State: ALKqPwcPomiZZMiZjr4BRdQAtP0EuSMdv1ZQ1CGM8O7IV3XO5qarbwag C6VPMr95Ij8PS8v/L151UeHQZhau6Bxj90Ebjt4d7g== X-Received: by 2002:adf:adcb:: with SMTP id w69-v6mr5899154wrc.101.1527374226544; Sat, 26 May 2018 15:37:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:1286:0:0:0:0:0 with HTTP; Sat, 26 May 2018 15:37:05 -0700 (PDT) In-Reply-To: <20180526185144.xvh7ejlyelzvqwdb@esperanza> References: <20180525185501.82098-1-shakeelb@google.com> <20180526185144.xvh7ejlyelzvqwdb@esperanza> From: Shakeel Butt Date: Sat, 26 May 2018 15:37:05 -0700 Message-ID: Subject: Re: [PATCH] memcg: force charge kmem counter too To: Vladimir Davydov Cc: Michal Hocko , 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 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.