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=-1.2 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FSL_HELO_FAKE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 D7B10C3F2D8 for ; Mon, 2 Mar 2020 21:42:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 980872465E for ; Mon, 2 Mar 2020 21:42:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J8wu8V/A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 980872465E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1C8706B0005; Mon, 2 Mar 2020 16:42:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 153F06B0006; Mon, 2 Mar 2020 16:42:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01A446B0007; Mon, 2 Mar 2020 16:42:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id D96F86B0005 for ; Mon, 2 Mar 2020 16:42:33 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B71478248047 for ; Mon, 2 Mar 2020 21:42:33 +0000 (UTC) X-FDA: 76551746586.16.need73_33677f912ac2c X-HE-Tag: need73_33677f912ac2c X-Filterd-Recvd-Size: 5222 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Mon, 2 Mar 2020 21:42:33 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id o24so332672pfp.13 for ; Mon, 02 Mar 2020 13:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uCaeMVtpR4WxjCDq5Vfh+a8fRchrnLxaj/CXDjUGdA8=; b=J8wu8V/Af3IccEALYEmGUkRRtRQf0eHqJtvdzRy3rVTCrtdP6PW08OeuWgaUNsffoD PHBKH9KVyHoLnN8A5n99gnVHaEJwbFuir0FsRkSJrmmpg5ZS2n1IJuivyJXlRI1anHzK CvTaKm7FaOIoFr+YSVSml1ojUzRuKiXha2tO8pnjISsheobbcDMu2joOWtIHg/p36K+U yUiSplP8t1pld0j2GZOoSTsGrnawOhSlMV8gDnNzpADJ/xQ895qCtOeZZ1QpwEKbkOkl sG5VYnyN5sMoH6grcQAfoB0Jd0P5rcSSnCaDIxXBGUsSjx3zqc9288L4XioDhfPKxlJ+ zCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=uCaeMVtpR4WxjCDq5Vfh+a8fRchrnLxaj/CXDjUGdA8=; b=XssCEUxtbj6GtDIAgMKa98PCHlzkslu70I36JCgPa+7UsP+USEjNosbA2Pd1KabjpP mnm6KdfVsk2dKkaIsRZxSs35OklQonO2bCNCBKqov0HUgA5AjvBatM6HaLl8PAu5zctR cZg9ymVo1rWf+o/AZzPg+/3Rie1xnqm3ij+nVMHua+QwE2YuhTvQ/LMg3DhlhO8J5n7f idAh4FDx6jC0/P4rUDzcS7NFBHjbqloWNXOz9CvhZlrTLglYJAeuUkkTxDoqlaPqw/SI qq0lrvX29R1JXMcpan7NzDbP59obJdgjwrv9yXebJUJHg383z6IvqzPocFGw9XyU8xKl jMLg== X-Gm-Message-State: ANhLgQ3wTmu3wuAuLQD10Zylq281DTjuaaeuLZwgllinFw1XCMNwN4v9 5iK04eiR8IoP6SVIuexfkjg= X-Google-Smtp-Source: ADFU+vtKj7Kdji9S24ngTS6f/a4A5/EsWr2TF1Am3s89ghNlWHDiZAC9e3EqX8YodZmfHodpOyNTow== X-Received: by 2002:a63:f501:: with SMTP id w1mr899386pgh.61.1583185351725; Mon, 02 Mar 2020 13:42:31 -0800 (PST) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id ev22sm184390pjb.0.2020.03.02.13.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 13:42:30 -0800 (PST) Date: Mon, 2 Mar 2020 13:42:28 -0800 From: Minchan Kim To: Andrew Morton 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: <20200302214228.GB71660@google.com> References: <20200302193630.68771-1-minchan@kernel.org> <20200302131618.b0f9f0e76d53a69184321884@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200302131618.b0f9f0e76d53a69184321884@linux-foundation.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 02, 2020 at 01:16:18PM -0800, Andrew Morton wrote: > 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? I will prepare it, Thanks!