From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3195FC433FF for ; Wed, 7 Aug 2019 20:04:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09BC922305 for ; Wed, 7 Aug 2019 20:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565208249; bh=bAnZKDOHa6S/AueqvOn27z8E6ylUixYsDkIKVgnZVKU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=cG95709Km7Wlt0r7r2s9dwYorfwTK41j15y9lJwQKAHWZSTlq7g3nS6PZuGAzTjNG 2bQhiKXyNDOOBsB/kGwvYeGPXd5VJl2msaxP9wus0l2KZreczWf4YDr6ys/VqSAvi/ ouJel1TqOBX38gLMh0UPTgIYyv7wZtFUZrd87O5w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387969AbfHGUEE (ORCPT ); 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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?