Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2666022ybf; Mon, 2 Mar 2020 13:16:46 -0800 (PST) X-Google-Smtp-Source: ADFU+vvfiJCdZWIiuv2C5VzEtIExFsgfPkgAv0kwY8yiGwXEqmGC4Q7sKNmuTBkF/si9h09V/p7A X-Received: by 2002:a05:6808:6cd:: with SMTP id m13mr264135oih.53.1583183805913; Mon, 02 Mar 2020 13:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583183805; cv=none; d=google.com; s=arc-20160816; b=E/7yp0LcFgIP4dGx2Qn5+1DgwsE66BOU705wq5haqs6ZHqqZqKgwQrM5AJMiLfOMzo 6C1mAjlnENyz7g01M/GVdm1yY2cHRD2sZE61JxIa4D88Mqcjzq995/duGOMac+6dqzdQ 5hcHSxxRrTsT5JeaLGnRjBWgO+XJky/dqXj5k3ECe94Wz4KfhgTs4NbOZZvRpEQdn8Ki VQhBrNtCP5ffK1ukyglriEb0Pt70tBOevUd7Kg1nmf1wJsbAcKuD6gC7XdNya9Hcjc34 N3NtWrJkkDERtlinI1fdJVycomOQKT/uDDoeB1k3iJT+RfjxP57QF4dtqHo6RoY9AiNN aU0w== 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=MpC3Pe8ScApHf5hmRMjCfeE3h6tj4BOPk3ryKFEPEY8=; b=YdyIGVv2wGkIGR4Ntp0bzkeOTTBljWIiQOnAqObk7Ne2ZPTmywQWn2f3KJoN7AFUQI q+oGskAcy1WSNkMkxo9UccpCa+vktuECWIJD2ExgxO2U8lq/hMKVQhFqRoGxg80mmOof 7O2JLTpxI8jcJt2ilpPh2uzoY2U2cloF2gJka5qB/YH80WhngzILRiD5YtWwtU8iPV90 TDXqTN00CxAMAUTMbkhV7IQsUR0mU3Lm20bnqrfQnFYp+y4zHP69NBrcPJkIMeP5gULU lcvmmu6/J8CybWMD0xtE6tvdjQV/YQfPkg1AA3VizdZ4+zizORAdNi7lfsvR3bA72HwO +E4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZmcLe9ua; 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 y24si6899076oih.24.2020.03.02.13.16.34; Mon, 02 Mar 2020 13:16:45 -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=pass header.i=@kernel.org header.s=default header.b=ZmcLe9ua; 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 S1726755AbgCBVQU (ORCPT + 99 others); Mon, 2 Mar 2020 16:16:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:52258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbgCBVQU (ORCPT ); Mon, 2 Mar 2020 16:16:20 -0500 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (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 A456F20873; Mon, 2 Mar 2020 21:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583183779; bh=1zHdXUwUuJKgz+S2bvIxUrqahpJf4qagshjRfd/2x6w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZmcLe9uaAA2Qx+E2R23T0roasOLIwuwb4Ktw0FpDcq7IuHF0bxOc874A5Vgvyr/zN 7shrL4WwoFYUXOCtUCrTkpJIO5vSMfYGlSp982jYZfyDSLtYt8Mn6YILc7T16dRdeY RmZOGzGZtOz3uiYbZUFBdNU6SItSYiMVo7NkrJvk= Date: Mon, 2 Mar 2020 13:16:18 -0800 From: Andrew Morton To: Minchan Kim Cc: LKML , linux-mm , linux-api@vger.kernel.org, oleksandr@redhat.com, Suren Baghdasaryan , Tim Murray , Daniel Colascione , Sandeep Patil , Sonny Rao , Brian Geffon , Michal Hocko , Johannes Weiner , Shakeel Butt , John Dias , Joel Fernandes , Jann Horn , alexander.h.duyck@linux.intel.com, sj38.park@gmail.com Subject: Re: [PATCH v7 0/7] introduce memory hinting API for external process Message-Id: <20200302131618.b0f9f0e76d53a69184321884@linux-foundation.org> In-Reply-To: <20200302193630.68771-1-minchan@kernel.org> References: <20200302193630.68771-1-minchan@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; 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 Mon, 2 Mar 2020 11:36:23 -0800 Minchan Kim wrote: > Now, we have MADV_PAGEOUT and MADV_COLD as madvise hinting API. With that, > application could give hints to kernel what memory range are preferred to be > reclaimed. However, in some platform(e.g., Android), the information > required to make the hinting decision is not known to the app. > Instead, it is known to a centralized userspace daemon(e.g., ActivityManagerService), > and that daemon must be able to initiate reclaim on its own without any app > involvement. > > To solve the concern, this patch introduces new syscall - process_madvise(2). > Bascially, it's same with madvise(2) syscall but it has some differences. > > 1. It needs pidfd of target process to provide the hint > 2. It supports only MADV_{COLD|PAGEOUT|MERGEABLE|UNMEREABLE} at this moment. > Other hints in madvise will be opened when there are explicit requests from > community to prevent unexpected bugs we couldn't support. > 3. Only privileged processes can do something for other process's address > space. > > For more detail of the new API, please see "mm: introduce external memory hinting API" > description in this patchset. Thanks, I grabbed these. I massaged the patch titles significantly - mainly to alert readers to the fact that we're proposing a new syscall. Is a manpage for process_madvise(2) being prepared?