Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2148207imu; Sat, 5 Jan 2019 16:14:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/XFYixUVazYz85UVWH+6YVj+p91x7TIB4pdEbRrMSBNFLvMx8plv93sMNdUUZLBjTw2RLn8 X-Received: by 2002:a62:1709:: with SMTP id 9mr57248933pfx.249.1546733641149; Sat, 05 Jan 2019 16:14:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546733641; cv=none; d=google.com; s=arc-20160816; b=g8kj2BtXYH7Ri/G9xl1E0qqZgmN6BhQ6GvT30K3ZFQiNG3JVAYpAvaW+npZ8yqP2/g +REPOUe3R2pbDaVpMitLlGH5mSFmsaD/A68N5Rsq5N+WqTErWHogFRDMLH/MLg6TmuaU fGn52eevIZt6b9khbL1Vsy3sjAsHoKN+QhGhKHJtOjHb1RVF2ua6mPjvWab2qo3/Ec2w 0eiusC953j4de8A1Zi0fTIHYAb4Ty2BqKP2x6y7U5mQIt3lXVbsKgydYGOf+rybvu5RR xsfhRiPzKq1HVqAWC3w/GB4WOBcQoBgT63B1bPwmg7aSAcqbIw7ndniqaLTWGpC9LJfw M8Jg== 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=hrWMddqDVg55lVU7GWrgf6C5GPOqZ5qTBBQkTmgMG20=; b=pYzEvZ3U0t9CdxXhFhHEcbmve4diwS/8lwjm5WhEu5gCm0CFMam9Pve835wFsbxoYH swOVuXWxWxWYm7k5BtzmA60akIIhEdqbi1P4rsXWAC2jLh3cCwNE26xA22Nyf0WAgYMD zocmd7DAMAHWMa2pl40pWTwiVnKwC8SxGC3DI4aipAAcQwX9SN6bTCCUVJWK7gFl2vv1 V36LJxBIWWG/budGzVl0qrr9rm886SwCy3S4jmK/8fo4pSjX/cr8IRlMH2J0coiR/NLX gBHxEjmyA2a2zmPEDI478PWwGv+MoyOzdkfcUHc15BIdett/LxBOz1u/Ia45hjF5sLmX XzTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=i0NsD4cD; 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 s13si58097844pgh.583.2019.01.05.16.13.43; Sat, 05 Jan 2019 16:14:01 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=i0NsD4cD; 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 S1726383AbfAFALp (ORCPT + 99 others); Sat, 5 Jan 2019 19:11:45 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:34418 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbfAFALp (ORCPT ); Sat, 5 Jan 2019 19:11:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hrWMddqDVg55lVU7GWrgf6C5GPOqZ5qTBBQkTmgMG20=; b=i0NsD4cDbJfDVcVT2Vf0bgcLK +bI6mAXzF4IhznJ1yfw9xF7toCT46yU+za3AqoNR3Up1jaDOhcPDTmwbvSyyKruQYkgHc9uL2WFfh ij6dKZjt5dKq9cot2+RGs65x1p8ahNKwyAtdPLfcvbVcMlKfIp7KiXYAMShhkC7Z9Cg2uEQ8b1lxB HtKuskOhsKKt71fGq0kiG2ae1Q0EocD55AeDVI9Yrsli57pK5e9r+QgZXQbZcR/ZFarTKb5HVKPZO b6xaa6l9TSJne0S54uu9f2QoSpFONutQRGEFQdE7zK3ryqva9zLlP5gby0ubKTJri7xHbYv3s4nof 2gaH4nivw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfw2U-0007jO-SK; Sun, 06 Jan 2019 00:11:38 +0000 Date: Sat, 5 Jan 2019 16:11:38 -0800 From: Matthew Wilcox To: Linus Torvalds Cc: Jann Horn , Jiri Kosina , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Linux API Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged Message-ID: <20190106001138.GW6310@bombadil.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 05, 2019 at 03:39:10PM -0800, Linus Torvalds wrote: > On Sat, Jan 5, 2019 at 3:16 PM Linus Torvalds > wrote: > > > > It goes back to forever, it looks like. I can't find a reason. > > mincore() was originally added in 2.3.52pre3, it looks like. Around > 2000 or so. But sadly before the BK history. > > And that comment about > > "Later we can get more picky about what "in core" means precisely." > > that still exists above mincore_page() goes back to the original patch. FreeBSD claims to have a manpage from SunOS 4.1.3 with mincore (!) https://www.freebsd.org/cgi/man.cgi?query=mincore&apropos=0&sektion=0&manpath=SunOS+4.1.3&arch=default&format=html DESCRIPTION mincore() returns the primary memory residency status of pages in the address space covered by mappings in the range [addr, addr + len). The status is returned as a char-per-page in the character array referenced by *vec (which the system assumes to be large enough to encompass all the pages in the address range). The least significant bit of each character is set to 1 to indicate that the referenced page is in pri- mary memory, 0 if it is not. The settings of other bits in each char- acter is undefined and may contain other information in the future.