From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64CADC2BA19 for ; Tue, 14 Apr 2020 18:49:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2FC442076B for ; Tue, 14 Apr 2020 18:49:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FC442076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C12E08E0006; Tue, 14 Apr 2020 14:49:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC3258E0001; Tue, 14 Apr 2020 14:49:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB1D78E0006; Tue, 14 Apr 2020 14:49:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 8FC9C8E0001 for ; Tue, 14 Apr 2020 14:49:21 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 403B2180AD807 for ; Tue, 14 Apr 2020 18:49:21 +0000 (UTC) X-FDA: 76707348522.15.mask20_176e87043802b X-HE-Tag: mask20_176e87043802b X-Filterd-Recvd-Size: 5978 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 18:49:20 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id t14so2526771wrw.12 for ; Tue, 14 Apr 2020 11:49:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5etxd9gVFF2A6oPERnSptsX6ygEMzNVMa/EIetpdkKU=; b=c/IiFNCDtrri3q6bAvAv475aQis/Z4zfvOY2AaIAIHMOchEfTYtB0KmYp4KIrLkdWM u5kzXUTU15EsoTP+jQGm6gVfUk5fUx0ZNeS2CAeuXdE95ktnmFlamozt70rTAsjhMP4L vbha/miX1gRKgI2X41UgW1cD3s9K3ThAmCExhd5Yzs/EQxkvomQ0O6wjfoftx6sPrfGt Uu5jBuNBS/cfMHLrn+soJxq//9uTNKget7/XeYNXj6g5ShNSrEaWQGhbn2uX3ioS0ch0 XTPUIcPtIK7gPe/ZnqSJu1ydHC7mFEiFrGeXxcCUKFIMsRn5UmP3n0k0JZgNopdf7oy/ Sl6g== X-Gm-Message-State: AGi0PuYbOyhXNK1VzBgxntnCOD5iPigAo+PtygP7HHvb1n1i7iJ+9ZVU H2EvubZHGEWOluCBRnMXO8o= X-Google-Smtp-Source: APiQypLxnQgq9Itt+tEMgXYqaqb6KCW+fSDosF9wKWsC6LKfUejb1sLd5HN4lOiyxHlj6u9skdjO4w== X-Received: by 2002:adf:f4cc:: with SMTP id h12mr24661827wrp.171.1586890159764; Tue, 14 Apr 2020 11:49:19 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id n6sm19047761wmc.28.2020.04.14.11.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 11:49:18 -0700 (PDT) Date: Tue, 14 Apr 2020 20:49:17 +0200 From: Michal Hocko To: Leonid Moiseichuk Cc: svc_lmoiseichuk@magicleap.com, hannes@cmpxchg.org, vdavydov.dev@gmail.com, tj@kernel.org, lizefan@huawei.com, cgroups@vger.kernel.org, akpm@linux-foundation.org, rientjes@google.com, minchan@kernel.org, vinmenon@codeaurora.org, andriy.shevchenko@linux.intel.com, anton.vorontsov@linaro.org, penberg@kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 0/2] memcg, vmpressure: expose vmpressure controls Message-ID: <20200414184917.GT4629@dhcp22.suse.cz> References: <20200413215750.7239-1-lmoiseichuk@magicleap.com> <20200414113730.GH4629@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 14-04-20 12:42:44, Leonid Moiseichuk wrote: > Thanks Michal for quick response, see my answer below. > I will update the commit message with numbers for 8 GB memory swapless > devices. > > On Tue, Apr 14, 2020 at 7:37 AM Michal Hocko wrote: > > > On Mon 13-04-20 17:57:48, svc_lmoiseichuk@magicleap.com wrote: > > > From: Leonid Moiseichuk > > > > > > Small tweak to populate vmpressure parameters to userspace without > > > any built-in logic change. > > > > > > The vmpressure is used actively (e.g. on Android) to track mm stress. > > > vmpressure parameters selected empiricaly quite long time ago and not > > > always suitable for modern memory configurations. > > > > This needs much more details. Why it is not suitable? What are usual > > numbers you need to set up to work properly? Why those wouldn't be > > generally applicable? > > > As far I see numbers which vmpressure uses - they are closer to RSS of > userspace processes for memory utilization. > Default calibration in memory.pressure_level_medium as 60% makes 8GB device > hit memory threshold when RSS utilization > reaches ~5 GB and that is a bit too early, I observe it happened > immediately after boot. Reasonable level should be > in the 70-80% range depending on SW preloaded on your device. I am not sure I follow. Levels are based on the reclaim ineffectivity not the overall memory utilization. So it takes to have only 40% reclaim effectivity to trigger the medium level. While you are right that the threshold for the event is pretty arbitrary I would like to hear why that doesn't work in your environment. It shouldn't really depend on the amount of memory as this is a percentage, right? > From another point of view having a memory.pressure_level_critical set to > 95% may never happen as it comes to a level where an OOM killer already > starts to kill processes, > and in some cases it is even worse than the now removed Android low memory > killer. For such cases has sense to shift the threshold down to 85-90% to > have device reliably > handling low memory situations and not rely only on oom_score_adj hints. > > Next important parameter for tweaking is memory.pressure_window which has > the sense to increase twice to reduce the number of activations of userspace > to save some power by reducing sensitivity. Could you be more specific, please? > For 12 and 16 GB devices the situation will be similar but worse, based on > fact in current settings they will hit medium memory usage when ~5 or 6.5 > GB memory will be still free. > > > > > > Anyway, I have to confess I am not a big fan of this. vmpressure turned > > out to be a very weak interface to measure the memory pressure. Not only > > it is not numa aware which makes it unusable on many systems it also > > gives data way too late from the practice. > > > > Btw. why don't you use /proc/pressure/memory resp. its memcg counterpart > > to measure the memory pressure in the first place? > > > > According to our checks PSI produced numbers only when swap enabled e.g. > swapless device 75% RAM utilization: I believe you should discuss that with the people familiar with PSI internals (Johannes already in the CC list). -- Michal Hocko SUSE Labs