Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4817426imu; Tue, 8 Jan 2019 06:52:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5qgtGlKrcp9P2XcYyXxs3h4q2+SBiQXZEABm+ftUBRBC3OV/fjrFTzpOymtZZZUnA6OKjE X-Received: by 2002:a63:9306:: with SMTP id b6mr1733750pge.36.1546959142793; Tue, 08 Jan 2019 06:52:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546959142; cv=none; d=google.com; s=arc-20160816; b=p4E5EH9xi4aAEIhvVd/e41yzfeEoE3vk6WKDhlqTjZddRCyHGIVUDOqV9jO1lWEQbd /lrQ+esyJ2qayXWBBIgEQ5ECnoETX0d0MHb9jhvbcGeT9ppBR1h3RpsPV/knqvrA+c+v MkjF/izh0qwCammCf3ksoCAs2Gg823vrJTl7zUxIVSyDvTZuzVV7tlvJip12TA+cKBw1 dd2WsK5xHw5q0QsQ9t8Go07BpEU8K22LklpwSAfPLBTeSHUa0hbrE9FsAZyDoxf96Fhd zfhT/gxS+EmH2jpK4ACS+5Ppq6ZmrMZqt9fpo6dxiKy7C5nO6g1NntG3V+xytCP6Zj3m rnPg== 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=8cM+kAXFL+8+AKuvU4SrjiPU40Ah66XIhWFYAtDRTRo=; b=EDFuxJYUww7VM4+ythqOCjmdHhC/HFujHkrac5dMYsiK9i4JqPIjODfCyDHCBEsr8g UfwnFTDlLfQVt7+tmWfLXDraJbQYUXFC/gf85f/yaEHdO9H2ZaIXyEV6sYq0+xvqb7L8 TgJkCzu6atuyE09F6mVwLt9p5mp+7YBwm1+sgkX9szpwZLuN2gcFOzgjZHK9/s6prLF9 A687qEs276jDAuYhXXD5EFKQgzEGwcxdlP5aroyknojtJFrOgAQQD0Z+/OWoDTkY1Fmi mqoHc8cXuw4NBFjMfSWUuwLAR2bDrlvWLEWnLEByIC7idTdsrxpts+JPTpVW+8gD+9TW p7Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=ZDw+Ubpj; 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 i1si66363793pfj.276.2019.01.08.06.52.06; Tue, 08 Jan 2019 06:52:22 -0800 (PST) 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=ZDw+Ubpj; 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 S1729264AbfAHOJU (ORCPT + 99 others); Tue, 8 Jan 2019 09:09:20 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39314 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729163AbfAHOIu (ORCPT ); Tue, 8 Jan 2019 09:08:50 -0500 Received: by mail-pf1-f196.google.com with SMTP id r136so1986993pfc.6 for ; Tue, 08 Jan 2019 06:08:49 -0800 (PST) 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=8cM+kAXFL+8+AKuvU4SrjiPU40Ah66XIhWFYAtDRTRo=; b=ZDw+Ubpjw479aAo3fr761ssfrSZAR7dwocsU4M4iyjHvgVITm9stI4okOM+GiMPUin vlwscVezktbOv01q14nwLJ3xq24mLySbznsRj6W0U+Wvh/1RQLOR7C5vflgjOgwhYzSK FzXhc+etNz/R3gnErXrVBvFjTR7YRFSLoxFtTDm7kmHYuC+wp+UXcFqS7oPni4oG3tDi lij1pP7eJMYe5+HTjBEoI16YR+hderRzyT8LY8XmvYM2LgpMytfX3fX9+LZLqd5nwSiN SX9TQcFzvFEPKvBzfs00bdBgaSd5M9UBXovNw70vpr3cklXccsnq4FeRx5ROnX567vec 6swA== 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=8cM+kAXFL+8+AKuvU4SrjiPU40Ah66XIhWFYAtDRTRo=; b=pwtp9QQPMyod9JHIJ46cECrCzS4OIpm9Ej/RZqdQKrqzMd2DcCMafLThZgVbJHiZtu 7nKmww8HTv9EZNDp24ABGmknA9aeaxK1A9TF0sHjioIpLagHhb7OZP09rv2Coq129Rs2 3ldYKY7z0SRexlgE9Bs3GG0TU+HJO0PXHG4GMFQkXePKmigMNMsUn6dLdCh+uuD2WVYK vz8F6ePcOrr2Ygn0JaJPypl8AjVHD4Osv9U7W5oLEWMVXOnY4JMK6dUr9/lBDKkxWkcj 9UXw0o9VRCecOSQVlMWUS4Em1M7sx6OqW8Ra9rFTieP/a9ga+Q1l9wPcECOa7FQ9PSI9 hd3w== X-Gm-Message-State: AJcUukepiFxxk/VcgU+8qxDvi6k1JqvZKDWyISItRhCVsDYKLkm38GTL Bc+APqwPr3SVptTBl544SIcF5w== X-Received: by 2002:a65:4b82:: with SMTP id t2mr1657106pgq.189.1546956529239; Tue, 08 Jan 2019 06:08:49 -0800 (PST) Received: from kshutemo-mobl1.localdomain (fmdmzpr04-ext.fm.intel.com. [192.55.54.39]) by smtp.gmail.com with ESMTPSA id c4sm143031535pfm.151.2019.01.08.06.08.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 06:08:48 -0800 (PST) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id C6F5730025E; Tue, 8 Jan 2019 17:08:44 +0300 (+03) Date: Tue, 8 Jan 2019 17:08:44 +0300 From: "Kirill A. Shutemov" To: Bernd Petrovitsch Cc: Jiri Kosina , Vlastimil Babka , Linus Torvalds , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged Message-ID: <20190108140844.tgabxo325enuvu6y@kshutemo-mobl1> References: <047f0582-a4d3-490d-7284-48dfdf9e9471@petrovitsch.priv.at> <8c9feac8-fecb-a56a-afaf-c1352a666991@petrovitsch.priv.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8c9feac8-fecb-a56a-afaf-c1352a666991@petrovitsch.priv.at> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 08, 2019 at 02:53:00PM +0100, Bernd Petrovitsch wrote: > On 08/01/2019 12:37, Jiri Kosina wrote: > > On Tue, 8 Jan 2019, Bernd Petrovitsch wrote: > > > >> Shouldn't the application use e.g. mlock()/.... to guarantee no page > >> faults in the first place? > > > > Calling mincore() on pages you've just mlock()ed is sort of pointless > > though. > > Obviously;-) > > Sorry for being unclear above: If I want my application to > avoid suffering from page faults, I use simply mlock() > (and/or friends) to nail the relevant pages into physical > RAM and not "look if they are out, if yes, get them in" which > has also the risk that these important pages are too soon > evicted again. Note, that mlock() doesn't prevent minor page faults. Mlocked memory is still subject to mechanisms that makes the page temporary unmapped. For instance migration (including NUMA balancing), compaction, khugepaged... -- Kirill A. Shutemov