Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5929231ybh; Wed, 7 Aug 2019 14:01:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrsyGXYE/Xu32yPEsZZkLeagLKrBbGudYHqkaIUuBNqucr+JQ102AYgR0hoIO8mfyomM2F X-Received: by 2002:a17:902:d892:: with SMTP id b18mr9343961plz.165.1565211660590; Wed, 07 Aug 2019 14:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565211660; cv=none; d=google.com; s=arc-20160816; b=XrGgcKHTCqKPxxFmSF+69r2zTalMdYcanoklNnXgvMwF/i4oT9bGOHAHOIesYfV+Y3 uO0S1JSI9PNk9e9B44Q+1QGytmKdRJh5VIHkktGzqlKg7jEMTFBSgb1OIMQ/DVCqaRn3 vWlgPvhaFKQ5zQfMFLmor44fkcuRcTaXGtt/E8TWoWwx0fdX80E7fGWBDmrr5QlxrYwq +h/Ok+NJL7PLvCP2L71NEKMglCLAlegxzNbiqEwHahv/of0X04A1xHUyS4z7zrXTJrDT 8AndP5/gIB2JvJJhv9mglPvjCHduS3x0jFdn02TMG1A4lcLYBrIBkAO3gNMVBEIwC7ZO XDZA== 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=j94Ug7s5ET6/R/IxgZElXz+z5GBfj769ZpmyDC2waXo=; b=iD+rxSKUeAjVrbIhlJ/OM9kDrq79rlwacSCJ9FqZgKapakDsSb3NHr0DvWpDSJVXx6 YTFNJPnSSVRjbnesfXiLvyW1HWK29bQQnEi7JCbocyFIkx06reh4f8CFmb/qngTtsUEc yvmVudpZ3V9yIbOXMPAo7k0JGEYKuWopncJyDatHvk/H1RyFVf9NswJ5dReQ4OV2cYvO Yvd0V8r/nTwNxk974oiQnXKZ5Vps7ppylauwspcP2ToI5cjVL20bqNNza5yRexTQd4iy pZijhlOizyKckTpPyDXQOqwxoT5mRyiY1NaQsvN5h9LeUs+mUHlX3+U7dvvto+oRXp+l szrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u8sRhP8b; 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 i68si51593324pfc.153.2019.08.07.14.00.43; Wed, 07 Aug 2019 14:01:00 -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=u8sRhP8b; 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 S2389241AbfHGU6m (ORCPT + 99 others); Wed, 7 Aug 2019 16:58:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:58456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729714AbfHGU6m (ORCPT ); Wed, 7 Aug 2019 16:58:42 -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 8357A2173C; Wed, 7 Aug 2019 20:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565211521; bh=BHNLhewizLMLp7YbdvNCnIzAyhkg8YnrouHHCEfoVa4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=u8sRhP8bK815tFw7ifhBS4SB17zcgKZ47zrUXrczJIScpe3WeCh14v/46lx0CCeRW 0rylwHRSL91S/Vbfj1YBHXKkOsfP1dbUn9GG5ygIrbrkQElQQjhhVbQw/U11jkcUcy /6UT11ZTtKTBTxqWUlh1WwFRaVjP4y6LQYMuaHYg= Date: Wed, 7 Aug 2019 13:58:40 -0700 From: Andrew Morton To: Joel Fernandes 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 , 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: <20190807135840.92b852e980a9593fe91fbf59@linux-foundation.org> In-Reply-To: <20190807204530.GB90900@google.com> References: <20190807171559.182301-1-joel@joelfernandes.org> <20190807130402.49c9ea8bf144d2f83bfeb353@linux-foundation.org> <20190807204530.GB90900@google.com> 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 16:45:30 -0400 Joel Fernandes wrote: > On Wed, Aug 07, 2019 at 01:04:02PM -0700, Andrew Morton wrote: > > 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? > > Almost all of this code is already configurable with > CONFIG_IDLE_PAGE_TRACKING. If you disable it, then all of this code gets > disabled. > > Or are you referring to something else that needs to be made configurable? Yes - the 300+ lines of code which this patchset adds! The impacted people will be those who use the existing idle-page-tracking feature but who will not use the new feature. I guess we can assume this set is small...