Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5214739ybe; Tue, 17 Sep 2019 04:40:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ1a/16RPVdx72u8NY03Px80CLQbnCjDfpMZyeoa2OxVC4zlh3MdO767huElEzgDqJ6Rx7 X-Received: by 2002:a17:906:edcb:: with SMTP id sb11mr4290867ejb.144.1568720458202; Tue, 17 Sep 2019 04:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568720458; cv=none; d=google.com; s=arc-20160816; b=0FHpFs4Ao82QXHlxwln+EPGXfvwxmijwp69tZCzjU1pkWspovK1u36nYgJypi9fxWE TYXr30cIVLipnA0Z8owR759f91so8OFeQCP1+YmHI8LbeVlSL/eTcKut6whPpsr5WDAO zZUyqVf5Hm+3ph46fqrjzdMewx8kLf1zHg2Mzba/6lQws13buya3yXO5wMxFS7tgzZQm UeMN1xG08olT6DPb2h/5gVgAxWO7OIOw7EZDeqFt/N5W1Baym+b1OC4+7e0cXjhEbsHD d2Bg9WTt4ztemMPpzpm7mMwqHQ2m6bil1svJ9hxoK3bhkMRRn8pz/Eaq2PpoSXXvXBvk OdGA== 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:dkim-signature; bh=U1A0a3EcW6JDElv8WwGfEykKyOhc9EqlTK9V4ESPbBg=; b=W9PXCNf6rijNaDhqP3ddeTJgsemQQJ7El+ysauVibqbXigt4xkKqf19Olnx9UJtC85 DeeL6VjoA5jsUg50MZIjJfv02PknnndC5Y9GMRAkM/1T9LYm9hwgEAmqipBJU0tlSmpK W8TJTDBRbO1Uts3cXkxOc2JiHBkZ1dw9KYd7I+N0/76j4aSAp+P+aB0munCLHGFQGjvI hsklVMUkkFddOycJnwtTDBtiipdt2sZEHHjwADxeyvck4N5NXN4JqpVGwDWpSvxbf2IA c0zvnDeD7uHpKaunvo/CDDxBxG+4LYJ+HRJTFUbBxXdysApFKaxCIXBNy+DOhOiAi+sK 1eDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=XWv86CDH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si1153863edr.195.2019.09.17.04.40.35; Tue, 17 Sep 2019 04:40:58 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=XWv86CDH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbfIQLh6 (ORCPT + 99 others); Tue, 17 Sep 2019 07:37:58 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:34871 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfIQLh6 (ORCPT ); Tue, 17 Sep 2019 07:37:58 -0400 Received: by mail-ed1-f65.google.com with SMTP id v8so3024193eds.2 for ; Tue, 17 Sep 2019 04:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=U1A0a3EcW6JDElv8WwGfEykKyOhc9EqlTK9V4ESPbBg=; b=XWv86CDHMt5iXBLXM/QKNfJIZRGCpFVPdS3DpVF5KaSetpqFB5BaVh6fl2nna9jyrA K0F2DHsyOARlKS4Acu+W4WFdJcsjCSj2dN7cgBJmE2V8IFPNZoLJemdH2owu7TX/FsWs iqppPlYWGaQSLyGzyGbSu7ZT7yhJ+PcHLvprahFA7qye0IeJziOm1thq8xMtuYtIAU9G z1LURwGamEvtsG2ax573fNanzEYDsZJp3JGVxU6tPjEaNNdro2YuuIMHQEeHnANMIOeA Z1fdOBI0U08ASyilbwTuF0EjYptbfGc6Jr400FKLxyqzlYj2TLkslrSAIkepMK6zWwdU 7PcA== 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:user-agent; bh=U1A0a3EcW6JDElv8WwGfEykKyOhc9EqlTK9V4ESPbBg=; b=hqte2vxvAHBDtMxqmw4TbVod95CKwcOj/WePKdso9xKd86Hk1zVKu/Qx3p/cxtnpEv KqPkNaf0EhOsIe7dFWqduX8Vwk9kYp6BHbsz1Li9AYGUDd0x7dakAJCjAiRyCBBmCthi mhkDqnkqzjNapx8Esa+dPXgR3nWnwJsF0Uyi1JfbbKyo/GZFhT7zzTFFeXaf3hqjTrz6 a55zXKAgx76O0thSXCKL3uVy8Mfe1B5c/VpBrctehrISV9yaMv6k0XbRukre9vW4GCQC 82mlu6wiyDzpjOGf4TCmuGUoiSNiBtzmaxJb28rwi1eJe/v+ZUi0X0cUDx+9WxuDTUk4 wqRg== X-Gm-Message-State: APjAAAX7d3o4DzQDKjyFP4+rBYN3oQmJdN8PN/5lKJk5Ps97DnHcd2LX KhIjDVrOS5mBaOZY70Mk/2WEMA== X-Received: by 2002:a50:aa96:: with SMTP id q22mr4067132edc.179.1568720276610; Tue, 17 Sep 2019 04:37:56 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id c1sm384678edd.21.2019.09.17.04.37.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Sep 2019 04:37:56 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 7A08D101C0B; Tue, 17 Sep 2019 14:37:58 +0300 (+03) Date: Tue, 17 Sep 2019 14:37:58 +0300 From: "Kirill A. Shutemov" To: Lucian Adrian Grijincu Cc: linux-mm@kvack.org, Souptick Joarder , linux-kernel@vger.kernel.org, Michal Hocko , Andrew Morton , Rik van Riel , Roman Gushchin Subject: Re: [PATCH v3] mm: memory: fix /proc/meminfo reporting for MLOCK_ONFAULT Message-ID: <20190917113758.kfcbagaz7nlbqnco@box> References: <20190913211119.416168-1-lucian@fb.com> <20190916152619.vbi3chozlrzdiuqy@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190916152619.vbi3chozlrzdiuqy@box> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 16, 2019 at 06:26:19PM +0300, Kirill A. Shutemov wrote: > > --- > > mm/memory.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/mm/memory.c b/mm/memory.c > > index e0c232fe81d9..55da24f33bc4 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -3311,6 +3311,8 @@ vm_fault_t alloc_set_pte(struct vm_fault *vmf, struct mem_cgroup *memcg, > > } else { > > inc_mm_counter_fast(vma->vm_mm, mm_counter_file(page)); > > page_add_file_rmap(page, false); > > + if (vma->vm_flags & VM_LOCKED && !PageTransCompound(page)) > > + mlock_vma_page(page); > > Why do you only do this for file pages? Because file pages are locked already, right? -- Kirill A. Shutemov