Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp410868imm; Thu, 10 May 2018 23:40:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1EuYyHBonEW6wbfqtFpLxSGqDoGirmePbOmDxEiZwgyJFTzyHcyedZ54KMHfa3ZG6RPka X-Received: by 2002:a65:4784:: with SMTP id e4-v6mr3451252pgs.196.1526020826873; Thu, 10 May 2018 23:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526020826; cv=none; d=google.com; s=arc-20160816; b=uVwdxnamYnxici70y/NtdvFKyzSYAqKUj8r3utqi+Yerk0iJNQunTMjDmZrEYdwnMI 4aFz7IrWPSGxRBt/iNlepdd4pHp2OGO2scnsEVGDZ46JszumHG2p+6mN8znoKhrrhEBH k89BGI/GvfatMG9doUMH94+P5uTR94oicTey38v0ccYOUNM6HCyzoXCGZnYbma/h/hHh E3Qg8Xs5K5ciBqWvFluJymbmY/F9VLdxqzOctY2vXZMjtsbUgQmaCh4GKk/MbNm9a6XJ ccBBrgpI9W9754KZfO2H3iLW6RCpBN2cuflasKNtRVZOgNLx+nRUKTk2LkEnjeewBQPj RT1A== 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:arc-authentication-results; bh=o9QW8OrIqcnM3uF1L5VapVHnbD7i2Fl1pfEigz9Zn3Y=; b=w+fW8LRhUgRBnL9zUGkeimvSLwQe3l24vXcArfzjC6HU3Uan4DPOEopFsK+zOEiWnT MKD/KUKAc7SRwCQ7rg73y34j6GTsMrwYwnNVIME8H4sSFjTJft1MumoSFA7F29H6+E63 5lQl6mwsl1EEnGxaqkSnbDCfwiEAH3HfcmUDUTbc1sWD3sbuLZFSNJhIXw0UW8fJvqUC wyFyCqbNoGQWmLgbh/ac+tboNBqD4rVgTb2mhxi1NyYjPqPeOE6M/PZOjfE8uFi+Poa3 HJqr/o9D4dTGm2YxeFQPl7kVXXkyTnMFeT2O/7Z6/vq2L9si41o6kDogIchOZuz2IgB4 kFTA== 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 z3-v6si2476892plb.228.2018.05.10.23.40.10; Thu, 10 May 2018 23:40:26 -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 S1752319AbeEKGj6 (ORCPT + 99 others); Fri, 11 May 2018 02:39:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:48558 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbeEKGj5 (ORCPT ); Fri, 11 May 2018 02:39:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 640E6AED0; Fri, 11 May 2018 06:39:55 +0000 (UTC) Date: Fri, 11 May 2018 08:39:52 +0200 From: Michal Hocko To: Prakash Sangappa Cc: Christopher Lameter , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, n-horiguchi@ah.jp.nec.com, drepper@gmail.com, rientjes@google.com Subject: Re: [RFC PATCH] Add /proc//numa_vamaps for numa node information Message-ID: <20180511063952.GA23231@dhcp22.suse.cz> References: <1525240686-13335-1-git-send-email-prakash.sangappa@oracle.com> <20180504111211.GO4535@dhcp22.suse.cz> <20180510074254.GE32366@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 10-05-18 09:00:24, Prakash Sangappa wrote: > > > On 5/10/18 12:42 AM, Michal Hocko wrote: > > On Fri 04-05-18 09:18:11, Prakash Sangappa wrote: > > > > > > On 5/4/18 4:12 AM, Michal Hocko wrote: > > > > On Thu 03-05-18 15:39:49, prakash.sangappa wrote: > > > > > On 05/03/2018 11:03 AM, Christopher Lameter wrote: > > > > > > On Tue, 1 May 2018, Prakash Sangappa wrote: > > > > > > > > > > > > > For analysis purpose it is useful to have numa node information > > > > > > > corresponding mapped address ranges of the process. Currently > > > > > > > /proc//numa_maps provides list of numa nodes from where pages are > > > > > > > allocated per VMA of the process. This is not useful if an user needs to > > > > > > > determine which numa node the mapped pages are allocated from for a > > > > > > > particular address range. It would have helped if the numa node information > > > > > > > presented in /proc//numa_maps was broken down by VA ranges showing the > > > > > > > exact numa node from where the pages have been allocated. > > > > > > Cant you write a small script that scans the information in numa_maps and > > > > > > then displays the total pages per NUMA node and then a list of which > > > > > > ranges have how many pages on a particular node? > > > > > Don't think we can determine which numa node a given user process > > > > > address range has pages from, based on the existing 'numa_maps' file. > > > > yes we have. See move_pages... > > > Sure using move_pages, not based on just 'numa_maps'. > > > > > > > > > > reading this file will not be restricted(i.e requiring CAP_SYS_ADMIN). > > > > > > So a prime motivator here is security restricted access to numa_maps? > > > > > No it is the opposite. A regular user should be able to determine > > > > > numa node information. > > > > Well, that breaks the layout randomization, doesn't it? > > > Exposing numa node information itself should not break randomization right? > > I thought you planned to expose address ranges for each numa node as > > well. /me confused. > > Yes, are you suggesting this information should not be available to a > regular > user? absolutely. We do check ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS) to make sure the access is authorised. > > Is it not possible to get that same information using the move_pages() api > as a regular > user, although one / set of pages at a time? No, see PTRACE_MODE_READ_REALCREDS check in move_pages. -- Michal Hocko SUSE Labs