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=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E4E65C433DF for ; Mon, 22 Jun 2020 19:36:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A323E20786 for ; Mon, 22 Jun 2020 19:36:40 +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="jX6laj/G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A323E20786 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 3DDFF8D0002; Mon, 22 Jun 2020 15:36:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 38BAB6B0033; Mon, 22 Jun 2020 15:36:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2551F8D0002; Mon, 22 Jun 2020 15:36:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 07BD16B0030 for ; Mon, 22 Jun 2020 15:36:40 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BB68F180AD817 for ; Mon, 22 Jun 2020 19:36:39 +0000 (UTC) X-FDA: 76957854918.20.mine26_521615e26e35 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 80EA8183C0A8B for ; Mon, 22 Jun 2020 19:36:39 +0000 (UTC) X-HE-Tag: mine26_521615e26e35 X-Filterd-Recvd-Size: 5531 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 19:36:39 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id z63so8873008pfb.1 for ; Mon, 22 Jun 2020 12:36:38 -0700 (PDT) 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; bh=SL19nea2/x/BTVEfq3tEcv8dczThi2gQ+pctAMjhBis=; b=jX6laj/GLKW8OrK62WrqFv1Ix+RuTRrkjsPWJ66J4iz7W021DvRBARhZb/NFV31mYT J7reeZI3hJhOGbmrFl6UIZGftFqGWpH4XNyxc6i1HeuvU8xVo8v4Xm0UleSiHswNTRXN 3bRfknYIwZbME+HpCyINSMnOdIQULa338Cn5lxOxzvk/QKpmOcooZGwoJvq5FGZPKz2Z U4wm0mmFaoohpNkOmmY0W7YZizyu9g89tFGAipnZIvgEd5xZ0z2A/t4Qvdv95e/wgdJX 5JvieE0PbMR0ITFtPHFIqjiC579ANAGr7aG3tiKGis+3Mrn5i9YBbgzEJ156YTCHJWju /ekA== 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; bh=SL19nea2/x/BTVEfq3tEcv8dczThi2gQ+pctAMjhBis=; b=EV4Ltp/Tsa/H8O4TZlLdIrQiIpQmyIIqdMshWty8LGYqcg8/x8703PLZvidO1JXG8l VjD0uEFIAfGGnRJKIL3oy+5d8s7xDsc++pMLtrUqHRbWWJrJ/g9hhj+rHUmivUm50xxG TnA91P/Jg5ANK3pFAlZX2bbz9Mx8VTByvkNvRBx8KxOwojiOUFacYLpCoPKSSi0YGb5h Y3+ce2/r+SmkQknZHCfIRG16qv3l5MUY32nTTJd8r+YpNMBjGoVykRSq/IPHBQ1Hs71u dTz/ZlRO2B8Fu9Kv2aegFQ+0NZhxpxgVd3Qy9yFhz6w+xqIzNPdGsuTpdfyJnk8YA0Cn C47g== X-Gm-Message-State: AOAM53293SaKFdKxcHF60A8TOyn86S0nzHy+olsnmze0hMta7IKWmyKQ YONT+oGNyZHq2nSVCwWt3CU= X-Google-Smtp-Source: ABdhPJy+H1EKZ69bUI9csC6dh59Q7kZNckMpQjEugrWLNPuK6AfQLQWrFFbrCuTbD9Sp5VFvDrTkiA== X-Received: by 2002:aa7:972b:: with SMTP id k11mr22374035pfg.299.1592854598029; Mon, 22 Jun 2020 12:36:38 -0700 (PDT) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id b71sm5269965pfb.125.2020.06.22.12.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 12:36:37 -0700 (PDT) Date: Mon, 22 Jun 2020 12:36:35 -0700 From: Minchan Kim To: Andrew Morton , oleksandr@redhat.com Cc: LKML , Christian Brauner , linux-mm , linux-api@vger.kernel.org, oleksandr@redhat.com, Suren Baghdasaryan , Tim Murray , 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, David Rientjes , Arjun Roy Subject: Re: [PATCH v8 0/4] introduce memory hinting API for external process Message-ID: <20200622193635.GA23000@google.com> References: <20200622192900.22757-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200622192900.22757-1-minchan@kernel.org> X-Rspamd-Queue-Id: 80EA8183C0A8B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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, Jun 22, 2020 at 12:28:56PM -0700, 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} 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. > > * from v7 - http://lore.kernel.org/r/20200302193630.68771-1-minchan@kernel.org > * dropping pid support from new syscall and fold releated patches into syscall patch > * dropping KSM patch by discussion - Oleksandr, I lost the discussion. > Please resend the single patch against of the patchset if you resolves the discussion. > https://lore.kernel.org/linux-api/20200302193630.68771-8-minchan@kernel.org/ Oleksandr, it seems you discussed something with Vlastimil but couldn't find conclustion yet and Since Jann put an a new note in the thread, I detach the patch from this patchset. Please send the KSM patch based on this patchset if you belive there is no need to be actionable for comments.