Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5881589ybh; Wed, 7 Aug 2019 13:05:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBdf5jfGF/3QlXgWgm3RgGz8Ph46H7k6+f2Ujwq0yFUZrJjq9lUGg/tTbrDacENKkwcMvt X-Received: by 2002:aa7:82da:: with SMTP id f26mr11293691pfn.82.1565208316152; Wed, 07 Aug 2019 13:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565208316; cv=none; d=google.com; s=arc-20160816; b=MbcdIwV0xYWfMQxpV1OCq77FE2dGW3J0Yqr39yYQEpsRd/alocRiCVcxBUZ6dZqxrg hzQIvMnCZGN6LtDHMkLQSYmMiTv8Qp3Y1SgpA1RmyBy6fAa7QJK3Td1VVHSVY6RWOFpx lF2y4ym5P3YqUJA3puI4xLYoSm5Tg3UBq/cj6BT5ETIarkdWgcNPx4Pq6f7xUwPZMZvK Obg5L3ZQjPAjWEwAhApy1GP0mf4iNrrHRK+oTm3PsCMCvzirKUaLGwYrQweAXIlIB/64 x7ahpa+ytC1xyEcN8FUNvxLlJR4QJ8lJil4ed8/3ehC8apijI6vxa2HTgCRUgzZV4Xqq 7Ffg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=TCrKpv/9CorIIjiGQ/BTwwHa+JmbCtLDQrzBhZE1H5A=; b=sbE4C/sNQgvP2eoQBeAXV6Gp8YFmN96dvoA33N/0TPM45iGwclchOG9WQTnPoNgsxE Ao2kGa73AVxGDETd5mC19xje8Ijr5FuBHssoYpP+LNFZkpRt6NZI4H0TI+J4UfVC8ctH jBOhtAfIVb1ck7dZihZaSV9n94JD5YBoLHOfWmuCs5KxYy402iKK3mZop5avVO80mMK/ S3Nh1/elKK4JBiaPcWXmGxzhtvZHwIPhacvkFY6I3cfT1fX6SSR1GUU8nkFW4nfuEa9t DP9897c+Hco/in2HJQiLcw5op2IbjsE4PHIwitbrOdeiSByfMkoE7rKr869q1LBq1mZd wYAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YVf9MEhf; 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 t20si37385987pgv.580.2019.08.07.13.05.00; Wed, 07 Aug 2019 13:05:16 -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=@kernel.org header.s=default header.b=YVf9MEhf; 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 S2388703AbfHGUEE (ORCPT + 99 others); Wed, 7 Aug 2019 16:04:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729714AbfHGUEE (ORCPT ); Wed, 7 Aug 2019 16:04:04 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5A4402229C; Wed, 7 Aug 2019 20:04:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565208243; bh=bAnZKDOHa6S/AueqvOn27z8E6ylUixYsDkIKVgnZVKU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YVf9MEhf32W89lIFkjGgA88GCVZUVwxfcFmTKmPUg1Q1y6FDrsnr0QeqCQi2SxSAj boCVYX0PmLYKtZPc0GeShN1mYQGBwDMs4u3zZmSSnElYlW9VIKtGrr+WQfA7EMdUZ7 l8JiW40t7+5cKUXM2gftIZQ0r8IJhj4wMos6tTo0= Date: Wed, 7 Aug 2019 13:04:02 -0700 From: Andrew Morton To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan , Borislav Petkov , Brendan Gregg , Catalin Marinas , Christian Hansen , dancol@google.com, fmayer@google.com, "H. Peter Anvin" , Ingo Molnar , joelaf@google.com, Jonathan Corbet , Kees Cook , kernel-team@android.com, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Mike Rapoport , minchan@kernel.org, namhyung@google.com, paulmck@linux.ibm.com, Robin Murphy , Roman Gushchin , Stephen Rothwell , surenb@google.com, Thomas Gleixner , tkjos@google.com, Vladimir Davydov , Vlastimil Babka , Will Deacon Subject: Re: [PATCH v5 1/6] mm/page_idle: Add per-pid idle page tracking using virtual index Message-Id: <20190807130402.49c9ea8bf144d2f83bfeb353@linux-foundation.org> In-Reply-To: <20190807171559.182301-1-joel@joelfernandes.org> References: <20190807171559.182301-1-joel@joelfernandes.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Aug 2019 13:15:54 -0400 "Joel Fernandes (Google)" wrote: > In Android, we are using this for the heap profiler (heapprofd) which > profiles and pin points code paths which allocates and leaves memory > idle for long periods of time. This method solves the security issue > with userspace learning the PFN, and while at it is also shown to yield > better results than the pagemap lookup, the theory being that the window > where the address space can change is reduced by eliminating the > intermediate pagemap look up stage. In virtual address indexing, the > process's mmap_sem is held for the duration of the access. So is heapprofd a developer-only thing? Is heapprofd included in end-user android loads? If not then, again, wouldn't it be better to make the feature Kconfigurable so that Android developers can enable it during development then disable it for production kernels?