Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp815650ybn; Tue, 24 Sep 2019 09:56:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKGR0C7psAhQJeZ9CS9K1nAOOKeBbHBO8qaonh4CRIk71/XkSYj7Z6l6RuXJcpIFDAn34Y X-Received: by 2002:a17:906:7f03:: with SMTP id d3mr3402575ejr.115.1569344215825; Tue, 24 Sep 2019 09:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569344215; cv=none; d=google.com; s=arc-20160816; b=b/8W5y+kxO2+KaF9fASx3e2jGeUdGpgWkXyrxMYfqQHaCB+hRCR5xX5ZWLbasinVri VdNIMYuCydvHZBfWQGJFy0hOa/9sk8wWdnZX9mBzZ54mC9ak5MmU+MmIUnU+tch+Eg1+ kbLCg2ZYic+9OUWWy1L+1sujG+NzBU1heEiG7FWBhBdXsTBQIHh0iNhNIxF27opzH85H /rpYz/Cm/4Tc6sexo5XfpgT2VnvBFHYgy9d4FB9HM2l8rF8Z+5xnTS2hxVkdFe5iw7gz ixlRwHp+EiiV+F5qF00RqZnOe1j9QoaY5zugJxl6AzZuZFpa1EknMZGAc7YHcSoH0Ft4 UEOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Sx+AdGTguLKdvUGpxA/5lf5lkL01FF6pBfLq8j1UD/8=; b=N/u6cTfdR+VBB9rl8Kih9x+FTvYF5eQuYxrl7Lxp5dEtfnKuVZMSrpjH/jF++P99L2 UVHAEeDiE/TuxKSkZ45JBBoPRWg7fS9NQpFi/6sD/scjMx70+XmvpQXzTsS5ZGSvcuBE O+pu8DmN7M4oGzqKznrzEiPufGRVwvO8Z+EAeqCsD1xbUe3AruHFGMR5LBtfoHCbOcEH 4VwiGJmtsS0b6K+LdH8J+kdhj+ZXqUbfPUStRjbUgbY9t3CdyfUF0ofPF5G67q5GZfvX BOo9jq80zF+zcVGh2o/67AO95Yfa4IlSEYMLMC5oh2VWawkEm3cWi+zN3XQDiKCWgHgR fxbw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si1196104ejr.187.2019.09.24.09.56.31; Tue, 24 Sep 2019 09:56:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731715AbfIWIur (ORCPT + 99 others); Mon, 23 Sep 2019 04:50:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:43102 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731680AbfIWIur (ORCPT ); Mon, 23 Sep 2019 04:50:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 886DDAAB2; Mon, 23 Sep 2019 08:50:45 +0000 (UTC) Date: Mon, 23 Sep 2019 10:50:45 +0200 From: Michal Hocko To: "Kirill A. Shutemov" Cc: Lucian Adrian Grijincu , linux-mm@kvack.org, Souptick Joarder , linux-kernel@vger.kernel.org, Andrew Morton , Rik van Riel , Roman Gushchin Subject: Re: [PATCH v3] mm: memory: fix /proc/meminfo reporting for MLOCK_ONFAULT Message-ID: <20190923085045.GC6016@dhcp22.suse.cz> References: <20190913211119.416168-1-lucian@fb.com> <20190916152619.vbi3chozlrzdiuqy@box> <20190917101519.GD1872@dhcp22.suse.cz> <20190917113550.v6nool7oizht66fx@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917113550.v6nool7oizht66fx@box> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 17-09-19 14:35:50, Kirill A. Shutemov wrote: > On Tue, Sep 17, 2019 at 12:15:19PM +0200, Michal Hocko wrote: > > On Mon 16-09-19 18:26:19, Kirill A. Shutemov wrote: > > > On Fri, Sep 13, 2019 at 02:11:19PM -0700, Lucian Adrian Grijincu wrote: > > > > As pages are faulted in MLOCK_ONFAULT correctly updates > > > > /proc/self/smaps, but doesn't update /proc/meminfo's Mlocked field. > > > > > > I don't think there's something wrong with this behaviour. It is okay to > > > keep the page an evictable LRU list (and not account it to NR_MLOCKED). > > > > evictable list is an implementation detail. Having an overview about an > > s/evictable/unevictable/ > > > amount of mlocked pages can be important. Lazy accounting makes this > > more fuzzy and harder for admins to monitor. > > > > Sure it is not a bug to panic about but it certainly makes life of poor > > admins harder. > > Good luck with making mlock accounting exact :P I didn't say exact. All I am saying is that the more imprecise it will be the harder it is for admin to make any sense of the value. > For start, try to handle sanely trylock_page() failure under ptl while > dealing with FOLL_MLOCK. There are likely cases when accounting is problematic/impossible. But those should be a minority. > > If there is a pathological THP behavior possible then we should look > > into that as well. > > There's nothing pathological about THP behaviour. See "MLOCKING > Transparent Huge Pages" section in Documentation/vm/unevictable-lru.rst. Thanks this documentation helps. I was worried there is something more going on. -- Michal Hocko SUSE Labs