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.5 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 AC554C5ACC4 for ; Wed, 19 Feb 2020 22:32:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D82724654 for ; Wed, 19 Feb 2020 22:32:49 +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="fmalR7Dk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D82724654 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 DA4946B000A; Wed, 19 Feb 2020 17:32:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D55D66B000C; Wed, 19 Feb 2020 17:32:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6A586B000D; Wed, 19 Feb 2020 17:32:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id AB9C86B000A for ; Wed, 19 Feb 2020 17:32:47 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7736C45A6 for ; Wed, 19 Feb 2020 22:32:47 +0000 (UTC) X-FDA: 76508327574.12.test71_527ec6b9eb949 X-HE-Tag: test71_527ec6b9eb949 X-Filterd-Recvd-Size: 5619 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 22:32:46 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id c23so685800plz.4 for ; Wed, 19 Feb 2020 14:32:46 -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=1DsO1OncDrfIH8uK7Ow93e+y96FrmwbGrgT/pjgHroM=; b=fmalR7DkpBPObdMLyBmcd9JlCI2mgTpDX90EGmJHKSD3R5eiLHhNx6KlnQpeodoe8j rnYgEeiFYVOHRut3iPwkmhxwohdhWJrkn0r1fVx5MeA1PimUeVH3irP/ICpDhmUJyj92 8lfE8BUujxzwfnUAb5GHA2LlwmoyuXZYXvJwK0eg+ZNC0PW03dNMlDHZxhUOmweFeKye xgT8A/7bnBi+1c12fAzSAOL4erQM2hyvQ3F0uqvFORKoBBTeOFhoM53V/dU6tj5YwPb7 XH8Ujt0zZ2fdph1mQZZanQ21+oNS0iPnHvEwqQ5wYSIUxpCf+Je57HnvnsN6xq0caOhG avsQ== 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=1DsO1OncDrfIH8uK7Ow93e+y96FrmwbGrgT/pjgHroM=; b=YhlOVhfYx784fL4JCfKcZHrhXGReJObQcyTm8Zg/WcU7owFdt1eKje/o4ocDTRYoKT PPGNg5NOEdzHD9R9soCedUlTZu25gEB27rEcYwgJmHSb3CNLWiiUW1ExugshyA7nbx7/ zKnLIzMH3wAWc9FsODM2AAplBuPb335LRvdPa7AA6DN7/yGRWVepw919fSPELsz8VvVy iKV+TPhaoMWUyqHT2bAV1Fa5Zh+OJOBSw7M36wPawE/QyO0Twevd3wT/TCNpig3+A62a LAbs1WDqsd94VLAYJlWNwnYHAf8z+3zkhW+v59CeyFD1AnE6iuFkszJ3lum9a6bOX//g LXWw== X-Gm-Message-State: APjAAAXA9KlHnM1hvewz5Mg7XQC2FVIJU04XwMM7KYV67si7SjmRFQ3b OK0pVtwZ9byhzZiZ6RVj+zM= X-Google-Smtp-Source: APXvYqxlZYooOZVZFUvzpT9sR0gVV4abtAmJBaIgGs5GpYxSSi0c5wgtvi6j5OYW51sqJcNMpcl8Xw== X-Received: by 2002:a17:902:d688:: with SMTP id v8mr28891544ply.238.1582151565494; Wed, 19 Feb 2020 14:32:45 -0800 (PST) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id x190sm630390pfb.96.2020.02.19.14.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 14:32:43 -0800 (PST) Date: Wed, 19 Feb 2020 14:32:41 -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 , sj38.park@gmail.com, alexander.h.duyck@linux.intel.com, Jann Horn Subject: Re: [PATCH v6 0/7] introduce memory hinting API for external process Message-ID: <20200219223241.GA148976@google.com> References: <20200219014433.88424-1-minchan@kernel.org> <20200219120123.07dda51c29006a892059ccde@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200219120123.07dda51c29006a892059ccde@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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: Hi Andrew, On Wed, Feb 19, 2020 at 12:01:23PM -0800, Andrew Morton wrote: > On Tue, 18 Feb 2020 17:44:26 -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. > > > > This patchset doesn't seem to be getting a lot of interest from other > potential users? It seems very specialized. Are there or will there > ever be any users of this apart from one Android daemon? Quote from http://lkml.kernel.org/r/20190531064313.193437-1-minchan@kernel.org " Brian Geffon in ChromeOS team had an experiment with process_madvise(2) Quote form him: "What I found is that by using process_madvise after a tab has been back grounded for more than 45 seconds reduced the average tab switch times by 25%! This is a huge result and very obvious validation that process_madvise hints works well for the ChromeOS use case." " > > Also, it doesn't terribly hard for ActivityManagerService to tell > another process "now run madvise with these arguments". Please explain > why this is not practical in ActivityManagerService and also within > other potential users of this syscall. I think that's the almost a same question why ptrace doesn't work so I summarizes the part in [2/7]: * makes target task runnable creates memory layout change window so hiniting a wrong vma * target task(e.g., background task) could live in little core with cpuset/group limited environment so we couldn't react quick enough, which causes more killing. Thanks.