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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B1A3DC49ED7 for ; Mon, 23 Sep 2019 08:50:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7CB0420820 for ; Mon, 23 Sep 2019 08:50:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CB0420820 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 130A86B0007; Mon, 23 Sep 2019 04:50:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BB426B0008; Mon, 23 Sep 2019 04:50:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC3A86B000A; Mon, 23 Sep 2019 04:50:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id C8AF06B0007 for ; Mon, 23 Sep 2019 04:50:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 8224C824CA1C for ; Mon, 23 Sep 2019 08:50:47 +0000 (UTC) X-FDA: 75965564934.14.dolls25_5e2d137780c37 X-HE-Tag: dolls25_5e2d137780c37 X-Filterd-Recvd-Size: 2913 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Sep 2019 08:50:47 +0000 (UTC) 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) 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 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